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

27 lines
1.0 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">
a.turbine_code, a.project_id
</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>
<if test="turbineCode != null and turbineCode != ''">
and a.turbine_code like concat ('%', #{turbineCode}, '%')
</if>
<if test="projectId != null and projectId != ''">
and a.project_id like concat ('%', #{projectId}, '%')
</if>
</where>
</select>
</mapper>