znpt-backend/core/src/main/resources/mapper/DefectMapper.xml

53 lines
2.3 KiB
XML
Raw Normal View History

2025-04-10 14:07:11 +08:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dite.znpt.mapper.DefectMapper">
<sql id="Base_Column_List">
a.defect_id, a.turbine_code, a.blade_code, a.surface_type,
a.defect_type, a.defect_level, a.axial_length, a.chord_length,
a.image_path, a.image_hash
</sql>
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.DefectResp">
select
<include refid="Base_Column_List"/>
from defect a
<where>
<if test="keyword != null and keyword != ''">
# and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
</if>
<if test="defectId != null and defectId != ''">
and a.defect_id like concat ('%', #{defectId}, '%')
</if>
<if test="turbineCode != null and turbineCode != ''">
and a.turbine_code like concat ('%', #{turbineCode}, '%')
</if>
<if test="bladeCode != null and bladeCode != ''">
and a.blade_code like concat ('%', #{bladeCode}, '%')
</if>
<if test="surfaceType != null and surfaceType != ''">
and a.surface_type like concat ('%', #{surfaceType}, '%')
</if>
<if test="defectType != null and defectType != ''">
and a.defect_type like concat ('%', #{defectType}, '%')
</if>
<if test="defectLevel != null and defectLevel != ''">
and a.defect_level like concat ('%', #{defectLevel}, '%')
</if>
<if test="axialLength != null">
and a.axial_length = #{axialLength}
</if>
<if test="chordLength != null">
and a.chord_length = #{chordLength}
</if>
<if test="imagePath != null and imagePath != ''">
and a.image_path like concat ('%', #{imagePath}, '%')
</if>
<if test="imageHash != null and imageHash != ''">
and a.image_hash like concat ('%', #{imageHash}, '%')
</if>
</where>
</select>
</mapper>