|
|
@@ -21,6 +21,7 @@
|
|
|
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
|
|
<result column="check_period" property="check_period" jdbcType="VARCHAR" />
|
|
|
<result column="class_type" property="class_type" jdbcType="INTEGER" />
|
|
|
+ <result column="period_id" property="period_id" jdbcType="INTEGER" />
|
|
|
</resultMap>
|
|
|
<resultMap id="taskStatusMap" type="com.xintong.visualinspection.bean.TaskStatus">
|
|
|
<id property="id" column="ID"/>
|
|
|
@@ -58,27 +59,28 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getList" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >
|
|
|
- SELECT *,
|
|
|
- CONCAT(substr(start_time,1,16),'-',substr(end_time,12,5)) as check_period,
|
|
|
- (select a.code_name from sys_code a where a.code_flag='task_status' and a.code_value=check_status) as check_status_name
|
|
|
- FROM check_task
|
|
|
+ SELECT t.*,
|
|
|
+ CONCAT(substr(t.start_time,1,16),'-',substr(t.end_time,12,5)) as check_period,
|
|
|
+ (select a.code_name from sys_code a where a.code_flag='task_status' and a.code_value=t.check_status) as check_status_name
|
|
|
+ FROM check_task t left join t_sys_users u on t.checked_person=u.id
|
|
|
WHERE 1=1
|
|
|
- <if test="check_status != null">AND check_status = #{check_status}</if>
|
|
|
- <if test="check_status_end != null">AND check_status <= #{check_status_end}</if>
|
|
|
- <if test="start_time != null">AND start_time >= #{start_time}</if>
|
|
|
- <if test="end_time != null">AND end_time <= #{end_time}</if>
|
|
|
- <if test="checked_dept != null">AND checked_dept = #{checked_dept}</if>
|
|
|
- <if test="checkman != null">AND checkman = #{checkman}</if>
|
|
|
- <if test="recheckman != null">AND recheckman = #{recheckman}</if>
|
|
|
- <if test="checked_person != null">AND checked_person = #{checked_person}</if>
|
|
|
+ <if test="check_status != null">AND t.check_status = #{check_status}</if>
|
|
|
+ <if test="check_status_end != null">AND t.check_status <= #{check_status_end}</if>
|
|
|
+ <if test="start_time != null">AND t.start_time >= #{start_time}</if>
|
|
|
+ <if test="end_time != null">AND t.end_time <= #{end_time}</if>
|
|
|
+ <if test="checked_dept != null">AND t.checked_dept = #{checked_dept}</if>
|
|
|
+ <if test="checkman != null">AND t.checkman = #{checkman}</if>
|
|
|
+ <if test="recheckman != null">AND t.recheckman = #{recheckman}</if>
|
|
|
+ <if test="checked_person != null">AND t.checked_person = #{checked_person}</if>
|
|
|
+ <if test="position_id != null">AND u.positionid = #{position_id}</if>
|
|
|
<if test="hasScore == 1">AND
|
|
|
- id in (select task_id from check_score)
|
|
|
+ t.id in (select task_id from check_score)
|
|
|
</if>
|
|
|
<if test="hasScore == 2">AND
|
|
|
- id not in (select task_id from check_score)
|
|
|
+ t.id not in (select task_id from check_score)
|
|
|
</if>
|
|
|
<if test="dispatch_ids != null and dispatch_ids.length > 0">AND
|
|
|
- id in
|
|
|
+ t.id in
|
|
|
<foreach collection="dispatch_ids" item="dispatch_id" index="index"
|
|
|
open="(" close=")" separator=",">
|
|
|
#{dispatch_id}
|
|
|
@@ -87,32 +89,33 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getListInStatus" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >
|
|
|
- SELECT *,
|
|
|
- CONCAT(substr(start_time,1,16),'-',substr(end_time,12,5)) as check_period,
|
|
|
- (select a.code_name from sys_code a where a.code_flag='task_status' and a.code_value=check_status) as check_status_name
|
|
|
- FROM check_task
|
|
|
+ SELECT t.*,
|
|
|
+ CONCAT(substr(t.start_time,1,16),'-',substr(t.end_time,12,5)) as check_period,
|
|
|
+ (select a.code_name from sys_code a where a.code_flag='task_status' and a.code_value=t.check_status) as check_status_name
|
|
|
+ FROM check_task t left join t_sys_users u on t.checked_person=u.id
|
|
|
WHERE 1=1
|
|
|
<if test="check_status_arr != null and check_status_arr.length > 0">AND
|
|
|
- check_status in
|
|
|
+ t.check_status in
|
|
|
<foreach collection="check_status_arr" item="status" index="index"
|
|
|
open="(" close=")" separator=",">
|
|
|
#{status}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="start_time != null">AND start_time >= #{start_time}</if>
|
|
|
- <if test="end_time != null">AND end_time <= #{end_time}</if>
|
|
|
- <if test="checked_dept != null">AND checked_dept = #{checked_dept}</if>
|
|
|
- <if test="checkman != null">AND checkman = #{checkman}</if>
|
|
|
- <if test="recheckman != null">AND recheckman = #{recheckman}</if>
|
|
|
- <if test="checked_person != null">AND checked_person = #{checked_person}</if>
|
|
|
+ <if test="start_time != null">AND t.start_time >= #{start_time}</if>
|
|
|
+ <if test="end_time != null">AND t.end_time <= #{end_time}</if>
|
|
|
+ <if test="checked_dept != null">AND t.checked_dept = #{checked_dept}</if>
|
|
|
+ <if test="checkman != null">AND t.checkman = #{checkman}</if>
|
|
|
+ <if test="recheckman != null">AND t.recheckman = #{recheckman}</if>
|
|
|
+ <if test="checked_person != null">AND t.checked_person = #{checked_person}</if>
|
|
|
+ <if test="position_id != null">AND u.positionid = #{position_id}</if>
|
|
|
<if test="hasScore == 1">AND
|
|
|
- id in (select task_id from check_score)
|
|
|
+ t.id in (select task_id from check_score)
|
|
|
</if>
|
|
|
<if test="hasScore == 2">AND
|
|
|
- id not in (select task_id from check_score)
|
|
|
+ t.id not in (select task_id from check_score)
|
|
|
</if>
|
|
|
<if test="dispatch_ids != null and dispatch_ids.length > 0">AND
|
|
|
- id in
|
|
|
+ t.id in
|
|
|
<foreach collection="dispatch_ids" item="dispatch_id" index="index"
|
|
|
open="(" close=")" separator=",">
|
|
|
#{dispatch_id}
|
|
|
@@ -120,18 +123,19 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="getListByChecked" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >
|
|
|
- SELECT *,
|
|
|
- CONCAT(substr(start_time,1,16),'-',substr(end_time,11,6)) as check_period,
|
|
|
- (select a.code_name from sys_code a where a.code_flag='task_status' and a.code_value=check_status) as check_status_name
|
|
|
- FROM check_task
|
|
|
+ SELECT t.*,
|
|
|
+ CONCAT(substr(t.start_time,1,16),'-',substr(t.end_time,11,6)) as check_period,
|
|
|
+ (select a.code_name from sys_code a where a.code_flag='task_status' and a.code_value=t.check_status) as check_status_name
|
|
|
+ FROM check_task t left join t_sys_users u on t.checked_person=u.id
|
|
|
WHERE 1=1
|
|
|
- <if test="check_status != null">AND check_status >= #{check_status}</if>
|
|
|
- <if test="start_time != null">AND start_time >= #{start_time}</if>
|
|
|
- <if test="end_time != null">AND end_time <= #{end_time}</if>
|
|
|
- <if test="checked_dept != null">AND checked_dept = #{checked_dept}</if>
|
|
|
- <if test="checkman != null">AND checkman = #{checkman}</if>
|
|
|
- <if test="recheckman != null">AND recheckman = #{recheckman}</if>
|
|
|
- <if test="checked_person != null">AND checked_person = #{checked_person}</if>
|
|
|
+ <if test="check_status != null">AND t.check_status >= #{check_status}</if>
|
|
|
+ <if test="start_time != null">AND t.start_time >= #{start_time}</if>
|
|
|
+ <if test="end_time != null">AND t.end_time <= #{end_time}</if>
|
|
|
+ <if test="checked_dept != null">AND t.checked_dept = #{checked_dept}</if>
|
|
|
+ <if test="checkman != null">AND t.checkman = #{checkman}</if>
|
|
|
+ <if test="recheckman != null">AND t.recheckman = #{recheckman}</if>
|
|
|
+ <if test="period_id != null">AND t.period_id = #{period_id}</if>
|
|
|
+ <if test="checked_person != null">AND t.checked_person = #{checked_person}</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getListBySubmited" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >
|