<?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.gk.hotwork.Mapper.TaskInfoMapper">
|
<resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskInfo">
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="status" property="status" jdbcType="TINYINT"/>
|
<result column="unit" property="unit" jdbcType="VARCHAR"/>
|
<result column="department" property="department" jdbcType="VARCHAR"/>
|
<result column="applicant" property="applicant" jdbcType="VARCHAR"/>
|
<result column="code" property="code" jdbcType="VARCHAR"/>
|
<result column="etype" property="etype" jdbcType="VARCHAR"/>
|
<result column="level" property="level" jdbcType="TINYINT"/>
|
<result column="area" property="area" jdbcType="VARCHAR"/>
|
<result column="mode" property="mode" jdbcType="VARCHAR"/>
|
<result column="director" property="director" jdbcType="VARCHAR"/>
|
<result column="starttime" property="starttime" jdbcType="TIMESTAMP"/>
|
<result column="endtime" property="endtime" jdbcType="TIMESTAMP"/>
|
<result column="othertask" property="othertask" jdbcType="VARCHAR"/>
|
<result column="hazard" property="hazard" jdbcType="VARCHAR"/>
|
<result column="supervisor" property="supervisor" jdbcType="VARCHAR"/>
|
<result column="profession" property="profession" jdbcType="VARCHAR"/>
|
<result column="partdirector" property="partdirector" jdbcType="VARCHAR"/>
|
<result column="approversupervisor" property="approversupervisor" jdbcType="VARCHAR"/>
|
<result column="approverprofession" property="approverprofession" jdbcType="VARCHAR"/>
|
<result column="applyunitopinion" property="applyunitopinion" jdbcType="VARCHAR"/>
|
<result column="constructionopinion" property="constructionopinion" jdbcType="VARCHAR"/>
|
<result column="relevantopinion" property="relevantopinion" jdbcType="VARCHAR"/>
|
<result column="securityopinion" property="securityopinion" jdbcType="VARCHAR"/>
|
<result column="enterpriseopinion" property="enterpriseopinion" jdbcType="VARCHAR"/>
|
<result column="shiftleaderopinion" property="shiftleaderopinion" jdbcType="VARCHAR"/>
|
<result column="applyunitname" property="applyunitname" jdbcType="VARCHAR"/>
|
<result column="constructionname" property="constructionname" jdbcType="VARCHAR"/>
|
<result column="relevantname" property="relevantname" jdbcType="VARCHAR"/>
|
<result column="securityname" property="securityname" jdbcType="VARCHAR"/>
|
<result column="enterprisename" property="enterprisename" jdbcType="VARCHAR"/>
|
<result column="shiftleadername" property="shiftleadername" jdbcType="VARCHAR"/>
|
<result column="applyunittime" property="applyunittime" jdbcType="TIMESTAMP"/>
|
<result column="constructiontime" property="constructiontime" jdbcType="TIMESTAMP"/>
|
<result column="relevanttime" property="relevanttime" jdbcType="TIMESTAMP"/>
|
<result column="securitytime" property="securitytime" jdbcType="TIMESTAMP"/>
|
<result column="enterprisetime" property="enterprisetime" jdbcType="TIMESTAMP"/>
|
<result column="shiftleadertime" property="shiftleadertime" jdbcType="TIMESTAMP"/>
|
<result column="completedtime" property="completedtime" jdbcType="TIMESTAMP"/>
|
<result column="completedname" property="completedname" jdbcType="VARCHAR"/>
|
<result column="completedconfirm" property="completedconfirm" jdbcType="VARCHAR"/>
|
<result column="createdat" property="createdat" jdbcType="TIMESTAMP"/>
|
<result column="createdby" property="createdby" jdbcType="VARCHAR"/>
|
<result column="modifiedat" property="modifiedat" jdbcType="TIMESTAMP"/>
|
<result column="modifiedby" property="modifiedby" jdbcType="VARCHAR"/>
|
<result column="flag" property="flag" jdbcType="TINYINT"/>
|
<result column="isdel" property="isdel" jdbcType="TINYINT"/>
|
<result column="constructionunit" property="constructionunit" jdbcType="VARCHAR"/>
|
<result column="securitydep" property="securitydep" jdbcType="VARCHAR"/>
|
<result column="isholiday" property="isholiday" jdbcType="TINYINT"/>
|
<result column="analyst" property="analyst" jdbcType="VARCHAR"/>
|
<result column="path" property="path" jdbcType="VARCHAR"/>
|
<result column="fullpath" property="fullpath" jdbcType="VARCHAR"/>
|
<result column="supervisoropinion" property="supervisoropinion" jdbcType="VARCHAR"/>
|
<result column="content" property="content" jdbcType="VARCHAR"/>
|
<result column="opinion" property="opinion" jdbcType="VARCHAR"/>
|
<result column="description" property="description" jdbcType="VARCHAR"/>
|
<result column="isanalysis" property="isanalysis" jdbcType="TINYINT"/>
|
<result column="analysisarea" property="analysisarea" jdbcType="VARCHAR"/>
|
<result column="analysismedium" property="analysismedium" jdbcType="VARCHAR"/>
|
</resultMap>
|
|
<resultMap id="active_task_map" type="com.gk.hotwork.Domain.Vo.specTask.ActiveTaskInfo">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="code" property="code" jdbcType="VARCHAR"/>
|
</resultMap>
|
<sql id="active_task_column">
|
id,code
|
</sql>
|
|
<sql id="Base_Column_List">
|
<!-- -->
|
id, status, unit, department, applicant, code, level, area, mode, director, starttime, endtime,
|
othertask, hazard, supervisor, profession, partdirector, approversupervisor, approverprofession,
|
applyunitopinion, constructionopinion, relevantopinion, securityopinion, enterpriseopinion,
|
shiftleaderopinion, applyunitname, constructionname, relevantname, securityname,
|
enterprisename, shiftleadername, applyunittime, constructiontime, relevanttime, securitytime,
|
enterprisetime, shiftleadertime, completedtime, completedname, completedconfirm,
|
createdat, createdby, modifiedat, modifiedby, flag, isdel, constructionunit, securitydep, isholiday,
|
analyst, path, fullpath, supervisoropinion, content, opinion, `description`, isanalysis, analysisarea,
|
analysismedium
|
</sql>
|
|
<select id="selectActiveTaskList" resultMap="active_task_map">
|
select <include refid="active_task_column"></include> from task
|
<where>
|
<if test="time != null">
|
task.starttime <= #{time}
|
and task.endtime >= #{time}
|
</if>
|
<if test="type != null">
|
and type = #{type}
|
</if>
|
</where>
|
</select>
|
|
<select id="selectTaskDataGrid" resultType="com.gk.hotwork.Domain.TaskInfo">
|
select
|
task.*
|
from task
|
left join subtask on subtask.taskcode = task.`code`
|
<where>
|
isdel = 0
|
<if test="condition.code != null and condition.code != ''">
|
and `code` like concat('%',#{condition.code},'%')
|
</if>
|
<if test="condition.level != null and condition.level != ''">
|
and `level` = #{condition.level}
|
</if>
|
<if test="condition.starttime != null and condition.starttime != ''">
|
and task.`createdat` >= #{condition.starttime}
|
</if>
|
<if test="condition.endtime != null and condition.endtime != ''">
|
and task.`createdat` <= #{condition.endtime}
|
</if>
|
|
<if test="condition.company != null and condition.company != ''">
|
and task.constructionunit = #{condition.company}
|
</if>
|
|
<if test="condition.type != null and condition.type != ''">
|
and subtask.type = #{condition.type}
|
</if>
|
|
<if test="condition.status != null ">
|
and task.status = #{condition.status}
|
</if>
|
|
<if test="condition.flag != null ">
|
and task.flag = #{condition.flag}
|
</if>
|
</where>
|
</select>
|
<select id="selectTaskDataGridByDep" resultType="com.gk.hotwork.Domain.TaskInfo">
|
select
|
<include refid="Base_Column_List"/>
|
from task
|
<where>
|
isdel = 0
|
and unit = #{condition.unit}
|
and department = #{condition.department}
|
<if test="condition.code != null and condition.code != ''">
|
and `code` like concat('%',#{condition.code},'%')
|
</if>
|
<if test="condition.level != null and condition.level != ''">
|
and `level` = #{condition.level}
|
</if>
|
</where>
|
</select>
|
<select id="getWaitReviewDataGrid" resultType="com.gk.hotwork.Domain.TaskInfo">
|
( SELECT
|
task.*
|
FROM
|
task
|
LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode
|
left join subtask on subtask.taskcode = task.`code`
|
<where>
|
task.isdel = 0
|
AND task.department = #{condition.department}
|
AND task.unit = #{condition.unit}
|
AND task.applicant = #{condition.applicant}
|
AND task.flag IN (0,2,6)
|
<if test="condition.code != null and condition.code != ''">
|
and task.`code` like concat('%',#{condition.code},'%')
|
</if>
|
<if test="condition.level != null and condition.level != ''">
|
and task.`level` = #{condition.level}
|
</if>
|
<if test="condition.status != null and condition.status != ''">
|
and task.`status` = #{condition.status}
|
</if>
|
<if test="condition.flag != null and condition.flag != ''">
|
and task.`flag` = #{condition.flag}
|
</if>
|
<if test="condition.starttime != null and condition.starttime != ''">
|
and task.`starttime` >= #{condition.starttime}
|
</if>
|
<if test="condition.endtime != null and condition.endtime != ''">
|
and task.`endtime` <= #{condition.endtime}
|
</if>
|
<if test="condition.department != null and condition.department != ''">
|
and task.`department` = #{condition.department}
|
</if>
|
<if test="condition.constructionunit != null and condition.constructionunit != ''">
|
and task.`level` = #{condition.constructionunit}
|
</if>
|
<if test="condition.tasktype != null and condition.tasktype != ''">
|
subtask.`type` = #{condition.tasktype}
|
</if>
|
</where>
|
GROUP BY
|
task.`code`
|
) UNION
|
(
|
SELECT
|
task.*
|
FROM
|
task
|
LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode
|
left join subtask on subtask.taskcode = task.`code`
|
WHERE
|
task.isdel = 0
|
AND task.department = #{condition.department}
|
AND task.`status` = 3
|
AND 1 = #{condition.isDepartment}
|
<if test="condition.code != null and condition.code != ''">
|
and task.`code` like concat('%',#{condition.code},'%')
|
</if>
|
<if test="condition.level != null and condition.level != ''">
|
and task.`level` = #{condition.level}
|
</if>
|
<if test="condition.status != null and condition.status != ''">
|
and task.`status` = #{condition.status}
|
</if>
|
<if test="condition.flag != null and condition.flag != ''">
|
and task.`flag` = #{condition.flag}
|
</if>
|
<if test="condition.starttime != null and condition.starttime != ''">
|
and task.`starttime` >= #{condition.starttime}
|
</if>
|
<if test="condition.endtime != null and condition.endtime != ''">
|
and task.`endtime` <= #{condition.endtime}
|
</if>
|
<if test="condition.department != null and condition.department != ''">
|
and task.`department` = #{condition.department}
|
</if>
|
<if test="condition.constructionunit != null and condition.constructionunit != ''">
|
and task.`level` = #{condition.constructionunit}
|
</if>
|
<if test="condition.tasktype != null and condition.tasktype != ''">
|
subtask.`type` = #{condition.tasktype}
|
</if>
|
GROUP BY
|
task.`code`
|
) UNION
|
(
|
SELECT
|
task.*
|
FROM
|
task
|
LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode
|
left join subtask on subtask.taskcode = task.`code`
|
<where>
|
task.isdel = 0
|
AND tid.department = #{condition.department}
|
AND task.`status` = 4
|
AND 1 = #{condition.isDepartment}
|
<if test="condition.code != null and condition.code != ''">
|
and task.`code` like concat('%',#{condition.code},'%')
|
</if>
|
<if test="condition.level != null and condition.level != ''">
|
and task.`level` = #{condition.level}
|
</if>
|
<if test="condition.status != null and condition.status != ''">
|
and task.`status` = #{condition.status}
|
</if>
|
<if test="condition.flag != null and condition.flag != ''">
|
and task.`flag` = #{condition.flag}
|
</if>
|
<if test="condition.starttime != null and condition.starttime != ''">
|
and task.`starttime` >= #{condition.starttime}
|
</if>
|
<if test="condition.endtime != null and condition.endtime != ''">
|
and task.`endtime` <= #{condition.endtime}
|
</if>
|
<if test="condition.constructionunit != null and condition.constructionunit != ''">
|
and task.`level` = #{condition.constructionunit}
|
</if>
|
<if test="condition.tasktype != null and condition.tasktype != ''">
|
subtask.`type` = #{condition.tasktype}
|
</if>
|
</where>
|
GROUP BY
|
task.`code`
|
) UNION
|
(
|
SELECT
|
task.*
|
FROM
|
task
|
LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode
|
left join subtask on subtask.taskcode = task.`code`
|
<where>
|
task.isdel = 0
|
AND task.securitydep = #{condition.department}
|
AND task.`status` = 5
|
AND 1 = #{condition.isDepartment}
|
<if test="condition.code != null and condition.code != ''">
|
and task.`code` like concat('%',#{condition.code},'%')
|
</if>
|
<if test="condition.level != null and condition.level != ''">
|
and task.`level` = #{condition.level}
|
</if>
|
<if test="condition.status != null and condition.status != ''">
|
and task.`status` = #{condition.status}
|
</if>
|
<if test="condition.flag != null and condition.flag != ''">
|
and task.`flag` = #{condition.flag}
|
</if>
|
<if test="condition.starttime != null and condition.starttime != ''">
|
and task.`starttime` >= #{condition.starttime}
|
</if>
|
<if test="condition.endtime != null and condition.endtime != ''">
|
and task.`endtime` <= #{condition.endtime}
|
</if>
|
<if test="condition.constructionunit != null and condition.constructionunit != ''">
|
and task.`level` = #{condition.constructionunit}
|
</if>
|
<if test="condition.tasktype != null and condition.tasktype != ''">
|
subtask.`type` = #{condition.tasktype}
|
</if>
|
</where>
|
GROUP BY
|
task.`code`
|
) UNION
|
(
|
SELECT
|
task.*
|
FROM
|
task
|
LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode
|
left join subtask on subtask.taskcode = task.`code`
|
<where>
|
task.isdel = 0
|
AND task.unit = #{condition.unit}
|
AND task.`status` = 6
|
AND 1 = #{condition.isCompany}
|
<if test="condition.code != null and condition.code != ''">
|
and task.`code` like concat('%',#{condition.code},'%')
|
</if>
|
<if test="condition.level != null and condition.level != ''">
|
and task.`level` = #{condition.level}
|
</if>
|
<if test="condition.status != null and condition.status != ''">
|
and task.`status` = #{condition.status}
|
</if>
|
<if test="condition.flag != null and condition.flag != ''">
|
and task.`flag` = #{condition.flag}
|
</if>
|
<if test="condition.starttime != null and condition.starttime != ''">
|
and task.`starttime` >= #{condition.starttime}
|
</if>
|
<if test="condition.endtime != null and condition.endtime != ''">
|
and task.`endtime` <= #{condition.endtime}
|
</if>
|
<if test="condition.constructionunit != null and condition.constructionunit != ''">
|
and task.`level` = #{condition.constructionunit}
|
</if>
|
<if test="condition.tasktype != null and condition.tasktype != ''">
|
subtask.`type` = #{condition.tasktype}
|
</if>
|
</where>
|
GROUP BY
|
task.`code`
|
) UNION
|
(
|
SELECT
|
task.*
|
FROM
|
task
|
LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode
|
left join subtask on subtask.taskcode = task.`code`
|
WHERE
|
task.isdel = 0
|
AND task.constructionunit = #{condition.unit}
|
AND task.`status` = 2
|
AND 1 = #{condition.isCompany}
|
GROUP BY
|
task.`code`
|
) UNION
|
(
|
SELECT
|
task.*
|
FROM
|
task
|
LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode
|
left join subtask on subtask.taskcode = task.`code`
|
<where>
|
task.isdel = 0
|
AND task.constructionunit = #{condition.department}
|
AND task.`status` = 2
|
AND 1 = #{condition.isDepartment}
|
<if test="condition.code != null and condition.code != ''">
|
and task.`code` like concat('%',#{condition.code},'%')
|
</if>
|
<if test="condition.level != null and condition.level != ''">
|
and task.`level` = #{condition.level}
|
</if>
|
<if test="condition.status != null and condition.status != ''">
|
and task.`status` = #{condition.status}
|
</if>
|
<if test="condition.flag != null and condition.flag != ''">
|
and task.`flag` = #{condition.flag}
|
</if>
|
<if test="condition.starttime != null and condition.starttime != ''">
|
and task.`starttime` >= #{condition.starttime}
|
</if>
|
<if test="condition.endtime != null and condition.endtime != ''">
|
and task.`endtime` <= #{condition.endtime}
|
</if>
|
<if test="condition.constructionunit != null and condition.constructionunit != ''">
|
and task.`level` = #{condition.constructionunit}
|
</if>
|
<if test="condition.tasktype != null and condition.tasktype != ''">
|
subtask.`type` = #{condition.tasktype}
|
</if>
|
</where>
|
|
GROUP BY
|
task.`code`
|
)
|
|
</select>
|
<select id="getTotalByYear" resultType="java.lang.Integer">
|
select count(*)
|
from (
|
select id
|
from task
|
where year(createdat) = #{year}
|
) total
|
</select>
|
<select id="selectDataGridViewable" resultType="com.gk.hotwork.Domain.TaskInfo">
|
select
|
task.id,
|
task.status,
|
task.unit,
|
task.department,
|
task.applicant,
|
task.code,
|
task.level,
|
task.area,
|
task.mode,
|
task.director,
|
task.starttime,
|
task.endtime,
|
task.othertask,
|
task.hazard,
|
task.supervisor,
|
task.profession,
|
task.partdirector,
|
task.approversupervisor,
|
task.approverprofession,
|
task.applyunitopinion,
|
task.constructionopinion,
|
task.relevantopinion,
|
task.securityopinion,
|
task.enterpriseopinion,
|
task.shiftleaderopinion,
|
task.applyunitname,
|
task.constructionname,
|
task.relevantname,
|
task.securityname,
|
task.enterprisename,
|
task.shiftleadername,
|
task.applyunittime,
|
task.constructiontime,
|
task.relevanttime,
|
task.securitytime,
|
task.enterprisetime,
|
task.shiftleadertime,
|
task.completedtime,
|
task.completedname,
|
task.completedconfirm,
|
task.createdat,
|
task.createdby,
|
task.modifiedat,
|
task.modifiedby,
|
task.flag,
|
task.isdel,
|
task.constructionunit,
|
task.securitydep,
|
task.isholiday,
|
task.analyst,
|
task.supervisoropinion,
|
task.content,
|
task.opinion,
|
task.path,
|
task.description,
|
task.isanalysis,
|
task.analysisarea,
|
task.analysismedium
|
from task
|
LEFT JOIN taskinvolvedep as tid on task.code = tid.taskcode
|
left join subtask on subtask.taskcode = task.code
|
<where>
|
task.isdel = 0
|
<if test="condition.code != null and condition.code != ''">
|
and task.code like concat('%',#{condition.code},'%')
|
</if>
|
<if test="condition.level != null and condition.level != ''">
|
and task.level = #{condition.level}
|
</if>
|
<if test="condition.status != null and condition.status != ''">
|
and task.status = #{condition.status}
|
</if>
|
|
<if test="condition.time != null and condition.time != ''">
|
and task.starttime <= #{condition.time}
|
and task.endtime >= #{condition.time}
|
</if>
|
|
<if test="condition.starttime != null and condition.starttime != ''">
|
and task.starttime <= #{condition.starttime}
|
</if>
|
<if test="condition.endtime != null and condition.endtime != ''">
|
and task.endtime >= #{condition.endtime}
|
</if>
|
<if test="condition.department != null and condition.department != ''">
|
and task.department = #{condition.department}
|
</if>
|
<if test="condition.constructionunit != null and condition.constructionunit != ''">
|
and task.level = #{condition.constructionunit}
|
</if>
|
<if test="condition.tasktype != null and condition.tasktype != ''">
|
subtask.type = #{condition.tasktype}
|
</if>
|
<if test="condition.list != null and condition.list.size()>0">
|
AND task.flag IN
|
<foreach item="item" index="index" collection="condition.list" open="(" close=")" separator=",">
|
#{item}
|
</foreach>
|
</if>
|
<if test="condition.applicant != null and condition.applicant != ''">
|
and task.applicant = #{condition.applicant}
|
</if>
|
and(task.department = #{condition.department} and task.unit = #{condition.unit}
|
)
|
or(tid.department = #{condition.department} and task.status in (4,5,6,7))
|
or(task.securitydep = #{condition.department} and task.status in (5,6,7))
|
or(task.constructionunit = #{condition.unit} and task.status in (2,3,4,5,6,7))
|
or(task.constructionunit = #{condition.department} and task.status in (2,3,4,5,6,7))
|
or 1 = #{condition.userType}
|
|
</where>
|
group by task.code
|
</select>
|
<select id="getPendingTask" resultType="com.gk.hotwork.Domain.Vo.TaskVo">
|
select
|
task.id,
|
task.status,
|
task.unit,
|
task.department,
|
task.applicant,
|
task.code, level,
|
task.area,
|
task.mode,
|
task.director,
|
task.starttime,
|
task.endtime,
|
task.othertask,
|
task.hazard,
|
task.supervisor,
|
task.profession,
|
task.partdirector,
|
task.approversupervisor,
|
task.approverprofession,
|
task.applyunitopinion,
|
task.constructionopinion,
|
task.relevantopinion,
|
task.securityopinion,
|
task.enterpriseopinion,
|
task.shiftleaderopinion,
|
task.applyunitname,
|
task.constructionname,
|
task.relevantname,
|
task.securityname,
|
task.enterprisename,
|
task.shiftleadername,
|
task.applyunittime,
|
task.constructiontime,
|
task.relevanttime,
|
task.securitytime,
|
task.enterprisetime,
|
task.shiftleadertime,
|
task.completedtime,
|
task.completedname,
|
task.completedconfirm,
|
task.createdat,
|
task.createdby,
|
task.modifiedat,
|
task.modifiedby,
|
task.flag,
|
task.isdel,
|
task.constructionunit,
|
task.securitydep,
|
task.isholiday,
|
task.analyst,
|
task.supervisoropinion,
|
task.content,
|
task.opinion,
|
task.description,
|
task.isanalysis,
|
task.analysisarea,
|
task.analysismedium
|
from task
|
LEFT JOIN taskinvolvedep as tid on task.`code` = tid.taskcode
|
left join taskworker as tw on task.`code` = tw.taskcode
|
<where>
|
task.isdel = 0
|
and task.status = 7
|
<if test="type != null and type == '1'.toString()">
|
and tw.worker = #{name}
|
</if>
|
<if test="type != null and type == '2'.toString()">
|
and task.approversupervisor = #{name}
|
</if>
|
<if test="type != null and type == '3'.toString()">
|
and task.analyst = #{name}
|
</if>
|
</where>
|
group by task.code
|
order by task.createdat desc
|
</select>
|
<select id="getDoingTask" resultType="com.gk.hotwork.Domain.Vo.TaskVo">
|
select
|
task.id,
|
task.status,
|
task.unit,
|
task.department,
|
task.applicant,
|
task.code, level,
|
task.area,
|
task.mode,
|
task.director,
|
task.starttime,
|
task.endtime,
|
task.othertask,
|
task.hazard,
|
task.supervisor,
|
task.profession,
|
task.partdirector,
|
task.approversupervisor,
|
task.approverprofession,
|
task.applyunitopinion,
|
task.constructionopinion,
|
task.relevantopinion,
|
task.securityopinion,
|
task.enterpriseopinion,
|
task.shiftleaderopinion,
|
task.applyunitname,
|
task.constructionname,
|
task.relevantname,
|
task.securityname,
|
task.enterprisename,
|
task.shiftleadername,
|
task.applyunittime,
|
task.constructiontime,
|
task.relevanttime,
|
task.securitytime,
|
task.enterprisetime,
|
task.shiftleadertime,
|
task.completedtime,
|
task.completedname,
|
task.completedconfirm,
|
task.createdat,
|
task.createdby,
|
task.modifiedat,
|
task.modifiedby,
|
task.flag,
|
task.isdel,
|
task.constructionunit,
|
task.securitydep,
|
task.isholiday,
|
task.analyst,
|
task.supervisoropinion,
|
task.content,
|
task.opinion,
|
task.description,
|
task.isanalysis,
|
task.analysisarea,
|
task.analysismedium
|
from task
|
LEFT JOIN taskinvolvedep as tid on task.`code` = tid.taskcode
|
left join taskworker as tw on task.`code` = tw.taskcode
|
<where>
|
task.isdel = 0
|
and task.status = 7
|
and task.flag = 4
|
</where>
|
group by task.code
|
</select>
|
<select id="selectPageWorkTodayDetail" resultType="com.gk.hotwork.Domain.Vo.WorkShowTaskVo">
|
select *
|
from (
|
select
|
t1.unit,
|
t1.department,
|
t1.applicant,
|
t1.code,
|
t1.level,
|
t1.area,
|
t1.mode,
|
t1.director,
|
t1.starttime,
|
t1.endtime,
|
t1.othertask,
|
t1.hazard
|
from hotwork.task as t1
|
where flag = #{params.flag}
|
and DATE(t1.endtime) >= CURDATE()
|
and DATE(t1.starttime) <= CURDATE()
|
and isdel = 0
|
) as a
|
|
|
</select>
|
<select id="selectCountWorkToday" resultType="java.lang.Integer">
|
select count(0)
|
from hotwork.task as t1
|
where t1.flag = #{flag}
|
and isdel = 0
|
and DATE(t1.endtime) >= CURDATE()
|
and DATE(t1.starttime) <= CURDATE()
|
|
</select>
|
<select id="selectCountDoneInPeriod" resultType="java.lang.Integer">
|
select count(0)
|
from hotwork.task as t1
|
where t1.status = #{status}
|
and isdel = 0
|
and DATE(t1.createdat) >= DATE(#{startTime})
|
|
</select>
|
<select id="selectCountWorkEverydayInMonth" resultType="java.util.Map">
|
|
select
|
days.day,
|
ifnull(info.worknum,0) num
|
from
|
<foreach collection="days" item="item" open="(" close=")" separator="union all">
|
SELECT date_sub(curdate(), interval #{item} day) as day
|
</foreach>
|
as days
|
left join(
|
select
|
date_format(t1.createdat,"%Y-%m-%d") day,
|
count(0) worknum
|
from hotwork.task as t1
|
where t1.status = #{status}
|
and date(t1.createdat) >= #{startTime}
|
and isdel = 0
|
group by DATE_FORMAT(t1.createdat,"%Y-%m-%d")
|
)
|
as info on info.day = days.day
|
order by days.day
|
|
|
</select>
|
<select id="selectStatisticsData" resultType="com.gk.hotwork.Domain.Vo.TaskStatistics">
|
SELECT
|
task.constructionunit,
|
subtask.type,
|
COUNT(*) as countNum
|
FROM
|
subtask
|
LEFT JOIN task ON task.`code` = subtask.taskcode
|
<where>
|
1=1
|
<if test="condition.starttime != null and condition.starttime != ''">
|
and task.`createdat` >= #{condition.starttime}
|
</if>
|
<if test="condition.endtime != null and condition.endtime != ''">
|
and task.`createdat` <= #{condition.endtime}
|
</if>
|
|
<if test="condition.company != null and condition.company != ''">
|
and task.constructionunit = #{condition.company}
|
</if>
|
|
<if test="condition.type != null and condition.type != ''">
|
and subtask.type = #{condition.type}
|
</if>
|
|
<if test="condition.status != null ">
|
and task.status = #{condition.status}
|
</if>
|
|
<if test="condition.flag != null ">
|
and task.flag = #{condition.flag}
|
</if>
|
</where>
|
GROUP BY
|
task.constructionunit,
|
subtask.type
|
</select>
|
<select id="selectDataGridTesting" resultType="com.gk.hotwork.Domain.TaskInfo">
|
select
|
task.id,
|
task.status,
|
task.unit,
|
task.department,
|
task.applicant,
|
task.code,
|
task.level,
|
task.area,
|
task.mode,
|
task.director,
|
task.starttime,
|
task.endtime,
|
task.othertask,
|
task.hazard,
|
task.supervisor,
|
task.profession,
|
task.partdirector,
|
task.approversupervisor,
|
task.approverprofession,
|
task.applyunitopinion,
|
task.constructionopinion,
|
task.relevantopinion,
|
task.securityopinion,
|
task.enterpriseopinion,
|
task.shiftleaderopinion,
|
task.applyunitname,
|
task.constructionname,
|
task.relevantname,
|
task.securityname,
|
task.enterprisename,
|
task.shiftleadername,
|
task.applyunittime,
|
task.constructiontime,
|
task.relevanttime,
|
task.securitytime,
|
task.enterprisetime,
|
task.shiftleadertime,
|
task.completedtime,
|
task.completedname,
|
task.completedconfirm,
|
task.createdat,
|
task.createdby,
|
task.modifiedat,
|
task.modifiedby,
|
task.flag,
|
task.isdel,
|
task.constructionunit,
|
task.securitydep,
|
task.isholiday,
|
task.analyst,
|
task.supervisoropinion,
|
task.content,
|
task.opinion,
|
task.path,
|
task.description,
|
task.isanalysis,
|
task.analysisarea,
|
task.analysismedium
|
from task
|
<where>
|
task.isdel = 0
|
and task.isanalysis = 1
|
<if test="condition.searchflag != null and condition.searchflag == '0'.toString()">
|
and task.status = 8
|
</if>
|
<if test="condition.searchflag != null and condition.searchflag == '1'.toString()">
|
and task.flag = 4
|
</if>
|
<if test="condition.specificDepartment != null and condition.specificDepartment != ''">
|
and task.department = #{condition.specificDepartment}
|
</if>
|
</where>
|
group by task.code
|
</select>
|
|
</mapper>
|