2025-04-11 23:17:53 +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.PartMapper">
|
|
|
|
|
|
|
|
|
2025-05-08 00:16:08 +08:00
|
|
|
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.PartListResp">
|
|
|
|
SELECT
|
|
|
|
pa.part_id, t.project_id, pr.project_name, t.turbine_id, t.turbine_name, pa.part_name, pa.part_code, pa.part_type, pa.part_desc
|
|
|
|
FROM part pa
|
|
|
|
LEFT JOIN turbine t ON pa.turbine_id = t.turbine_id
|
|
|
|
LEFT JOIN project pr ON t.project_id = pr.project_id
|
2025-04-11 23:17:53 +08:00
|
|
|
<where>
|
|
|
|
<if test="keyword != null and keyword != ''">
|
2025-05-08 00:16:08 +08:00
|
|
|
# and (pa.part_name like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or pa.part_code like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
2025-04-11 23:17:53 +08:00
|
|
|
</if>
|
|
|
|
<if test="projectId != null and projectId != ''">
|
2025-05-08 00:16:08 +08:00
|
|
|
and t.project_id = #{projectId}
|
2025-04-11 23:17:53 +08:00
|
|
|
</if>
|
2025-04-24 13:54:17 +08:00
|
|
|
<if test="turbineId != null and turbineId != ''">
|
2025-05-08 00:16:08 +08:00
|
|
|
and t.turbine_id = #{turbineId}
|
2025-04-11 23:17:53 +08:00
|
|
|
</if>
|
|
|
|
<if test="partType != null and partType != ''">
|
2025-05-08 00:16:08 +08:00
|
|
|
and a.part_type = #{partType}
|
2025-04-11 23:17:53 +08:00
|
|
|
</if>
|
2025-05-08 00:16:08 +08:00
|
|
|
<if test="partManufacturer != null and partManufacturer != ''">
|
|
|
|
and a.part_manufacturer like concat ('%', #{partManufacturer}, '%')
|
2025-04-11 23:17:53 +08:00
|
|
|
</if>
|
2025-05-08 00:16:08 +08:00
|
|
|
<if test="partModel != null and partModel != ''">
|
|
|
|
and a.part_model like concat ('%', #{partModel}, '%')
|
2025-04-11 23:17:53 +08:00
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</mapper>
|
|
|
|
|