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

40 lines
1.7 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.TurbineMapper">
<sql id="Base_Column_List">
2025-04-24 13:54:17 +08:00
a.turbine_id, a.project_id, a.turbine_name, a.turbine_desc,
a.manufacturer, a.model
2025-04-10 14:07:11 +08:00
</sql>
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.TurbineResp">
select
<include refid="Base_Column_List"/>
from turbine 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>
2025-04-24 13:54:17 +08:00
<if test="turbineId != null and turbineId != ''">
and a.turbine_id like concat ('%', #{turbineId}, '%')
2025-04-10 14:07:11 +08:00
</if>
<if test="projectId != null and projectId != ''">
and a.project_id like concat ('%', #{projectId}, '%')
</if>
2025-04-24 13:54:17 +08:00
<if test="turbineName != null and turbineName != ''">
and a.turbine_name like concat ('%', #{turbineName}, '%')
</if>
<if test="turbineDesc != null and turbineDesc != ''">
and a.turbine_desc like concat ('%', #{turbineDesc}, '%')
</if>
<if test="manufacturer != null and manufacturer != ''">
and a.manufacturer like concat ('%', #{manufacturer}, '%')
</if>
<if test="model != null and model != ''">
and a.model like concat ('%', #{model}, '%')
</if>
2025-04-10 14:07:11 +08:00
</where>
</select>
</mapper>