forked from integrated_whb/integrated_whb
516 lines
19 KiB
XML
516 lines
19 KiB
XML
<?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.zcloud.mapper.datasource.eightwork.ConfinedspaceMapper">
|
|
<!--表名 -->
|
|
<sql id="tableName">
|
|
BUS_CONFINEDSPACE
|
|
</sql>
|
|
|
|
<!-- 字段 -->
|
|
<sql id="Field">
|
|
f.CONFINEDSPACE_ID,
|
|
f.CORPINFO_ID,
|
|
f.TASK_ID,
|
|
f.STEP_ID,
|
|
f.ISDELETE,
|
|
f.CREATTIME,
|
|
f.CREATOR,
|
|
f.OPERATTIME,
|
|
f.OPERATOR,
|
|
f.CHECK_NO,
|
|
f.WORK_CONTENT,
|
|
f.APPLY_DEPARTMENT_ID,
|
|
f.APPLY_USER_ID,
|
|
f.WORK_START_DATE,
|
|
f.WORK_END_DATE,
|
|
f.WORK_USER_ID,
|
|
f.SPECIAL_WORK,
|
|
f.RISK_IDENTIFICATION,
|
|
f.ANALYZE_DEPARTMENT_ID,
|
|
f.ANALYZE_USER_ID,
|
|
f.CONFESS_DEPARTMENT_ID,
|
|
f.CONFESS_USER_ID,
|
|
f.ACCEPT_CONFESS_DEPARTMENT_ID,
|
|
f.ACCEPT_CONFESS_USER_ID,
|
|
f.GUARDIAN_DEPARTMENT_ID,
|
|
f.GUARDIAN_USER_ID,
|
|
f.CONFIRM_DEPARTMENT_ID,
|
|
f.CONFIRM_USER_ID,
|
|
f.LEADER_DEPARTMENT_ID,
|
|
f.LEADER_USER_ID,
|
|
f.ACCEPT_DEPARTMENT_ID,
|
|
f.ACCEPT_USER_ID,
|
|
f.ANALYZE_TIME,
|
|
f.WORK_START_DEPARTMENT_ID,
|
|
f.WORK_START_USER_ID,
|
|
f.WORK_END_DEPARTMENT_ID,
|
|
f.WORK_END_USER_ID,
|
|
f.ACCEPT_TIME,
|
|
f.PLS_ID,
|
|
f.PLS_NAME,
|
|
f.MEDIUM_NAME,
|
|
f.LIMITSPACE_ID,
|
|
f.WORK_USER_DEPARTMENT_ID,
|
|
f.WORK_POSITION,
|
|
f.VIDEO_PATH
|
|
</sql>
|
|
|
|
<!-- 字段用于新增 -->
|
|
<sql id="Field2">
|
|
CONFINEDSPACE_ID,
|
|
CORPINFO_ID,
|
|
TASK_ID,
|
|
STEP_ID,
|
|
ISDELETE,
|
|
CREATTIME,
|
|
CREATOR,
|
|
OPERATTIME,
|
|
OPERATOR,
|
|
CHECK_NO,
|
|
WORK_CONTENT,
|
|
APPLY_DEPARTMENT_ID,
|
|
APPLY_USER_ID,
|
|
WORK_START_DATE,
|
|
WORK_END_DATE,
|
|
WORK_USER_ID,
|
|
SPECIAL_WORK,
|
|
RISK_IDENTIFICATION,
|
|
ANALYZE_DEPARTMENT_ID,
|
|
ANALYZE_USER_ID,
|
|
CONFESS_DEPARTMENT_ID,
|
|
CONFESS_USER_ID,
|
|
ACCEPT_CONFESS_DEPARTMENT_ID,
|
|
ACCEPT_CONFESS_USER_ID,
|
|
GUARDIAN_DEPARTMENT_ID,
|
|
GUARDIAN_USER_ID,
|
|
CONFIRM_DEPARTMENT_ID,
|
|
CONFIRM_USER_ID,
|
|
LEADER_DEPARTMENT_ID,
|
|
LEADER_USER_ID,
|
|
ACCEPT_DEPARTMENT_ID,
|
|
ACCEPT_USER_ID,
|
|
ANALYZE_TIME,
|
|
WORK_START_DEPARTMENT_ID,
|
|
WORK_START_USER_ID,
|
|
WORK_END_DEPARTMENT_ID,
|
|
WORK_END_USER_ID,
|
|
ACCEPT_TIME,
|
|
PLS_ID,
|
|
PLS_NAME,
|
|
MEDIUM_NAME,
|
|
LIMITSPACE_ID,
|
|
WORK_USER_DEPARTMENT_ID,
|
|
WORK_POSITION,
|
|
VIDEO_PATH
|
|
</sql>
|
|
|
|
<!-- 字段值 -->
|
|
<sql id="FieldValue">
|
|
#{CONFINEDSPACE_ID},
|
|
#{CORPINFO_ID},
|
|
#{TASK_ID},
|
|
#{STEP_ID},
|
|
#{ISDELETE},
|
|
#{CREATTIME},
|
|
#{CREATOR},
|
|
#{OPERATTIME},
|
|
#{OPERATOR},
|
|
#{CHECK_NO},
|
|
#{WORK_CONTENT},
|
|
#{APPLY_DEPARTMENT_ID},
|
|
#{APPLY_USER_ID},
|
|
#{WORK_START_DATE},
|
|
#{WORK_END_DATE},
|
|
#{WORK_USER_ID},
|
|
#{SPECIAL_WORK},
|
|
#{RISK_IDENTIFICATION},
|
|
#{ANALYZE_DEPARTMENT_ID},
|
|
#{ANALYZE_USER_ID},
|
|
#{CONFESS_DEPARTMENT_ID},
|
|
#{CONFESS_USER_ID},
|
|
#{ACCEPT_CONFESS_DEPARTMENT_ID},
|
|
#{ACCEPT_CONFESS_USER_ID},
|
|
#{GUARDIAN_DEPARTMENT_ID},
|
|
#{GUARDIAN_USER_ID},
|
|
#{CONFIRM_DEPARTMENT_ID},
|
|
#{CONFIRM_USER_ID},
|
|
#{LEADER_DEPARTMENT_ID},
|
|
#{LEADER_USER_ID},
|
|
#{ACCEPT_DEPARTMENT_ID},
|
|
#{ACCEPT_USER_ID},
|
|
#{ANALYZE_TIME},
|
|
#{WORK_START_DEPARTMENT_ID},
|
|
#{WORK_START_USER_ID},
|
|
#{WORK_END_DEPARTMENT_ID},
|
|
#{WORK_END_USER_ID},
|
|
#{ACCEPT_TIME},
|
|
#{PLS_ID},
|
|
#{PLS_NAME},
|
|
#{MEDIUM_NAME},
|
|
#{LIMITSPACE_ID},
|
|
#{WORK_USER_DEPARTMENT_ID},
|
|
#{WORK_POSITION},
|
|
#{VIDEO_PATH}
|
|
</sql>
|
|
|
|
<!-- 获取编码 -->
|
|
<select id="getCode" parameterType="pd" resultType="pd">
|
|
SELECT
|
|
COUNT(1) as code
|
|
FROM <include refid="tableName"></include> f
|
|
WHERE f.CORPINFO_ID = #{CORPINFO_ID}
|
|
and f.CREATTIME LIKE CONCAT(#{CREATDATE},'%')
|
|
</select>
|
|
|
|
<!-- 新增-->
|
|
<insert id="save" parameterType="pd">
|
|
insert into
|
|
<include refid="tableName"></include>
|
|
(
|
|
<include refid="Field2"></include>
|
|
) values (
|
|
<include refid="FieldValue"></include>
|
|
)
|
|
</insert>
|
|
|
|
<!-- 删除-->
|
|
<delete id="delete" parameterType="pd">
|
|
update
|
|
<include refid="tableName"></include>
|
|
set
|
|
ISDELETE = '1'
|
|
where
|
|
CONFINEDSPACE_ID = #{CONFINEDSPACE_ID}
|
|
</delete>
|
|
|
|
<!-- 修改 -->
|
|
<update id="edit" parameterType="pd">
|
|
update
|
|
<include refid="tableName"></include>
|
|
set
|
|
CONFINEDSPACE_ID = #{CONFINEDSPACE_ID},
|
|
CORPINFO_ID = #{CORPINFO_ID},
|
|
TASK_ID = #{TASK_ID},
|
|
OPERATTIME = #{OPERATTIME},
|
|
OPERATOR = #{OPERATOR},
|
|
CHECK_NO = #{CHECK_NO},
|
|
WORK_CONTENT = #{WORK_CONTENT},
|
|
APPLY_DEPARTMENT_ID = #{APPLY_DEPARTMENT_ID},
|
|
APPLY_USER_ID = #{APPLY_USER_ID},
|
|
WORK_START_DATE = #{WORK_START_DATE},
|
|
WORK_END_DATE = #{WORK_END_DATE},
|
|
WORK_USER_ID = #{WORK_USER_ID},
|
|
SPECIAL_WORK = #{SPECIAL_WORK},
|
|
RISK_IDENTIFICATION = #{RISK_IDENTIFICATION},
|
|
ANALYZE_DEPARTMENT_ID = #{ANALYZE_DEPARTMENT_ID},
|
|
ANALYZE_USER_ID = #{ANALYZE_USER_ID},
|
|
CONFESS_DEPARTMENT_ID = #{CONFESS_DEPARTMENT_ID},
|
|
CONFESS_USER_ID = #{CONFESS_USER_ID},
|
|
ACCEPT_CONFESS_DEPARTMENT_ID = #{ACCEPT_CONFESS_DEPARTMENT_ID},
|
|
ACCEPT_CONFESS_USER_ID = #{ACCEPT_CONFESS_USER_ID},
|
|
GUARDIAN_DEPARTMENT_ID = #{GUARDIAN_DEPARTMENT_ID},
|
|
GUARDIAN_USER_ID = #{GUARDIAN_USER_ID},
|
|
CONFIRM_DEPARTMENT_ID = #{CONFIRM_DEPARTMENT_ID},
|
|
CONFIRM_USER_ID = #{CONFIRM_USER_ID},
|
|
LEADER_DEPARTMENT_ID = #{LEADER_DEPARTMENT_ID},
|
|
LEADER_USER_ID = #{LEADER_USER_ID},
|
|
ACCEPT_DEPARTMENT_ID = #{ACCEPT_DEPARTMENT_ID},
|
|
ACCEPT_USER_ID = #{ACCEPT_USER_ID},
|
|
ANALYZE_TIME=#{ANALYZE_TIME},
|
|
WORK_START_DEPARTMENT_ID=#{WORK_START_DEPARTMENT_ID},
|
|
WORK_START_USER_ID=#{WORK_START_USER_ID},
|
|
WORK_END_DEPARTMENT_ID=#{WORK_END_DEPARTMENT_ID},
|
|
WORK_END_USER_ID=#{WORK_END_USER_ID},
|
|
ACCEPT_TIME = #{ACCEPT_TIME},
|
|
PLS_ID = #{PLS_ID},
|
|
PLS_NAME = #{PLS_NAME},
|
|
MEDIUM_NAME = #{MEDIUM_NAME},
|
|
LIMITSPACE_ID = #{LIMITSPACE_ID},
|
|
WORK_USER_DEPARTMENT_ID =#{WORK_USER_DEPARTMENT_ID},
|
|
LONGITUDE =#{LONGITUDE},
|
|
LATITUDE =#{LATITUDE},
|
|
VIDEO_PATH = #{VIDEO_PATH}
|
|
where
|
|
CONFINEDSPACE_ID = #{CONFINEDSPACE_ID}
|
|
</update>
|
|
|
|
<update id="editGasTime" parameterType="pd">
|
|
update
|
|
<include refid="tableName"></include>
|
|
set
|
|
ANALYZE_TIME = #{ANALYZE_TIME}
|
|
where
|
|
CONFINEDSPACE_ID = #{CONFINEDSPACE_ID}
|
|
</update>
|
|
|
|
<select id="findById" parameterType="pd" resultType="pd">
|
|
SELECT
|
|
<include refid="Field"></include>,
|
|
appo.`NAME` as APPLY_DEPARTMENT_NAME,
|
|
appu.`NAME` as APPLY_USER_NAME,
|
|
f.WORK_START_DATE,
|
|
f.WORK_END_DATE,
|
|
f.WORK_USER_ID,
|
|
f.SPECIAL_WORK,
|
|
f.RISK_IDENTIFICATION,
|
|
woro.`NAME` as WORK_USER_DEPARTMENT_NAME,
|
|
woru.`NAME` as WORK_USER_NAME,
|
|
anao.`NAME` as ANALYZE_DEPARTMENT_NAME,
|
|
anau.`NAME` as ANALYZE_USER_NAME,
|
|
cono.`NAME` as CONFESS_DEPARTMENT_NAME,
|
|
conu.`NAME` as CONFESS_USER_NAME,
|
|
acco.`NAME` as ACCEPT_CONFESS_DEPARTMENT_NAME,
|
|
accu.`NAME` as ACCEPT_CONFESS_USER_NAME,
|
|
guao.`NAME` as GUARDIAN_DEPARTMENT_NAME,
|
|
guau.`NAME` as GUARDIAN_USER_NAME,
|
|
confo.`NAME` as CONFIRM_DEPARTMENT_NAME,
|
|
confu.`NAME` as CONFIRM_USER_NAME,
|
|
leao.`NAME` as LEADER_DEPARTMENT_NAME,
|
|
leau.`NAME` as LEADER_USER_NAME,
|
|
acceo.`NAME` as ACCEPT_DEPARTMENT_NAME,
|
|
acceu.`NAME` as ACCEPT_USER_NAME,
|
|
stao.`NAME` as WORK_START_DEPARTMENT_NAME,
|
|
stau.`NAME` as WORK_START_USER_NAME,
|
|
endo.`NAME` as WORK_END_DEPARTMENT_NAME,
|
|
endu.`NAME` as WORK_END_USER_NAME,
|
|
sp.NAME as LIMITSPACE_NAME,
|
|
f.ANALYZE_TIME
|
|
FROM
|
|
bus_confinedspace AS f
|
|
|
|
left join BUS_LIMITSPACE sp on sp.LIMITSPACE_ID=f.LIMITSPACE_ID
|
|
|
|
left join oa_department as woro on f.WORK_USER_DEPARTMENT_ID = woro.DEPARTMENT_ID
|
|
left join sys_user as woru on f.WORK_USER_ID = woru.USER_ID
|
|
|
|
left join oa_department as appo on f.APPLY_DEPARTMENT_ID = appo.DEPARTMENT_ID
|
|
left join sys_user as appu on f.APPLY_USER_ID = appu.USER_ID
|
|
|
|
left join oa_department as anao on f.ANALYZE_DEPARTMENT_ID = anao.DEPARTMENT_ID
|
|
left join sys_user as anau on f.ANALYZE_USER_ID = anau.USER_ID
|
|
|
|
left join oa_department as cono on f.CONFESS_DEPARTMENT_ID = cono.DEPARTMENT_ID
|
|
left join sys_user as conu on f.CONFESS_USER_ID = conu.USER_ID
|
|
|
|
left join oa_department as acco on f.ACCEPT_CONFESS_DEPARTMENT_ID = acco.DEPARTMENT_ID
|
|
left join sys_user as accu on f.ACCEPT_CONFESS_USER_ID = accu.USER_ID
|
|
|
|
left join oa_department as guao on f.GUARDIAN_DEPARTMENT_ID = guao.DEPARTMENT_ID
|
|
left join sys_user as guau on f.GUARDIAN_USER_ID = guau.USER_ID
|
|
|
|
left join oa_department as confo on f.CONFIRM_DEPARTMENT_ID = confo.DEPARTMENT_ID
|
|
left join sys_user as confu on f.CONFIRM_USER_ID = confu.USER_ID
|
|
|
|
left join oa_department as leao on f.LEADER_DEPARTMENT_ID = leao.DEPARTMENT_ID
|
|
left join sys_user as leau on f.LEADER_USER_ID = leau.USER_ID
|
|
|
|
left join oa_department as acceo on f.ACCEPT_DEPARTMENT_ID = acceo.DEPARTMENT_ID
|
|
left join sys_user as acceu on f.ACCEPT_USER_ID = acceu.USER_ID
|
|
|
|
left join oa_department as stao on f.WORK_START_DEPARTMENT_ID = stao.DEPARTMENT_ID
|
|
left join sys_user as stau on f.WORK_START_USER_ID = stau.USER_ID
|
|
|
|
left join oa_department as endo on f.WORK_END_DEPARTMENT_ID = endo.DEPARTMENT_ID
|
|
left join sys_user as endu on f.WORK_END_USER_ID = endu.USER_ID
|
|
|
|
WHERE f.CONFINEDSPACE_ID = #{CONFINEDSPACE_ID}
|
|
</select>
|
|
<update id="editVideo" parameterType="pd">
|
|
update
|
|
<include refid="tableName"></include>
|
|
set
|
|
VIDEO_PATH = #{VIDEO_PATH}
|
|
where
|
|
CONFINEDSPACE_ID = #{CONFINEDSPACE_ID}
|
|
</update>
|
|
<!-- 修改 -->
|
|
<update id="editStep" parameterType="pd">
|
|
update
|
|
<include refid="tableName"></include>
|
|
set
|
|
<if test="WORK_START_DATE != null and WORK_START_DATE != ''"><!-- 关键词检索 -->
|
|
WORK_START_DATE = #{WORK_START_DATE},
|
|
</if>
|
|
<if test="WORK_END_DATE != null and WORK_END_DATE != ''"><!-- 关键词检索 -->
|
|
WORK_END_DATE = #{WORK_END_DATE},
|
|
</if>
|
|
<if test="ACCEPT_TIME != null and ACCEPT_TIME != ''"><!-- 关键词检索 -->
|
|
ACCEPT_TIME = #{ACCEPT_TIME},
|
|
</if>
|
|
STEP_ID = #{STEP_ID}
|
|
where
|
|
CONFINEDSPACE_ID = #{CONFINEDSPACE_ID}
|
|
</update>
|
|
|
|
<!-- 修改位置 -->
|
|
<update id="setPosition" parameterType="pd">
|
|
update
|
|
<include refid="tableName"></include>
|
|
set
|
|
WORK_POSITION = #{WORK_POSITION}
|
|
where
|
|
CONFINEDSPACE_ID = #{CONFINEDSPACE_ID}
|
|
</update>
|
|
|
|
<!-- 列表 -->
|
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
|
select
|
|
<include refid="Field"></include>,
|
|
woro.`NAME` as WORK_USER_DEPARTMENT_NAME,
|
|
woru.`NAME` as WORK_USER_NAME,
|
|
appo.`NAME` as APPLY_DEPARTMENT_NAME,
|
|
appu.`NAME` as APPLY_USER_NAME,
|
|
anao.`NAME` as ANALYZE_DEPARTMENT_NAME,
|
|
anau.`NAME` as ANALYZE_USER_NAME,
|
|
cono.`NAME` as CONFESS_DEPARTMENT_NAME,
|
|
conu.`NAME` as CONFESS_USER_NAME,
|
|
acco.`NAME` as ACCEPT_CONFESS_DEPARTMENT_NAME,
|
|
accu.`NAME` as ACCEPT_CONFESS_USER_NAME,
|
|
guao.`NAME` as GUARDIAN_DEPARTMENT_NAME,
|
|
guau.`NAME` as GUARDIAN_USER_NAME,
|
|
confo.`NAME` as CONFIRM_DEPARTMENT_NAME,
|
|
confu.`NAME` as CONFIRM_USER_NAME,
|
|
leao.`NAME` as LEADER_DEPARTMENT_NAME,
|
|
leau.`NAME` as LEADER_USER_NAME,
|
|
acceo.`NAME` as ACCEPT_DEPARTMENT_NAME,
|
|
acceu.`NAME` as ACCEPT_USER_NAME,
|
|
stao.`NAME` as WORK_START_DEPARTMENT_NAME,
|
|
stau.`NAME` as WORK_START_USER_NAME,
|
|
endo.`NAME` as WORK_END_DEPARTMENT_NAME,
|
|
endu.`NAME` as WORK_END_USER_NAME,
|
|
log.STEP_NAME,
|
|
log.NEXT_STEP_ID,
|
|
log.NEXT_STEP_NAME,
|
|
log.STATUS
|
|
from
|
|
<include refid="tableName"></include> f
|
|
left join oa_department as woro on f.APPLY_DEPARTMENT_ID = woro.DEPARTMENT_ID
|
|
left join sys_user as woru on f.APPLY_USER_ID = woru.USER_ID
|
|
|
|
left join oa_department as appo on f.APPLY_DEPARTMENT_ID = appo.DEPARTMENT_ID
|
|
left join sys_user as appu on f.APPLY_USER_ID = appu.USER_ID
|
|
|
|
left join oa_department as anao on f.ANALYZE_DEPARTMENT_ID = anao.DEPARTMENT_ID
|
|
left join sys_user as anau on f.ANALYZE_USER_ID = anau.USER_ID
|
|
|
|
left join oa_department as cono on f.CONFESS_DEPARTMENT_ID = cono.DEPARTMENT_ID
|
|
left join sys_user as conu on f.CONFESS_USER_ID = conu.USER_ID
|
|
|
|
left join oa_department as acco on f.ACCEPT_CONFESS_DEPARTMENT_ID = acco.DEPARTMENT_ID
|
|
left join sys_user as accu on f.ACCEPT_CONFESS_USER_ID = accu.USER_ID
|
|
|
|
left join oa_department as guao on f.GUARDIAN_DEPARTMENT_ID = guao.DEPARTMENT_ID
|
|
left join sys_user as guau on f.GUARDIAN_USER_ID = guau.USER_ID
|
|
|
|
left join oa_department as confo on f.CONFIRM_DEPARTMENT_ID = confo.DEPARTMENT_ID
|
|
left join sys_user as confu on f.CONFIRM_USER_ID = confu.USER_ID
|
|
|
|
left join oa_department as leao on f.LEADER_DEPARTMENT_ID = leao.DEPARTMENT_ID
|
|
left join sys_user as leau on f.LEADER_USER_ID = leau.USER_ID
|
|
|
|
left join oa_department as acceo on f.ACCEPT_DEPARTMENT_ID = acceo.DEPARTMENT_ID
|
|
left join sys_user as acceu on f.ACCEPT_USER_ID = acceu.USER_ID
|
|
|
|
left join oa_department as stao on f.WORK_START_DEPARTMENT_ID = stao.DEPARTMENT_ID
|
|
left join sys_user as stau on f.WORK_START_USER_ID = stau.USER_ID
|
|
|
|
left join oa_department as endo on f.WORK_END_DEPARTMENT_ID = endo.DEPARTMENT_ID
|
|
left join sys_user as endu on f.WORK_END_USER_ID = endu.USER_ID
|
|
|
|
left join (select * from(select * from vi_eightwork_flow_log log having 1 order by log.ACT_TIME desc
|
|
) tmp group by tmp.WORK_ID) log on log.WORK_ID = f.CONFINEDSPACE_ID
|
|
where f.ISDELETE = '0'
|
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
|
and f.CHECK_NO LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
|
</if>
|
|
<if test="pd.STEP_NAME != null and pd.STEP_NAME != ''"><!-- 关键词检索 -->
|
|
and exists (
|
|
select 1 from bus_confinedspace_sign sign
|
|
left join bus_eightwork_step step on step.STEP_ID = sign.STEP_ID
|
|
where sign.CONFINEDSPACE_ID = f.CONFINEDSPACE_ID
|
|
and sign.SIGN_TIME is null
|
|
and sign.SIGN_USER_ID = #{pd.USER_ID}
|
|
and step.STEP_NAME = #{pd.STEP_NAME}
|
|
and f.STEP_ID != -1
|
|
)
|
|
</if>
|
|
<if test="pd.STEP_ID != null and pd.STEP_ID != ''"><!-- 关键词检索 -->
|
|
and log.NEXT_STEP_ID = #{pd.STEP_ID} and f.STEP_ID != -1
|
|
</if>
|
|
<if test="pd.CREATOR != null and pd.CREATOR != ''"><!-- 关键词检索 -->
|
|
and f.CREATOR = #{pd.CREATOR}
|
|
</if>
|
|
<if test="pd.GASCHECK != null and pd.GASCHECK != ''"><!-- 关键词检索 -->
|
|
and f.STEP_ID > 0 and f.STEP_ID != 15 and f.ANALYZE_USER_ID = #{pd.GASCHECK}
|
|
</if>
|
|
order by f.STEP_ID,f.CREATTIME desc
|
|
</select>
|
|
|
|
<select id="checkWorkCount" parameterType="pd" resultType="pd" >
|
|
select
|
|
step.CODE,count(1) COUNT
|
|
from
|
|
bus_confinedspace_sign sign
|
|
left join bus_eightwork_step step on step.STEP_ID = sign.STEP_ID
|
|
left join bus_confinedspace work on work.CONFINEDSPACE_ID = sign.CONFINEDSPACE_ID
|
|
where
|
|
sign.SIGN_TIME is null
|
|
and work.STEP_ID != '-1'
|
|
and
|
|
sign.SIGN_USER_ID = #{USER_ID}
|
|
group by step.CODE
|
|
</select>
|
|
|
|
<select id="listAllMeasures" resultType="pd">
|
|
select
|
|
*
|
|
from
|
|
BUS_CONFINEDSPACE_MEASURES
|
|
</select>
|
|
|
|
<select id="getFlowList" resultType="pd">
|
|
select
|
|
flow.CAN_SKIP,
|
|
flow.ACTOR_FIELD,
|
|
step.STEP_NAME,
|
|
user.NAME as ACT_USER_NAME,
|
|
log.ACT_TIME,
|
|
log.STATUS,
|
|
cu.SIGN_USER,
|
|
cu.FINISHED_SIGN_USER,
|
|
cu.STEP_ID as CURRENT_STEP
|
|
from
|
|
bus_eightwork_task_flow flow
|
|
left join bus_eightwork_step step on step.STEP_ID = flow.STEP_ID
|
|
left join bus_eightwork_flow_log log on log.STEP_ID = flow.STEP_ID and
|
|
log.WORK_ID = #{CONFINEDSPACE_ID}
|
|
left join sys_user user on user.USER_ID = log.ACT_USER
|
|
left join (select sign.STEP_ID,
|
|
GROUP_CONCAT( if(sign.SIGN_TIME IS NULL,signer.NAME,null) ) sign_user,
|
|
GROUP_CONCAT( if(sign.SIGN_TIME IS not NULL,signer.NAME,null) ) finished_sign_user
|
|
from bus_confinedspace_sign sign
|
|
left join sys_user signer on signer.USER_ID = sign.SIGN_USER_ID where sign.CONFINEDSPACE_ID = #{CONFINEDSPACE_ID}
|
|
GROUP BY sign.STEP_ID) cu on cu.STEP_ID = step.STEP_ID
|
|
where
|
|
flow.TASK_ID = #{TASK_ID}
|
|
and
|
|
flow.STEP_ID != 0
|
|
order by
|
|
flow.ORDER_BY
|
|
</select>
|
|
|
|
<select id="getMapList" resultType="pd">
|
|
select
|
|
f.CONFINEDSPACE_ID,
|
|
f.CHECK_NO,
|
|
f.WORK_POSITION
|
|
from
|
|
<include refid="tableName"></include> f
|
|
left join (select * from(select * from vi_eightwork_flow_log log having 1 order by log.ACT_TIME desc
|
|
) tmp group by tmp.WORK_ID) log on log.WORK_ID = f.CONFINEDSPACE_ID
|
|
where f.ISDELETE = '0' and f.WORK_POSITION is not null
|
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
|
and f.STEP_ID > 0 and log.NEXT_STEP_ID != 99
|
|
</select>
|
|
</mapper>
|