<?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="cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper" >
|
<resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Subtask" >
|
<!--
|
WARNING - @mbg.generated
|
-->
|
<id column="ST_GUID" property="stguid" jdbcType="VARCHAR" />
|
<result column="T_GUID" property="tguid" jdbcType="VARCHAR" />
|
<result column="TS_GUID" property="tsguid" jdbcType="VARCHAR" />
|
<result column="ST_name" property="name" jdbcType="VARCHAR" />
|
<result column="ST_Priority" property="priority" jdbcType="BIT" />
|
<result column="ST_TypeNo" property="typeno" jdbcType="TINYINT" />
|
<result column="ST_Type" property="type" jdbcType="VARCHAR" />
|
<result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR" />
|
<result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR" />
|
<result column="ST_CityCode" property="citycode" jdbcType="VARCHAR" />
|
<result column="ST_CityName" property="cityname" jdbcType="VARCHAR" />
|
<result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR" />
|
<result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR" />
|
<result column="ST_TownCode" property="towncode" jdbcType="VARCHAR" />
|
<result column="ST_TownName" property="townname" jdbcType="VARCHAR" />
|
<result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR" />
|
<result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR" />
|
<result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR" />
|
<result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR" />
|
<result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP" />
|
<result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP" />
|
<result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR" />
|
<result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR" />
|
<result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR" />
|
<result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP" />
|
<result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP" />
|
<result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP" />
|
<result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR" />
|
<result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR" />
|
<result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR" />
|
<result column="ST_Status" property="status" jdbcType="VARCHAR" />
|
<result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER" />
|
<result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR" />
|
<result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR" />
|
<result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR" />
|
<result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR" />
|
<result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP" />
|
<result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR" />
|
<result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR" />
|
<result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR" />
|
<result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR" />
|
<result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP" />
|
<result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR" />
|
<result column="ST_Extension1" property="extension1" jdbcType="VARCHAR" />
|
<result column="ST_Extension2" property="extension2" jdbcType="VARCHAR" />
|
<result column="ST_Extension3" property="extension3" jdbcType="VARCHAR" />
|
<result column="ST_Remark" property="remark" jdbcType="VARCHAR" />
|
</resultMap>
|
|
<resultMap id="SubtaskSearchResultVo" type="cn.flightfeather.supervision.lightshare.vo.SubtaskSearchResultVo">
|
<result column="subTaskId" property="subTaskId" jdbcType="VARCHAR" />
|
<result column="districtName" property="districtName" jdbcType="VARCHAR" />
|
<result column="townName" property="townName" jdbcType="VARCHAR" />
|
<result column="sceneId" property="sceneId" jdbcType="VARCHAR" />
|
<result column="sceneName" property="sceneName" jdbcType="VARCHAR" />
|
<result column="sceneTypeId" property="sceneTypeId" jdbcType="TINYINT" />
|
<result column="sceneType" property="sceneType" jdbcType="VARCHAR" />
|
<result column="sceneAddress" property="sceneAddress" jdbcType="VARCHAR" />
|
<result column="planStartTime" property="planStartTime" jdbcType="TIMESTAMP" />
|
<result column="planEndTime" property="planEndTime" jdbcType="TIMESTAMP" />
|
<result column="status" property="status" jdbcType="VARCHAR" />
|
<result column="path" property="path" jdbcType="VARCHAR" />
|
</resultMap>
|
|
<resultMap id="SubTaskSearchResultVo2" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSearchResultVo2">
|
<result column="subTaskId" property="subTaskId" jdbcType="VARCHAR" />
|
<result column="districtName" property="districtName" jdbcType="VARCHAR" />
|
<result column="townName" property="townName" jdbcType="VARCHAR" />
|
<result column="sceneId" property="sceneId" jdbcType="VARCHAR" />
|
<result column="sceneName" property="sceneName" jdbcType="VARCHAR" />
|
<result column="sceneTypeId" property="sceneTypeId" jdbcType="TINYINT" />
|
<result column="sceneType" property="sceneType" jdbcType="VARCHAR" />
|
<result column="sceneAddress" property="sceneAddress" jdbcType="VARCHAR" />
|
<result column="planStartTime" property="planStartTime" jdbcType="TIMESTAMP" />
|
<result column="planEndTime" property="planEndTime" jdbcType="TIMESTAMP" />
|
<result column="status" property="status" jdbcType="VARCHAR" />
|
<result column="path" property="path" jdbcType="VARCHAR" />
|
|
<result column="problemId" property="problemId" jdbcType="VARCHAR" />
|
<result column="problemName" property="problemName" jdbcType="VARCHAR" />
|
<result column="problemCode" property="problemCode" jdbcType="VARCHAR" />
|
<result column="longitude" property="longitude" jdbcType="DECIMAL" />
|
<result column="latitude" property="latitude" jdbcType="DECIMAL" />
|
<result column="location" property="location" jdbcType="VARCHAR" />
|
<result column="rectification" property="rectification" jdbcType="BIT" />
|
<result column="rectificationTime" property="rectificationTime" jdbcType="TIMESTAMP" />
|
<result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
|
|
<result column="mGuid" property="mGuid" jdbcType="VARCHAR" />
|
<result column="mExtension1" property="mExtension1" jdbcType="VARCHAR" />
|
<result column="isChanged" property="isChanged" jdbcType="BIT" />
|
</resultMap>
|
|
<resultMap id="SubtaskVoMap" type="cn.flightfeather.supervision.lightshare.vo.SubtaskVo" >
|
<id column="ST_GUID" property="stguid" jdbcType="VARCHAR" />
|
<result column="T_GUID" property="tguid" jdbcType="VARCHAR" />
|
<result column="TS_GUID" property="tsguid" jdbcType="VARCHAR" />
|
<result column="ST_name" property="name" jdbcType="VARCHAR" />
|
<result column="ST_Priority" property="priority" jdbcType="BIT" />
|
<result column="ST_TypeNo" property="typeno" jdbcType="TINYINT" />
|
<result column="ST_Type" property="type" jdbcType="VARCHAR" />
|
<result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR" />
|
<result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR" />
|
<result column="ST_CityCode" property="citycode" jdbcType="VARCHAR" />
|
<result column="ST_CityName" property="cityname" jdbcType="VARCHAR" />
|
<result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR" />
|
<result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR" />
|
<result column="ST_TownCode" property="towncode" jdbcType="VARCHAR" />
|
<result column="ST_TownName" property="townname" jdbcType="VARCHAR" />
|
<result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR" />
|
<result column="S_TypeID" property="scenseTypeId" jdbcType="VARCHAR" />
|
<result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR" />
|
<result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR" />
|
<result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR" />
|
<result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP" />
|
<result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP" />
|
<result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR" />
|
<result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR" />
|
<result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR" />
|
<result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP" />
|
<result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP" />
|
<result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP" />
|
<result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR" />
|
<result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR" />
|
<result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR" />
|
<result column="ST_Status" property="status" jdbcType="VARCHAR" />
|
<result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER" />
|
<result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR" />
|
<result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR" />
|
<result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR" />
|
<result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR" />
|
<result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP" />
|
<result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR" />
|
<result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR" />
|
<result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR" />
|
<result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR" />
|
<result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP" />
|
<result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR" />
|
<result column="ST_Extension1" property="extension1" jdbcType="VARCHAR" />
|
<result column="ST_Extension2" property="extension2" jdbcType="VARCHAR" />
|
<result column="ST_Extension3" property="extension3" jdbcType="VARCHAR" />
|
<result column="ST_Remark" property="remark" jdbcType="VARCHAR" />
|
</resultMap>
|
|
<resultMap id="SubTaskSummary" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSummary" >
|
<result column="ST_GUID" property="stGuid" jdbcType="VARCHAR" />
|
<result column="ST_name" property="stName" jdbcType="VARCHAR" />
|
<result column="ST_PlanStartTime" property="stPlanTime" jdbcType="TIMESTAMP" />
|
<result column="S_GUID" property="sceneId" jdbcType="VARCHAR" />
|
<result column="S_Name" property="sceneName" jdbcType="VARCHAR" />
|
<result column="S_Type" property="sceneType" jdbcType="VARCHAR" />
|
<result column="I_GUID" property="insGuid" jdbcType="VARCHAR" />
|
<result column="proNum" property="proNum" jdbcType="INTEGER" />
|
<result column="changeNum" property="changeNum" jdbcType="INTEGER" />
|
<result column="proCheckedNum" property="proCheckedNum" jdbcType="INTEGER" />
|
<result column="changeCheckedNum" property="changeCheckedNum" jdbcType="INTEGER" />
|
</resultMap>
|
<sql id="Base_Column_List" >
|
<!--
|
WARNING - @mbg.generated
|
-->
|
ST_GUID, T_GUID, TS_GUID, ST_name, ST_Priority, ST_TypeNo, ST_Type, ST_ProvinceCode,
|
ST_ProvinceName, ST_CityCode, ST_CityName, ST_DistrictCode, ST_DistrictName, ST_TownCode,
|
ST_TownName, ST_ScenseName, ST_ScenseID, ST_ScenseAddress, ST_DeadLineType, ST_PlanStartTime,
|
ST_PlanEndTime, ST_DeployerGUID, ST_DeployerUserName, ST_DeployerRealName, ST_DeployTime,
|
ST_ExecutionStartTime, ST_ExecutionEndTime, ST_ExecutorGUIDs, ST_ExecutorUserNames,
|
ST_ExecutorRealTimes, ST_Status, ST_NotifedCount, ST_RuleList, ST_AssessorGUID, ST_AssessorUserName,
|
ST_AssessorRealName, ST_AssessTime, ST_AssessResult, ST_ThirdAssessorGUID, ST_ThirdAssessorUserName,
|
ST_ThirdAssessorRealName, ST_ThirdAssessTime, ST_ThirdAssessResult, ST_Extension1,
|
ST_Extension2, ST_Extension3, ST_Remark
|
</sql>
|
|
<select id="getSubtask" resultMap="SubtaskSearchResultVo">
|
SELECT
|
a.ST_GUID as 'subTaskId',
|
a.ST_DistrictName as 'districtName',
|
b.S_TownName as 'townName',
|
a.ST_ScenseID as 'sceneId',
|
a.ST_ScenseName as 'sceneName',
|
b.S_TypeID as 'sceneTypeId',
|
b.S_Type as 'sceneType',
|
a.ST_ScenseAddress as 'sceneAddress',
|
a.ST_PlanStartTime as 'planStartTime',
|
a.ST_PlanEndTime as 'planEndTime',
|
a.ST_Status as 'status',
|
c.I_Extension1 as 'path'
|
FROM
|
tm_t_subtask AS a
|
LEFT JOIN sm_t_scense AS b ON a.ST_ScenseID = b.S_GUID
|
LEFT JOIN im_t_inspection AS c ON a.ST_GUID = c.ST_GUID
|
LEFT JOIN ea_t_evaluation AS d ON a.ST_GUID = d.ST_GUID
|
WHERE
|
a.ST_DistrictCode = #{param1}
|
AND a.ST_PlanStartTime >= #{param2}
|
AND a.ST_PlanEndTime <= #{param3}
|
<if test="param4 != null">
|
AND b.S_TypeID = #{param4}
|
</if>
|
</select>
|
<select id="getSubtask2" resultMap="SubTaskSearchResultVo2">
|
SELECT
|
a.ST_GUID as 'subTaskId',
|
a.ST_DistrictName as 'districtName',
|
b.S_TownName as 'townName',
|
a.ST_ScenseID as 'sceneId',
|
a.ST_ScenseName as 'sceneName',
|
b.S_TypeID as 'sceneTypeId',
|
b.S_Type as 'sceneType',
|
a.ST_ScenseAddress as 'sceneAddress',
|
a.ST_PlanStartTime as 'planStartTime',
|
a.ST_PlanEndTime as 'planEndTime',
|
a.ST_Status as 'status',
|
c.I_Extension1 as 'path',
|
d.PL_GUID as 'problemId',
|
d.PL_ProblemName as 'problemName',
|
f.PT_Extension1 as 'problemCode',
|
d.PL_Longitude as 'longitude',
|
d.PL_Latitude as 'latitude',
|
d.PL_Location as 'location',
|
d.PL_IsChanged as 'rectification',
|
d.PL_ChangedTime as 'rectificationTime',
|
(CASE WHEN d.PL_IsChanged IS FALSE THEN d.PL_Time
|
WHEN d.PL_ChangedTime IS NULL THEN d.PL_Time
|
ELSE d.PL_ChangedTime END ) as 'updateTime',
|
e.MF_GUID as 'mGuid',
|
e.MF_Extension1 as 'mExtension1',
|
e.MF_IsChanged as 'isChanged'
|
FROM
|
im_t_problemlist AS d
|
LEFT JOIN tm_t_subtask AS a ON a.ST_GUID = d.ST_GUID
|
LEFT JOIN sm_t_scense AS b ON b.S_GUID = a.ST_ScenseID
|
LEFT JOIN im_t_inspection AS c ON a.ST_GUID = c.ST_GUID
|
LEFT JOIN sm_t_problemtype AS f ON d.PT_GUID = f.PT_GUID
|
RIGHT JOIN im_t_mediafile AS e ON d.PL_GUID = e.MF_BusinessGUID
|
WHERE
|
a.ST_DistrictCode = #{param3}
|
<if test="param1 != null">
|
AND ((d.PL_ChangedTime is not null and d.PL_ChangedTime > #{param1}) OR d.PL_Time > #{param2})
|
</if>
|
<if test="param4 != null">
|
AND b.S_TypeID = #{param4}
|
</if>
|
<if test="param5 != null">
|
AND a.ST_PlanStartTime >= #{param5}
|
</if>
|
<if test="param6 != null">
|
AND a.ST_PlanEndTime <= #{param6}
|
</if>
|
AND d.PL_Extension3 != 'unCheck' AND d.PL_Extension3 != 'fail' AND d.PL_Extension3 != 'change_fail'
|
AND d.PL_Extension3 IS NOT NULL
|
ORDER BY updateTime
|
</select>
|
|
<select id="selectByTopTask" resultMap="SubtaskVoMap"><![CDATA[
|
select * from tm_t_subtask as a left join sm_t_scense as b on a.ST_ScenseID = b.S_GUID
|
where a.ST_PlanStartTime >=#{param2} and a.ST_PlanEndTime <= #{param3} and a.T_GUID = #{param1}]]>
|
<if test="param4 != null">
|
and b.S_TypeID = #{param4}
|
</if>
|
</select>
|
|
<select id="selectByTopTask2" resultMap="BaseResultMap">
|
select * from tm_t_subtask as a left join sm_t_scense as b on a.ST_ScenseID = b.S_GUID
|
where a.T_GUID = #{param1}
|
<if test="param2 != null">
|
and b.S_TypeID = #{param2}
|
</if>
|
</select>
|
|
<select id="getSummary" resultMap="SubTaskSummary">
|
SELECT
|
a.ST_GUID,
|
a.ST_name,
|
a.ST_PlanStartTime,
|
b.S_GUID,
|
b.S_Name,
|
b.S_Type,
|
c.I_GUID,
|
SUM(d.PL_GUID is NOT null) AS proNum,
|
SUM(d.PL_IsChanged = TRUE) AS changeNum,
|
SUM(d.PL_Extension3 != 'unCheck') AS proCheckedNum,
|
SUM(
|
d.PL_Extension3 = 'change_pass' || d.PL_Extension3 = 'change_fail'
|
) AS changeCheckedNum
|
|
FROM
|
tm_t_subtask AS a
|
LEFT JOIN sm_t_scense AS b ON a.ST_ScenseID = b.S_GUID
|
LEFT JOIN im_t_inspection AS c ON a.ST_GUID = c.ST_GUID
|
LEFT JOIN im_t_problemlist AS d ON a.ST_GUID = d.ST_GUID
|
WHERE
|
a.T_GUID = #{param1}
|
<if test="param2 != null">
|
and b.S_TypeID = #{param2}
|
</if>
|
GROUP BY
|
a.ST_GUID
|
</select>
|
</mapper>
|