| | |
| | | UPDATE dj_jdgz_track_record |
| | | SET CURRENT_STATUS = 0 |
| | | WHERE LEVEL3_NETWORK_ID = ( |
| | | SELECT LEVEL3_NETWORK_ID FROM dj_jdgz_track_record WHERE id = ${id} |
| | | SELECT LEVEL3_NETWORK_ID |
| | | FROM dj_jdgz_track_record |
| | | WHERE id = ${id} |
| | | ) |
| | | AND create_date >= ( |
| | | SELECT create_date FROM dj_jdgz_track_record WHERE id = ${id} |
| | | SELECT create_date |
| | | FROM dj_jdgz_track_record |
| | | WHERE id = ${id} |
| | | ); |
| | | </update> |
| | | |
| | |
| | | c.teamgroup_name, |
| | | c.dept_id, |
| | | c.cabin_id, |
| | | c.iseal_cabin, |
| | | c.islt, |
| | | c.type, |
| | | c.`NAME` as level3NetworkName, |
| | | a.PROCESS_NAME AS level3NodeName, |
| | |
| | | <if test="deptId!=null"> |
| | | and c.dept_id = ${deptId} |
| | | </if> |
| | | <if test="isealCabin!=10000 and isealCabin!=null"> |
| | | and c.iseal_cabin = ${isealCabin} |
| | | </if> |
| | | <if test="teamId!=null"> |
| | | and c.TEAMGROUP_ID = ${teamId} |
| | | </if> |
| | | <if test="cabinId!=null"> |
| | | and c.cabin_id LIKE '%${cabinId}%' |
| | | and ',' || c.cabin_id || ',' LIKE '%,${cabinId},%' |
| | | </if> |
| | | <if test="type!=null and type!=''"> |
| | | and c.type = #{type} |
| | | and c.type = '${type}' |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and c.name LIKE '%${name}%' |
| | |
| | | </select> |
| | | <select id="getHistory" resultType="com.example.server.progressTrack.model.DjJdgzTrackRecord"> |
| | | select GENERAL_REPAIR_UNIT || ',' || GENERAL_REPAIR_UNIT_DIRECTOR || ',' || |
| | | GENERAL_REPAIR_UNIT_CONTACT AS generalRepair, |
| | | REPAIR_UNIT || ',' || REPAIR_UNIT_DIRECTOR || ',' || REPAIR_UNIT_CONTACT AS `repair`, |
| | | track_person || ',' || track_person_unit || ',' || track_person_contact AS trackPerson, |
| | | tracked_person || ',' || tracked_person_unit || ',' || tracked_person_contact AS trackedPerson, |
| | | GENERAL_REPAIR_UNIT_CONTACT AS generalRepair, |
| | | REPAIR_UNIT || ',' || REPAIR_UNIT_DIRECTOR || ',' || REPAIR_UNIT_CONTACT AS `repair`, |
| | | track_person || ',' || track_person_unit || ',' || track_person_contact AS trackPerson, |
| | | tracked_person || ',' || tracked_person_unit || ',' || tracked_person_contact AS trackedPerson, |
| | | track_method, |
| | | track_location, |
| | | CURRENT_STATUS, |
| | |
| | | </select> |
| | | <select id="getReport" resultType="com.example.server.progressTrack.Dto.StatistReportsDto"> |
| | | select d.*, e.name as teamGroupName |
| | | from ( |
| | | select TEAMGROUP_ID, |
| | | count(1) as allNum, |
| | | sum(case when status = 'zcjxz' or status = 'lq' then 1 else 0 end) as jxzNum, |
| | | sum(case when status = 'lq' then 1 else 0 end) as lqNum, |
| | | sum(case when status = 'yq' then 1 else 0 end) as yqNum, |
| | | sum(case when status = 'zcwc' then 1 else 0 end) as zcwcNum, |
| | | sum(case when status = 'cqwc' then 1 else 0 end) as cqwcNum |
| | | from ( |
| | | select a.TEAMGROUP_ID, |
| | | CASE |
| | | WHEN b.CURRENT_STATUS = 1 |
| | | AND b.REQUIRED_COMPLETION_TIME > b.ACTUAL_COMPLETION THEN |
| | | 'cqwc' |
| | | WHEN b.CURRENT_STATUS = 1 THEN |
| | | 'zcwc' |
| | | WHEN b.REQUIRED_COMPLETION_TIME < (SELECT datetime('now')) THEN 'yq' |
| | | WHEN b.REQUIRED_COMPLETION_TIME < |
| | | (SELECT date('now', '-' || c.advent_day || ' days')) THEN 'lq' |
| | | from (select TEAMGROUP_ID, |
| | | count(1) as allNum, |
| | | sum(case when status = 'zcjxz' or status = 'lq' then 1 else 0 end) as jxzNum, |
| | | sum(case when status = 'lq' then 1 else 0 end) as lqNum, |
| | | sum(case when status = 'yq' then 1 else 0 end) as yqNum, |
| | | sum(case when status = 'zcwc' then 1 else 0 end) as zcwcNum, |
| | | sum(case when status = 'cqwc' then 1 else 0 end) as cqwcNum |
| | | from (select c.TEAMGROUP_ID, |
| | | CASE |
| | | WHEN b.CURRENT_STATUS = 1 |
| | | AND b.REQUIRED_COMPLETION_TIME > b.ACTUAL_COMPLETION THEN |
| | | 'cqwc' |
| | | WHEN b.CURRENT_STATUS = 1 THEN |
| | | 'zcwc' |
| | | WHEN b.REQUIRED_COMPLETION_TIME < (SELECT datetime('now')) THEN 'yq' |
| | | WHEN b.REQUIRED_COMPLETION_TIME < |
| | | (SELECT date('now', '-' || d.advent_day || ' days')) THEN 'lq' |
| | | ELSE 'zcjxz' |
| | | END AS status |
| | | from dj_jdgz_network_level3 a, |
| | | dj_jdgz_network_level3_list b, |
| | | dj_jdgz_network_level1 c |
| | | where a.IS_DELETE = 0 |
| | | and a.LEVEL1_NETWORK_ID = ${level1NetworkId} |
| | | and a.LEVEL1_NETWORK_ID = c.id |
| | | and b.IS_DELETE = 0 |
| | | and b.NETWORK_ID = a.id |
| | | ) c |
| | | group by TEAMGROUP_ID |
| | | ) d, |
| | | FROM dj_jdgz_track_record a |
| | | LEFT JOIN dj_jdgz_network_level3_list b |
| | | on b.ID = a.LEVEL3_NODE_ID |
| | | LEFT JOIN dj_jdgz_network_level3 c on c.ID = b.NETWORK_ID |
| | | LEFT JOIN dj_jdgz_network_level1 d on d.ID = c.LEVEL1_NETWORK_ID |
| | | where c.IS_DELETE = 0 |
| | | and c.LEVEL1_NETWORK_ID = ${level1NetworkId} |
| | | and c.LEVEL1_NETWORK_ID = d.id |
| | | and b.IS_DELETE = 0 |
| | | and a.IS_DELETE = 0 |
| | | and d.IS_DELETE = 0 |
| | | and b.NETWORK_ID = c.id) c |
| | | group by TEAMGROUP_ID ) d, |
| | | dj_sys_teamgroup_class e |
| | | where d.TEAMGROUP_ID = e.id |
| | | </select> |
| | |
| | | dj_jdgz_track_record where is_delete = 0 ) |
| | | and a.is_delete = 0 |
| | | <if test="userId!=null"> |
| | | AND a.TEAMGROUP_ID in (select teamgroup from sys_user where is_delete=0 and user_id=#{userId}) |
| | | AND a.TEAMGROUP_ID in (select teamgroup from sys_user where is_delete=0 and id=#{userId}) |
| | | </if> |
| | | <if test="deptId!=null"> |
| | | AND b.DEPT_ID = ${deptId} |
| | | </if> |
| | | <if test="teamId!=null"> |
| | | AND b.TEAMGROUP_ID = ${teamId} |
| | | </if> |
| | | <if test="name!=null"> |
| | | AND b.name LIKE '%${name}%' |
| | | </if> |
| | | AND b.IS_DELETE = 0 |
| | | AND c.IS_DELETE = 0 |
| | |
| | | a.IS_DELETE = 0 |
| | | and a.network_id != 10000 |
| | | <if test="teamgroupId!=null and teamgroupId!=''"> |
| | | AND a.TEAMGROUP_ID in (${teamgroupId}) |
| | | AND h.ID in (${teamgroupId}) |
| | | </if> |
| | | <if test="istq!=1 and istq!=null"> |
| | | AND a.REQUIRED_COMPLETION_TIME < b.estimated_completion_time |
| | |
| | | ORDER BY |
| | | a.REQUIRED_COMPLETION_TIME |
| | | </select> |
| | | <select id="getReportRecord" resultType="com.example.server.progressTrack.Dto.ReportRecordDto"> |
| | | select c.NAME,b.PROCESS_NAME |
| | | FROM dj_jdgz_track_record a |
| | | LEFT JOIN dj_jdgz_network_level3_list b on b.ID = a.LEVEL3_NODE_ID |
| | | LEFT JOIN dj_jdgz_network_level3 c on c.ID = b.NETWORK_ID |
| | | LEFT JOIN dj_jdgz_network_level1 d on d.ID = c.LEVEL1_NETWORK_ID |
| | | where a.IS_DELETE = 0 |
| | | and c.LEVEL1_NETWORK_ID = ${level1NetworkId} |
| | | and c.TEAMGROUP_ID = ${teamgroupId} |
| | | and c.LEVEL1_NETWORK_ID = d.id |
| | | and b.IS_DELETE = 0 |
| | | and b.NETWORK_ID = c.id |
| | | and c.IS_DELETE = 0 |
| | | and d.IS_DELETE = 0 |
| | | <if test="column==2"> |
| | | and (b.CURRENT_STATUS = 0 or b.CURRENT_STATUS is null) |
| | | and b.REQUIRED_COMPLETION_TIME >= ( SELECT date( 'now', '-' || d.advent_day || ' days' ) ) |
| | | </if> |
| | | <if test="column==3"> |
| | | and (b.CURRENT_STATUS = 0 or b.CURRENT_STATUS is null) |
| | | and b.REQUIRED_COMPLETION_TIME < ( SELECT date( 'now', '-' || d.advent_day || ' days' ) ) |
| | | </if> |
| | | <if test="column==4"> |
| | | and (b.CURRENT_STATUS = 0 or b.CURRENT_STATUS is null) |
| | | and b.REQUIRED_COMPLETION_TIME < ( SELECT datetime( 'now' ) ) |
| | | </if> |
| | | <if test="column==5"> |
| | | and b.CURRENT_STATUS = 1 |
| | | AND b.REQUIRED_COMPLETION_TIME <= b.ACTUAL_COMPLETION |
| | | </if> |
| | | <if test="column==6"> |
| | | and b.CURRENT_STATUS = 1 |
| | | AND b.REQUIRED_COMPLETION_TIME > b.ACTUAL_COMPLETION |
| | | </if> |
| | | </select> |
| | | <select id="getIsExit" resultType="java.lang.Long"> |
| | | SELECT id |
| | | FROM dj_jdgz_track_record |
| | | WHERE LEVEL3_NETWORK_ID = ${level3NetworkId} |
| | | AND process_name = #{processName} |
| | | AND is_delete = 0 |
| | | <if test="weekNo!=null"> |
| | | and week_no = ${weekNo} |
| | | </if> |
| | | limit 1 |
| | | </select> |
| | | <select id="getName" resultType="com.example.server.progressTrack.model.DjJdgzTrackRecord"> |
| | | SELECT |
| | | PROCESS_NAME |
| | | FROM |
| | | dj_jdgz_track_record |
| | | WHERE |
| | | is_delete = 0 |
| | | AND LEVEL3_NETWORK_ID = ${level3NetworkId} |
| | | GROUP BY |
| | | PROCESS_NAME |
| | | ORDER BY |
| | | CREATE_DATE ,UPDATE_DATE |
| | | </select> |
| | | <select id="isExistTrackRecord" resultType="com.example.server.progressTrack.model.DjJdgzNetworkLevel3List"> |
| | | select a.*,b.id as trackRecordId |
| | | from dj_jdgz_network_level3_list a |
| | | left join dj_jdgz_track_record b on b.is_delete = 0 and a.id = b.LEVEL3_NODE_ID |
| | | where a.is_delete = 0 |
| | | and a.network_id = ${level3NetworkId} |
| | | and a.sort > ${sort} |
| | | order by a.sort |
| | | limit 1 |
| | | </select> |
| | | <select id="getRecordById" resultType="com.example.server.progressTrack.model.DjJdgzTrackRecord"> |
| | | select GENERAL_REPAIR_UNIT || ',' || GENERAL_REPAIR_UNIT_DIRECTOR || ',' || |
| | | GENERAL_REPAIR_UNIT_CONTACT AS generalRepair, |
| | | REPAIR_UNIT || ',' || REPAIR_UNIT_DIRECTOR || ',' || REPAIR_UNIT_CONTACT AS `repair`, |
| | | track_person || ',' || track_person_unit || ',' || track_person_contact AS trackPerson, |
| | | tracked_person || ',' || tracked_person_unit || ',' || tracked_person_contact AS trackedPerson, |
| | | track_method, |
| | | track_location, |
| | | CURRENT_STATUS, |
| | | has_delay_risk, |
| | | estimated_completion_time, |
| | | problem, |
| | | followup_plan, |
| | | remark, |
| | | process_name |
| | | from dj_jdgz_track_record |
| | | where level3_network_id = ${id} |
| | | and is_delete = 0 |
| | | </select> |
| | | |
| | | </mapper> |