46 lines
2.0 KiB
XML
46 lines
2.0 KiB
XML
|
<?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.ProjectMapper">
|
||
|
|
||
|
<sql id="Base_Column_List">
|
||
|
a.project_id, a.project_name, a.farm_name, a.farm_address,
|
||
|
a.client_id, a.method_id, a.scale, a.turbine_model
|
||
|
</sql>
|
||
|
|
||
|
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ProjectResp">
|
||
|
select
|
||
|
<include refid="Base_Column_List"/>
|
||
|
from project 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="projectId != null and projectId != ''">
|
||
|
and a.project_id like concat ('%', #{projectId}, '%')
|
||
|
</if>
|
||
|
<if test="projectName != null and projectName != ''">
|
||
|
and a.project_name like concat ('%', #{projectName}, '%')
|
||
|
</if>
|
||
|
<if test="farmName != null and farmName != ''">
|
||
|
and a.farm_name like concat ('%', #{farmName}, '%')
|
||
|
</if>
|
||
|
<if test="farmAddress != null and farmAddress != ''">
|
||
|
and a.farm_address like concat ('%', #{farmAddress}, '%')
|
||
|
</if>
|
||
|
<if test="clientId != null and clientId != ''">
|
||
|
and a.client_id like concat ('%', #{clientId}, '%')
|
||
|
</if>
|
||
|
<if test="methodId != null and methodId != ''">
|
||
|
and a.method_id like concat ('%', #{methodId}, '%')
|
||
|
</if>
|
||
|
<if test="scale != null and scale != ''">
|
||
|
and a.scale like concat ('%', #{scale}, '%')
|
||
|
</if>
|
||
|
<if test="turbineModel != null and turbineModel != ''">
|
||
|
and a.turbine_model like concat ('%', #{turbineModel}, '%')
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
</mapper>
|
||
|
|