水利项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

78 lines
4.3 KiB

<?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.kms.yxgh.df.mapper.DfYhPlanMapper">
<resultMap id="approvalMap" type="com.kms.yxgh.common.dto.ApprovalDetailDto">
<id property="id" column="id"/>
<result property="formId" column="formId"/>
<result property="submitTime" column="submit_time"/>
<result property="approvalTime" column="approval_time"/>
<result property="status" column="status"/>
<result property="comment" column="comment"/>
<result property="operator" column="operator" typeHandler="com.kms.yxgh.common.mapper.handler.OperatorHandler"/>
<result property="doc" column="ts_doc" typeHandler="com.kms.yxgh.common.mapper.handler.ListDocHandler"/>
<association property="detail" javaType="com.kms.yxgh.df.dto.DfYhPlanDetailDto">
<id property="id" column="yh_id"/>
<result property="dikeCode" column="dike_code"/>
<result property="dikeName" column="dike_name"/>
<result property="dikeType" column="dike_type"/>
<result property="name" column="plan_name"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="supplements" column="supplement"
typeHandler="com.kms.yxgh.common.mapper.handler.ListSupplementHandler"/>
<result property="doc" column="doc" typeHandler="com.kms.yxgh.common.mapper.handler.ListDocHandler"/>
<result property="engineeringUnit" column="engineering_unit"/>
<result property="responsiblePerson" column="responsible_person"
typeHandler="com.kms.yxgh.common.mapper.handler.OperatorHandler"/>
<result property="type" column="type"/>
<result property="status" column="status"/>
<result property="remark" column="remark"/>
</association>
</resultMap>
<select id="approvalSearchPage" resultMap="approvalMap">
SELECT ts.id id, ts.form_id formId, ts.create_time submit_time, ts.approval_time approval_time, ts.status
status,
ts.operator operator, ts.comment comment, ts.doc ts_doc,
yh.id yh_id, yh.dike_code dike_code, yh.dike_name dike_name, yh.name plan_name, yh.start_date start_date,
yh.end_date
end_date,
yh.supplement supplement, yh.doc doc, yh.engineering_unit engineering_unit, yh.responsible_person
responsible_person,
yh.type type
FROM bs_sgc_sp_task ts
LEFT JOIN bs_sgc_sp_operator op ON ts.id = op.task_id and op.uid = #{dto.userId}
LEFT JOIN bs_sgc_df_yhjh yh ON yh.id = ts.form_id
LEFT JOIN att_dike_base jb ON yh.dike_code = jb.dike_code and jb.expr_date is null
WHERE ts.business_type = #{dto.businessType}
<if test='dto.status != null and dto.status != ""'>
AND ts.status = #{dto.status}
</if>
<if test="dto.condition!= null and dto.condition.dikeType != null and dto.condition.dikeType != ''">
AND jb.dike_type = #{dto.condition.dikeType}
</if>
<if test='dto.condition!= null and dto.condition.dikeCode != null and dto.condition.dikeCode != ""'>
AND jb.dike_code = #{dto.condition.dikeCode}
</if>
<if test='dto.condition!= null and dto.condition.name != null'>
AND yh.name LIKE CONCAT('%',#{dto.condition.name},'%')
</if>
<if test='dto.condition!= null and dto.condition.adcd != null and dto.condition.adcd != ""'>
AND jb.adcd LIKE CONCAT(#{dto.condition.adcd},'%')
</if>
<if test='dto.condition!= null and dto.condition.dikeName != null and dto.condition.dikeName != ""'>
AND jb.dike_name LIKE CONCAT('%',#{dto.condition.dikeName},'%')
</if>
<if test='dto.condition!= null and dto.condition.startDate != null and dto.condition.startDate != ""'>
AND yh.start_date &gt;= #{dto.condition.startDate}
</if>
<if test='dto.condition!= null and dto.condition.endDate != null and dto.condition.endDate != ""'>
AND yh.end_date &lt;= #{dto.condition.endDate}
</if>
ORDER BY yh.create_time DESC
</select>
</mapper>