| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 | <?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.supervision.peopleChuRu.mapper.BdglLeaveMapper">    <resultMap type="BdglLeave" id="BdglLeaveResult">        <result property="id"    column="id"    />        <result property="peopleId"    column="people_id"    />        <result property="unitId"    column="unit_id"    />        <result property="startTime"    column="start_time"    />        <result property="endTime"    column="end_time"    />        <result property="leaveType"    column="leave_type"    />        <result property="leaveReason"    column="leave_reason"    />        <result property="departureTime"    column="departure_time"    />        <result property="returnTime"    column="return_time"    />        <result property="returnStatus"    column="return_status"    />        <result property="isReturn"    column="is_return"    />        <result property="updatetime"    column="updatetime"    />        <result property="adminId"    column="admin_id"    />        <result property="createtime"    column="createtime"    />        <result property="peopleId1"    column="people_id1"    />        <result property="postId"    column="post_id"    />        <result property="peopleId2"    column="people_id2"    />        <result property="peopleId3"    column="people_id3"    />        <result property="peopleId4"    column="people_id4"    />        <result property="status1"    column="status1"    />        <result property="status2"    column="status2"    />        <result property="status3"    column="status3"    />        <result property="status4"    column="status4"    />        <result property="contents"    column="contents"    />        <result property="statusd"    column="statusd"    />        <result property="rejoin"    column="rejoin"    />        <result property="unitName"    column="unit_name"    />        <result property="peopleName"    column="people_name"    />        <result property="peopleName1"    column="people_name1"    />        <result property="peopleName2"    column="people_name2"    />        <result property="peopleName3"    column="people_name3"    />        <result property="peopleName4"    column="people_name4"    />        <result property="reasons"    column="reasons"    />        <result property="specialApproval"    column="special_approval"    />        <result property="actualreturntime"    column="actualreturntime"    />    </resultMap>    <sql id="selectBdglLeaveVo">        select id, people_id, unit_id, start_time, end_time, leave_type, leave_reason, departure_time, return_time, return_status, is_return, updatetime, admin_id, createtime, people_id1, post_id, people_id2, people_id3, people_id4, status1, status2, status3, status4, contents, statusd, rejoin, unit_name, people_name, people_name1, people_name2, people_name3, people_name4,reasons,special_approval,actualreturntime from bdgl_leave    </sql>    <select id="selectBdglLeaveList" parameterType="BdglLeave" resultMap="BdglLeaveResult">        <include refid="selectBdglLeaveVo"/>        <where>            <if test="peopleId != null "> and people_id = #{peopleId}</if>            <if test="unitId != null "> and unit_id = #{unitId}</if>            <if test="startTime != null "> and start_time = #{startTime}</if>            <if test="endTime != null "> and end_time = #{endTime}</if>            <if test="leaveType != null  and leaveType != ''"> and leave_type = #{leaveType}</if>            <if test="leaveReason != null  and leaveReason != ''"> and leave_reason = #{leaveReason}</if>            <if test="departureTime != null  and departureTime != ''"> and departure_time = #{departureTime}</if>            <if test="returnTime != null  and returnTime != ''"> and return_time = #{returnTime}</if>            <if test="returnStatus != null  and returnStatus != ''"> and return_status = #{returnStatus}</if>            <if test="isReturn != null  and isReturn != ''"> and is_return = #{isReturn}</if>            <if test="updatetime != null  and updatetime != ''"> and updatetime = #{updatetime}</if>            <if test="adminId != null "> and admin_id = #{adminId}</if>            <if test="createtime != null  and createtime != ''"> and createtime = #{createtime}</if>            <if test="peopleId1 != null "> and people_id1 = #{peopleId1}</if>            <if test="postId != null "> and post_id = #{postId}</if>            <if test="peopleId2 != null "> and people_id2 = #{peopleId2}</if>            <if test="peopleId3 != null "> and people_id3 = #{peopleId3}</if>            <if test="peopleId4 != null "> and people_id4 = #{peopleId4}</if>            <if test="status1 != null "> and status1 = #{status1}</if>            <if test="status2 != null "> and status2 = #{status2}</if>            <if test="status3 != null "> and status3 = #{status3}</if>            <if test="status4 != null "> and status4 = #{status4}</if>            <if test="contents != null  and contents != ''"> and contents = #{contents}</if>            <if test="statusd != null "> and statusd = #{statusd}</if>            <if test="rejoin != null "> and rejoin = #{rejoin}</if>            <if test="unitName != null  and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>            <if test="peopleName != null  and peopleName != ''"> and people_name like concat('%', #{peopleName}, '%')</if>            <if test="peopleName1 != null  and peopleName1 != ''"> and people_name1 = #{peopleName1}</if>            <if test="peopleName2 != null  and peopleName2 != ''"> and people_name2 = #{peopleName2}</if>            <if test="peopleName3 != null  and peopleName3 != ''"> and people_name3 = #{peopleName3}</if>            <if test="peopleName4 != null  and peopleName4 != ''"> and people_name4 = #{peopleName4}</if>            <if test="reasons != null  and reasons != ''"> and reasons = #{reasons}</if>            <if test="specialApproval != null  and specialApproval != ''"> and special_approval = #{specialApproval}</if>            <if test="actualreturntime != null  "> and actualreturntime = #{actualreturntime}</if>            <if test="names != null "> and people_id in                <foreach item="names" collection="names" open="(" separator="," close=")">                    #{names}                </foreach></if>        </where>        order by id desc    </select>    <select id="selectBdglLeaveById" parameterType="Long" resultMap="BdglLeaveResult">        <include refid="selectBdglLeaveVo"/>        where id = #{id}    </select>    <select id="selectBdglLeavePeopless" resultMap="BdglLeaveResult">        <include refid="selectBdglLeaveVo"/>        where            <![CDATA[                start_time <= #{startTime} and end_time>=#{startTime}            ]]>            and unit_id=#{unitId}            and leave_type in('1','8')            and (status4=1 or status4=3)    </select>    <select id="selectBdglLeaveListes" resultMap="BdglLeaveResult">        <include refid="selectBdglLeaveVo"/>        where to_days(createtime) = to_days(now())        AND departure_time is null    </select>    <select id="selectBdglLeaveLists" resultMap="BdglLeaveResult">        <include refid="selectBdglLeaveVo"/>        WHERE departure_time is not null        AND return_time is null    </select>    <select id="selectBdglLeaveListsss" parameterType="BdglLeave" resultMap="BdglLeaveResult">        <include refid="selectBdglLeaveVo"/>        <where>            and DATE(start_time) = DATE(NOW())            <if test="peopleId != null "> and people_id = #{peopleId}</if>            <if test="unitId != null "> and unit_id = #{unitId}</if>            <if test="endTime != null "> and end_time = #{endTime}</if>            <if test="leaveType != null  and leaveType != ''"> and leave_type = #{leaveType}</if>            <if test="leaveReason != null  and leaveReason != ''"> and leave_reason = #{leaveReason}</if>            <if test="departureTime != null  and departureTime != ''"> and departure_time = #{departureTime}</if>            <if test="returnTime != null  and returnTime != ''"> and return_time = #{returnTime}</if>            <if test="returnStatus != null  and returnStatus != ''"> and return_status = #{returnStatus}</if>            <if test="isReturn != null  and isReturn != ''"> and is_return = #{isReturn}</if>            <if test="updatetime != null  and updatetime != ''"> and updatetime = #{updatetime}</if>            <if test="adminId != null "> and admin_id = #{adminId}</if>            <if test="createtime != null  and createtime != ''"> and createtime = #{createtime}</if>            <if test="peopleId1 != null "> and people_id1 = #{peopleId1}</if>            <if test="postId != null "> and post_id = #{postId}</if>            <if test="peopleId2 != null "> and people_id2 = #{peopleId2}</if>            <if test="peopleId3 != null "> and people_id3 = #{peopleId3}</if>            <if test="peopleId4 != null "> and people_id4 = #{peopleId4}</if>            <if test="status1 != null "> and status1 = #{status1}</if>            <if test="status2 != null "> and status2 = #{status2}</if>            <if test="status3 != null "> and status3 = #{status3}</if>            <if test="status4 != null "> and status4 = #{status4}</if>            <if test="contents != null  and contents != ''"> and contents = #{contents}</if>            <if test="statusd != null "> and statusd = #{statusd}</if>            <if test="rejoin != null "> and rejoin = #{rejoin}</if>            <if test="unitName != null  and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>            <if test="peopleName != null  and peopleName != ''"> and people_name like concat('%', #{peopleName}, '%')</if>            <if test="peopleName1 != null  and peopleName1 != ''"> and people_name1 = #{peopleName1}</if>            <if test="peopleName2 != null  and peopleName2 != ''"> and people_name2 = #{peopleName2}</if>            <if test="peopleName3 != null  and peopleName3 != ''"> and people_name3 = #{peopleName3}</if>            <if test="peopleName4 != null  and peopleName4 != ''"> and people_name4 = #{peopleName4}</if>            <if test="reasons != null  and reasons != ''"> and reasons = #{reasons}</if>            <if test="specialApproval != null  and specialApproval != ''"> and special_approval = #{specialApproval}</if>            <if test="actualreturntime != null  "> and actualreturntime = #{actualreturntime}</if>            <if test="names != null "> and people_id in                <foreach item="names" collection="names" open="(" separator="," close=")">                    #{names}                </foreach></if>        </where>        order by id desc    </select>    <insert id="insertBdglLeave" parameterType="BdglLeave" useGeneratedKeys="true" keyProperty="id">        insert into bdgl_leave        <trim prefix="(" suffix=")" suffixOverrides=",">            <if test="peopleId != null">people_id,</if>            <if test="unitId != null">unit_id,</if>            <if test="startTime != null">start_time,</if>            <if test="endTime != null">end_time,</if>            <if test="leaveType != null">leave_type,</if>            <if test="leaveReason != null">leave_reason,</if>            <if test="departureTime != null">departure_time,</if>            <if test="returnTime != null">return_time,</if>            <if test="returnStatus != null">return_status,</if>            <if test="isReturn != null">is_return,</if>            <if test="updatetime != null">updatetime,</if>            <if test="adminId != null">admin_id,</if>            <if test="createtime != null">createtime,</if>            <if test="peopleId1 != null">people_id1,</if>            <if test="postId != null">post_id,</if>            <if test="peopleId2 != null">people_id2,</if>            <if test="peopleId3 != null">people_id3,</if>            <if test="peopleId4 != null">people_id4,</if>            <if test="status1 != null">status1,</if>            <if test="status2 != null">status2,</if>            <if test="status3 != null">status3,</if>            <if test="status4 != null">status4,</if>            <if test="contents != null">contents,</if>            <if test="statusd != null">statusd,</if>            <if test="rejoin != null">rejoin,</if>            <if test="unitName != null">unit_name,</if>            <if test="peopleName != null">people_name,</if>            <if test="peopleName1 != null">people_name1,</if>            <if test="peopleName2 != null">people_name2,</if>            <if test="peopleName3 != null">people_name3,</if>            <if test="peopleName4 != null">people_name4,</if>            <if test="reasons != null">reasons,</if>            <if test="specialApproval != null">special_approval,</if>            <if test="actualreturntime != null">actualreturntime,</if>        </trim>        <trim prefix="values (" suffix=")" suffixOverrides=",">            <if test="peopleId != null">#{peopleId},</if>            <if test="unitId != null">#{unitId},</if>            <if test="startTime != null">#{startTime},</if>            <if test="endTime != null">#{endTime},</if>            <if test="leaveType != null">#{leaveType},</if>            <if test="leaveReason != null">#{leaveReason},</if>            <if test="departureTime != null">#{departureTime},</if>            <if test="returnTime != null">#{returnTime},</if>            <if test="returnStatus != null">#{returnStatus},</if>            <if test="isReturn != null">#{isReturn},</if>            <if test="updatetime != null">#{updatetime},</if>            <if test="adminId != null">#{adminId},</if>            <if test="createtime != null">#{createtime},</if>            <if test="peopleId1 != null">#{peopleId1},</if>            <if test="postId != null">#{postId},</if>            <if test="peopleId2 != null">#{peopleId2},</if>            <if test="peopleId3 != null">#{peopleId3},</if>            <if test="peopleId4 != null">#{peopleId4},</if>            <if test="status1 != null">#{status1},</if>            <if test="status2 != null">#{status2},</if>            <if test="status3 != null">#{status3},</if>            <if test="status4 != null">#{status4},</if>            <if test="contents != null">#{contents},</if>            <if test="statusd != null">#{statusd},</if>            <if test="rejoin != null">#{rejoin},</if>            <if test="unitName != null">#{unitName},</if>            <if test="peopleName != null">#{peopleName},</if>            <if test="peopleName1 != null">#{peopleName1},</if>            <if test="peopleName2 != null">#{peopleName2},</if>            <if test="peopleName3 != null">#{peopleName3},</if>            <if test="peopleName4 != null">#{peopleName4},</if>            <if test="reasons != null">#{reasons},</if>            <if test="specialApproval != null">#{specialApproval},</if>            <if test="actualreturntime != null">#{actualreturntime},</if>        </trim>    </insert>    <update id="updateBdglLeave" parameterType="BdglLeave">        update bdgl_leave        <trim prefix="SET" suffixOverrides=",">            <if test="peopleId != null">people_id = #{peopleId},</if>            <if test="unitId != null">unit_id = #{unitId},</if>            <if test="startTime != null">start_time = #{startTime},</if>            <if test="endTime != null">end_time = #{endTime},</if>            <if test="leaveType != null">leave_type = #{leaveType},</if>            <if test="leaveReason != null">leave_reason = #{leaveReason},</if>            <if test="departureTime != null">departure_time = #{departureTime},</if>            <if test="returnTime != null">return_time = #{returnTime},</if>            <if test="returnStatus != null">return_status = #{returnStatus},</if>            <if test="isReturn != null">is_return = #{isReturn},</if>            <if test="updatetime != null">updatetime = #{updatetime},</if>            <if test="adminId != null">admin_id = #{adminId},</if>            <if test="createtime != null">createtime = #{createtime},</if>            <if test="peopleId1 != null">people_id1 = #{peopleId1},</if>            <if test="postId != null">post_id = #{postId},</if>            <if test="peopleId2 != null">people_id2 = #{peopleId2},</if>            <if test="peopleId3 != null">people_id3 = #{peopleId3},</if>            <if test="peopleId4 != null">people_id4 = #{peopleId4},</if>            <if test="status1 != null">status1 = #{status1},</if>            <if test="status2 != null">status2 = #{status2},</if>            <if test="status3 != null">status3 = #{status3},</if>            <if test="status4 != null">status4 = #{status4},</if>            <if test="contents != null">contents = #{contents},</if>            <if test="statusd != null">statusd = #{statusd},</if>            <if test="rejoin != null">rejoin = #{rejoin},</if>            <if test="unitName != null">unit_name = #{unitName},</if>            <if test="peopleName != null">people_name = #{peopleName},</if>            <if test="peopleName1 != null">people_name1 = #{peopleName1},</if>            <if test="peopleName2 != null">people_name2 = #{peopleName2},</if>            <if test="peopleName3 != null">people_name3 = #{peopleName3},</if>            <if test="peopleName4 != null">people_name4 = #{peopleName4},</if>            <if test="reasons != null">reasons = #{reasons},</if>            <if test="specialApproval != null">special_approval = #{specialApproval},</if>            <if test="actualreturntime != null">actualreturntime = #{actualreturntime},</if>        </trim>        where id = #{id}    </update>    <delete id="deleteBdglLeaveById" parameterType="Long">        delete from bdgl_leave where id = #{id}    </delete>    <delete id="deleteBdglLeaveByIds" parameterType="String">        delete from bdgl_leave where id in        <foreach item="id" collection="array" open="(" separator="," close=")">            #{id}        </foreach>    </delete></mapper>
 |