123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- <?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.platform.dao.mapper.check.CheckJobMapper">
- <sql id="Base_Column_List">
- checkjob.id,
- checkjob.plan_id,
- checkstandard.standard_hours,
- checkstandard.real_hours,
- checkjob.start_time,
- checkjob.end_time,
- checkjob.actual_user,
- checkjob.type,
- checkjob.actual_start_time,
- checkjob.actual_end_time,
- checkjob.status,
- checkjob.sb_status,
- checkjob.receive_overtime,
- checkjob.check_user_id,
- checkjob.created_user_id,
- checkjob.update_user_id,
- checkjob.created_user_name,
- checkjob.update_user_name,
- checkjob.created_time,
- checkjob.update_time
- </sql>
- <sql id="Ref_Column_List">
- checkjob.plan_id,
- checkjob.actual_user,
- checkstandard.standard_hours,
- checkstandard.real_hours,
- checkjob.start_time,
- checkjob.type,
- checkjob.check_user_id,
- checkjob.end_time,
- checkjob.actual_start_time,
- checkjob.actual_end_time,
- checkjob.checked_num,
- checkjob.abnormal_num,
- checkjob.check_num,
- checkjob.status,
- checkjob.receive_overtime,
- checkjob.sb_status
- </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and checkjob.id = #{id}
- </if>
- <if test="receiveOvertime != null">
- and checkjob.receive_overtime = #{receiveOvertime}
- </if>
- <if test="planId != null and planId != ''">
- and checkjob.plan_id = #{planId}
- </if>
- <if test="sbId != null and sbId != ''">
- and checkjob.sb_id = #{sbId}
- </if>
- <if test="partId != null and partId != ''">
- and checkjob.part_id = #{partId}
- </if>
- <if test="standardId != null and standardId != ''">
- and checkjob.standard_id = #{standardId}
- </if>
- <if test="requirement != null and requirement != ''">
- and checkjob.requirement = #{requirement}
- </if>
- <if test="remark != null and remark != ''">
- and checkjob.remark = #{remark}
- </if>
- <if test="feedback != null and feedback != ''">
- and checkjob.feedback = #{feedback}
- </if>
- <if test="status ==null and startTimeStart != null ">
- and checkjob.start_time <![CDATA[>=]]>; #{startTimeStart}
- </if>
- <if test="status ==null and startTimeEnd != null">
- and checkjob.start_time <![CDATA[<=]]> #{startTimeEnd}
- </if>
- <if test="startTime != null">
- and checkjob.start_time = #{startTime}
- </if>
- <if test="endTimeStart != null">
- and checkjob.end_time <![CDATA[>=]]>; #{endTimeStart}
- </if>
- <if test="endTimeEnd != null">
- and checkjob.end_time <![CDATA[<=]]> #{endTimeEnd}
- </if>
- <if test="endTime != null">
- and checkjob.end_time = #{endTime}
- </if>
- <if test="actualStartTimeStart != null">
- and checkjob.actual_start_time <![CDATA[>=]]>; #{actualStartTimeStart}
- </if>
- <if test="actualStartTimeEnd != null">
- and checkjob.actual_start_time <![CDATA[<=]]> #{actualStartTimeEnd}
- </if>
- <if test="actualStartTime != null">
- and checkjob.actual_start_time = #{actualStartTime}
- </if>
- <if test="actualEndTimeStart != null">
- and checkjob.actual_end_time <![CDATA[>=]]>; #{actualEndTimeStart}
- </if>
- <if test="actualEndTimeEnd != null">
- and checkjob.actual_end_time <![CDATA[<=]]> #{actualEndTimeEnd}
- </if>
- <if test="actualEndTime != null">
- and checkjob.actual_end_time = #{actualEndTime}
- </if>
- <if test="status != null">
- and checkjob.status = #{status}
- </if>
- <if test="sbStatus != null">
- and checkjob.sb_status = #{sbStatus}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and checkjob.created_user_id = #{createdUserId}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and checkjob.update_user_id = #{updateUserId}
- </if>
- <if test="createdUserName != null and createdUserName != ''">
- and checkjob.created_user_name = #{createdUserName}
- </if>
- <if test="updateUserName != null and updateUserName != ''">
- and checkjob.update_user_name = #{updateUserName}
- </if>
- <if test="createdTimeStart != null">
- and checkjob.created_time <![CDATA[>=]]>; #{createdTimeStart}
- </if>
- <if test="createdTimeEnd != null">
- and checkjob.created_time <![CDATA[<=]]> #{createdTimeEnd}
- </if>
- <if test="createdTime != null">
- and checkjob.created_time = #{createdTime}
- </if>
- <if test="updateTimeStart != null">
- and checkjob.update_time <![CDATA[>=]]>; #{updateTimeStart}
- </if>
- <if test="updateTimeEnd != null">
- and checkjob.update_time <![CDATA[<=]]> #{updateTimeEnd}
- </if>
- <if test="updateTime != null">
- and checkjob.update_time = #{updateTime}
- </if>
- <if test="keyword != null and keyword != ''">
- and (
- standard.no like concat('%',#{keyword},'%') or
- sbinfo.name like concat('%',#{keyword},'%') or
- sbinfo.no like concat('%',#{keyword},'%') )
- </if>
- <if test="zbh != null and zbh != ''">
- and sbinfo.zbh = #{zbh}
- </if>
- <if test="sbLevel != null and sbLevel != ''">
- and sbinfo.level = #{sbLevel}
- </if>
- <if test="periodType != null and periodType != ''">
- and standard.period_type = #{periodType}
- </if>
- <if test="standardLevel != null and standardLevel != ''">
- and standard.level = #{standardLevel}
- </if>
- <if test="standardLevelList != null and standardLevelList.size > 0">
- AND standard.level in
- <foreach item="item" index="index" collection="standardLevelList" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="checkUserId != null and checkUserId != ''">
- and checkjob.check_user_id = #{checkUserId}
- </if>
- <if test="type != null and type != ''">
- and checkjob.type = #{type}
- </if>
- <if test="searchStartTime != null and status==null">
- and checkjob.start_time <![CDATA[ >= ]]> #{searchStartTime}
- </if>
- <if test="searchEndTime != null and status==null">
- and checkjob.start_time <![CDATA[ <= ]]> #{searchEndTime}
- </if>
- <if test="searchStartTime != null and status!=null and status==3">
- and checkjob.actual_start_time <![CDATA[ >= ]]> #{searchStartTime}
- </if>
- <if test="searchEndTime != null and status!=null and status==3">
- and checkjob.actual_start_time <![CDATA[ <= ]]> #{searchEndTime}
- </if>
- <if test="statusList != null and statusList.size > 0">
- AND checkjob.status in
- <foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="checkUserName != null and checkUserName != ''">
- and u.real_name like concat('%',#{checkUserName},'%')
- </if>
- <if test="actualUser != null and actualUser != ''">
- and checkjob.actual_user like concat('%',#{actualUser},'%')
- </if>
- <if test="positionId!=null and positionId!=''">
- and sbInfo.position_id = #{positionId}
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.check.CheckJobDTO"
- resultType="com.platform.dao.vo.query.check.CheckJobVO">
- select checkjob.*, u.real_name as checkUserName,
- sbinfo.name sbName, sbinfo.no sbNo, sbinfo.level sbLevel,sbinfo.id
- partinfo.name partName,
- standard.no standardNo, standard.name standardName,standard.level standardLevel,
- standard.period period, standard.period_type periodType
- from t_check_job as checkjob
- left join t_sb_info sbinfo on sbinfo.id = checkjob.sb_id
- left join t_part_info partinfo on partinfo.id = checkjob.part_id
- left join t_check_standard standard on standard.id = checkjob.standard_id
- left join t_sys_user u on checkjob.check_user_id = u.user_id
- <where>
- <include refid="List_Condition"/>
- </where>
- Order By
- checkjob.status asc,
- sbinfo.level asc,
- sbinfo.no asc,
- standard.period_type asc,
- standard.period asc
- </select>
- <select id="getScreenCountByTime" parameterType="com.platform.dao.dto.check.CheckJobDTO"
- resultType="com.platform.dao.vo.query.check.CheckJobVO">
- select count(checkjob.id) as countNum
- from t_check_job as checkjob
- <where>
- <if test="searchStartTime != null">
- and checkjob.start_time <![CDATA[ >= ]]> #{searchStartTime}
- </if>
- <if test="searchEndTime != null">
- and checkjob.start_time <![CDATA[ <= ]]> #{searchEndTime}
- </if>
- <if test="status != null">
- and checkjob.status = #{status}
- </if>
- </where>
- </select>
- <select id="selectDetail" resultType="com.platform.dao.vo.query.check.CheckJobVO">
- select checkjob.*,
- u.real_name as checkUserName,
- sbinfo.name sbName,
- sbinfo.no sbNo,
- sbinfo.level sbLevel,
- partinfo.name partName,
- standard.no standardNo,
- standard.name standardName,
- standard.level standardLevel,
- standard.period period,
- standard.period_type periodType
- from t_check_job as checkjob
- left join t_sb_info sbinfo on sbinfo.id = checkjob.sb_id
- left join t_part_info partinfo on partinfo.id = checkjob.part_id
- left join t_check_standard standard on standard.id = checkjob.standard_id
- left join t_sys_user u on checkjob.check_user_id = u.user_id
- where checkjob.id = #{id}
- </select>
- <select id="getNotFinishNumByDTO" resultType="java.lang.Integer">
- select count(checkjob.id)
- from t_check_job as checkjob
- left join t_sb_info sbinfo on sbinfo.id = checkjob.sb_id
- left join t_part_info partinfo on partinfo.id = checkjob.part_id
- left join t_check_standard standard on standard.id = checkjob.standard_id
- left join t_sys_user u on checkjob.check_user_id = u.user_id
- <where>
- <include refid="List_Condition"/>
- </where>
- </select>
- <select id="selectLastJob" parameterType="com.platform.dao.dto.check.CheckJobDTO"
- resultType="com.platform.dao.vo.query.check.CheckJobVO">
- select checkjob.*
- from t_check_job as checkjob
- where checkjob.sb_id = #{sbId}
- and checkjob.standard_id = #{standardId}
- order by checkjob.created_time desc limit 1
- </select>
- <update id="updateBatch" parameterType="java.util.List">
- <foreach collection="list" item="item" index="index" open="" close="" separator=";">
- update t_check_job
- <set>
- <if test="item.receiveOvertime != null">
- receive_overtime = #{item.receiveOvertime}
- </if>
- <if test="item.startTime != null">
- start_time = #{item.startTime}
- </if>
- </set>
- where id = #{item.id}
- </foreach>
- </update>
- </mapper>
|