| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <?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.template.mapper.ApplicationProcedureMapper">
- <select id="pageList" resultType="com.template.model.vo.ApplicationProcedureVo">
- SELECT
- apu.id as id,
- apu.user_name as usersName,
- apu.start_time as startTime,
- apu.end_time as endTime,
- apu.department as department,
- apu.change_user_name as changeUsersName,
- apu.reason_application as reasonApplication,
- apu.submission_time as submissionTime,
- apu.`status` as status,
- apu.approver_user_name as approverUserName,
- apu.examine_and_approve_time as examineAndApproveTime,
- apu.examine_and_approve_remark as examineAndApproveRemark
- FROM
- (
- SELECT
- ap.id,
- u.user_name AS user_name ,
- ap.start_time,
- ap.end_time,
- ap.department,
- u2.user_name as change_user_name,
- ap.reason_application,
- ap.submission_time,
- ap.`status`,
- u3.user_name as approver_user_name,
- ap.examine_and_approve_time,
- ap.examine_and_approve_remark
- FROM
- `application_procedure` ap
- LEFT JOIN users u ON ap.users_id = u.id
- LEFT JOIN users u2 ON ap.change_users_id = u2.id
- LEFT JOIN users u3 ON ap.approver_id = u3.id
- WHERE ap.deleted=0
- ) apu
- <where>
- <if test="submissionStartTime != null and submissionStartTime != '' and submissionEndTime != null and submissionEndTime != '' ">
- and apu.submission_time >= #{submissionStartTime} and #{submissionEndTime}>= apu.submission_time
- </if>
- <if test="key != null and key != ''">
- AND ( apu.user_name LIKE '%' #{key} '%' OR apu.reason_application LIKE '%' #{key} '%' )
- </if>
- <if test="examineAndApproveStartTime != null and examineAndApproveStartTime != '' and examineAndApproveEndTime != null and examineAndApproveEndTime != '' ">
- and apu.examine_and_approve_time >= #{examineAndApproveStartTime} and #{examineAndApproveEndTime}>= apu.examine_and_approve_time
- </if>
- <if test="type != null and type != ''">
- and apu.status= #{type}
- </if>
- <if test="department != null and department != ''">
- and apu.department= #{department}
- </if>
- </where>
- ORDER BY apu.submission_time
- </select>
- <select id="parentPageList" resultType="com.template.model.vo.ApplicationProcedureVo">
- SELECT
- apu.id as id,
- apu.user_name as usersName,
- apu.start_time as startTime,
- apu.end_time as endTime,
- apu.department as department,
- apu.change_user_name as changeUsersName,
- apu.reason_application as reasonApplication,
- apu.submission_time as submissionTime,
- apu.`status` as status,
- apu.approver_user_name as approverUserName,
- apu.examine_and_approve_time as examineAndApproveTime,
- apu.examine_and_approve_remark as examineAndApproveRemark
- FROM
- (
- SELECT
- ap.id,
- u.user_name AS user_name ,
- ap.start_time,
- ap.end_time,
- ap.department,
- u2.user_name as change_user_name,
- ap.reason_application,
- ap.submission_time,
- ap.`status`,
- u3.user_name as approver_user_name,
- ap.examine_and_approve_time,
- ap.examine_and_approve_remark
- FROM
- `application_procedure` ap
- LEFT JOIN users u ON ap.users_id = u.id
- LEFT JOIN users u2 ON ap.change_users_id = u2.id
- LEFT JOIN users u3 ON ap.approver_id = u3.id
- WHERE ap.deleted=0 AND FIND_IN_SET(ap.status,#{type})
- ) apu
- <where>
- <if test="submissionStartTime != null and submissionStartTime != '' and submissionEndTime != null and submissionEndTime != '' ">
- and apu.submission_time >= #{submissionStartTime} and #{submissionEndTime}>= apu.submission_time
- </if>
- <if test="key != null and key != ''">
- AND ( apu.user_name LIKE '%' #{key} '%' OR apu.reason_application LIKE '%' #{key} '%' )
- </if>
- <if test="examineAndApproveStartTime != null and examineAndApproveStartTime != '' and examineAndApproveEndTime != null and examineAndApproveEndTime != '' ">
- and apu.examine_and_approve_time >= #{examineAndApproveStartTime} and #{examineAndApproveEndTime}>= apu.examine_and_approve_time
- </if>
- <!--<if test="type != null and type != ''">
- and apu.status= #{type}
- </if>-->
- <if test="department != null and department != ''">
- and apu.department= #{department}
- </if>
- </where>
- ORDER BY apu.submission_time
- </select>
- </mapper>
|