| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?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.xjrsoft.module.oa.mapper.OfficialDocumentReceivedHandleMapper">
- <select id="getPage" parameterType="com.xjrsoft.module.oa.dto.OfficialDocumentReceivedHandlePageDto" resultType="com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandlePageVo">
- SELECT DISTINCT t1.id, t6.name AS receivedTypeCn, t1.received_title,t1.received_number,
- t1.received_date,t1.communication_org,t1.communication_number,t3.name AS handle_duty_user_name,
- REPLACE((
- SELECT GROUP_CONCAT(c2.name) FROM official_document_received_handle c1
- INNER JOIN xjr_user c2 ON c1.receive_user_id = c2.id
- WHERE c1.delete_mark = 0 AND c1.official_document_received_id = t1.id AND c1.is_transfer = 1
- ORDER BY c1.create_date
- ),',', '>') AS receive_user_names,t1.is_handle,t4.name AS handle_user_name,t1.handle_time,
- IFNULL((
- SELECT COUNT(*) > 0 FROM official_document_received_handle WHERE official_document_received_id = t1.id
- AND create_user_id = 14954825521605
- ), 0) AS is_transfer
- FROM official_document_received t1
- INNER JOIN xjr_workflow_form_relation t2 ON t1.id = CAST(t2.form_key_value AS SIGNED)
- LEFT JOIN xjr_user t3 ON t1.handle_duty_user_id = t3.id
- LEFT JOIN xjr_user t4 ON t1.handle_user_id = t4.id
- LEFT JOIN official_document_received_handle t5 ON t1.id = t5.official_document_received_id
- LEFT JOIN xjr_dictionary_detail t6 ON t1.received_type = t6.code
- WHERE t2.current_state = 'COMPLETED'
- AND t1.delete_mark = 0
- <if test="dto.loginUserId != null">
- AND (t1.handle_duty_user_id = #{dto.loginUserId} or t5.receive_user_id = #{dto.loginUserId})
- </if>
- <if test="dto.handleUserName != null and dto.handleUserName != ''">
- AND t4.name like concat('%', #{dto.handleUserName},'%')
- </if>
- <if test="dto.handleDutyUserName != null and dto.handleDutyUserName != ''">
- AND t3.name like concat('%', #{dto.handleDutyUserName},'%')
- </if>
- <if test="dto.receivedTitle != null and dto.receivedTitle != ''">
- AND t1.received_title like concat('%', #{dto.receivedTitle},'%')
- </if>
- <if test="dto.isHandle != null">
- AND t1.is_handle = #{dto.isHandle}
- </if>
- <if test="dto.receivedType != null and dto.receivedType != ''">
- AND t1.received_type like concat('%', #{dto.receivedType},'%')
- </if>
- <if test="dto.receivedDateStart != null and dto.receivedDateEnd != ''">
- AND t1.received_date between and #{dto.receivedDateStart} and #{dto.receivedDateEnd}
- </if>
- <if test="dto.handleDateStart != null and dto.handleDateEnd != ''">
- AND DATE_FORMAT(t1.handle_time, '%Y-%m-%d') between and #{dto.handleDateStart} and #{dto.handleDateEnd}
- </if>
- order by t1.id desc
- </select>
- </mapper>
|