2025-01-16 16:16:53 +08:00
|
|
|
<?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.bonus.project.mapper.EquipMapper">
|
|
|
|
|
<insert id="addEquip">
|
|
|
|
|
insert into pt_pro_tools
|
|
|
|
|
(pro_id, cont_uuid,uuid, tools_name, tools_model, tools_unit, tools_num, tools_type, detection_time,
|
|
|
|
|
next_detection_time, is_detection,admission_date, status, is_active)
|
|
|
|
|
values
|
|
|
|
|
(#{proId}, #{consUuid},#{uuid},#{equipName}, #{model}, #{unit}, #{num}, #{equipType},#{detectionTime},
|
|
|
|
|
#{nextDetectionTime}, #{isForceDetection}, #{approachDate},'0' , '1')
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addConsInformation">
|
|
|
|
|
insert into pt_cons_information(pro_id, uuid, from_type, information_type, information_path, information_name, information_size, information_user_id, information_user_name, is_active)
|
|
|
|
|
values
|
|
|
|
|
(#{proId}, #{uuid}, #{fromType}, #{informationType}, #{filePath}, #{fileName}, #{fileSize},
|
|
|
|
|
#{createUserId}, #{createUser}, '1')
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="updateEquip">
|
|
|
|
|
update pt_pro_tools
|
|
|
|
|
set
|
|
|
|
|
tools_name = #{equipName},
|
|
|
|
|
tools_model = #{model},
|
|
|
|
|
tools_unit = #{unit},
|
|
|
|
|
tools_num =#{num},
|
|
|
|
|
tools_type = #{equipType},
|
|
|
|
|
detection_time = #{detectionTime},
|
|
|
|
|
next_detection_time = #{nextDetectionTime},
|
|
|
|
|
is_detection = #{isForceDetection},
|
|
|
|
|
admission_date = #{approachDate},
|
|
|
|
|
status = '0'
|
|
|
|
|
where uuid = #{uuid}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="delEquip">
|
|
|
|
|
update pt_pro_tools
|
|
|
|
|
set is_active = '0'
|
|
|
|
|
where tools_id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
<select id="selectEquipList" resultType="com.bonus.project.domain.Equipment">
|
|
|
|
|
select
|
|
|
|
|
ppt.tools_id as id,
|
|
|
|
|
ppt.pro_id as proId,
|
|
|
|
|
ppt.cont_uuid as conSuuid,
|
|
|
|
|
ppt.task_id as taskId,
|
|
|
|
|
ppt.proc_inst_id as procInsId,
|
|
|
|
|
ppt.uuid as uuid,
|
|
|
|
|
ppt.tools_name as equipName,
|
|
|
|
|
ppt.tools_model as model,
|
|
|
|
|
ppt.tools_unit as unit,
|
|
|
|
|
ppt.tools_num as num,
|
|
|
|
|
sdd1.dict_label as equipType,
|
|
|
|
|
ppt.detection_time as detectionTime,
|
|
|
|
|
ppt.next_detection_time as nextDetectionTime,
|
|
|
|
|
if(ppt.is_detection = '1','是','否') as isForceDetection,
|
|
|
|
|
ppt.create_time as createTime,
|
|
|
|
|
ppt.admission_date as admissionDate,
|
|
|
|
|
ppt.departure_date as departureDate,
|
|
|
|
|
ppt.status as intoStatus,
|
|
|
|
|
'0' as status,
|
|
|
|
|
group_concat(pci.information_path) as filePath
|
|
|
|
|
from pt_pro_tools ppt
|
|
|
|
|
left join sys_dict_data sdd1 on sdd1.dict_value = ppt.tools_type and sdd1.dict_type = 'sys_tools_type' and
|
|
|
|
|
sdd1.status = '0'
|
|
|
|
|
left join sys_dict_data sdd on sdd.dict_value = ppt.status and sdd.dict_type = 'sys_approval_state' and
|
|
|
|
|
sdd.status = '0'
|
|
|
|
|
left join pt_cons_information pci on pci.uuid = ppt.uuid and pci.from_type = '4' and pci.information_type = '4'
|
|
|
|
|
and pci.is_active = '1'
|
|
|
|
|
where ppt.is_active = '1'
|
|
|
|
|
<if test="proId != null and proId != ''">
|
|
|
|
|
and ppt.pro_id = #{proId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="consUuid != null and consUuid != ''">
|
|
|
|
|
and ppt.cont_uuid = #{consUuid}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="type == '列表'">
|
|
|
|
|
and ppt.status = '3'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="equipName != null and equipName != ''">
|
|
|
|
|
and ppt.tools_name like concat('%', #{equipName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status != null and status != '' and status != 1 and status != '1' and status != '2' and status != 2 ">
|
|
|
|
|
and ppt.status = #{status}
|
|
|
|
|
</if>
|
|
|
|
|
group by ppt.tools_id
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getInfo" resultType="com.bonus.project.domain.Equipment">
|
|
|
|
|
select
|
|
|
|
|
ppt.tools_id as id,
|
|
|
|
|
ppt.pro_id as proId,
|
|
|
|
|
ppt.cont_uuid as consUuid,
|
|
|
|
|
ppt.task_id as taskId,
|
|
|
|
|
ppt.uuid as uuid,
|
|
|
|
|
ppt.tools_name as equipName,
|
|
|
|
|
ppt.tools_model as model,
|
|
|
|
|
ppt.tools_unit as unit,
|
|
|
|
|
ppt.tools_num as num,
|
|
|
|
|
ppt.tools_type as equipType,
|
|
|
|
|
ppt.detection_time as detectionTime,
|
|
|
|
|
ppt.next_detection_time as nextDetectionTime,
|
|
|
|
|
ppt.is_detection as isForceDetection,
|
|
|
|
|
ppt.create_time as createTime,
|
|
|
|
|
ppt.admission_date as admissionDate,
|
|
|
|
|
ppt.departure_date as departureDate
|
|
|
|
|
from pt_pro_tools ppt
|
|
|
|
|
where ppt.uuid = #{uuid}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getEquipFileList" resultType="com.bonus.common.entity.SysFileInfo">
|
|
|
|
|
select
|
|
|
|
|
pci.information_id as id,
|
|
|
|
|
pci.information_path as filePath,
|
|
|
|
|
pci.information_name as fileName,
|
|
|
|
|
pci.information_path as url,
|
|
|
|
|
pci.information_name as name,
|
|
|
|
|
pci.information_size as fileSize,
|
|
|
|
|
pci.information_user_id as createUserId,
|
|
|
|
|
pci.information_user_name as createUser,
|
|
|
|
|
pci.create_time as createTime
|
|
|
|
|
from pt_cons_information pci
|
|
|
|
|
where pci.uuid = #{uuid} and pci.from_type = '4' and pci.information_type = '4' and pci.is_active = '1'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getEquipList" resultType="com.bonus.project.domain.Equipment">
|
|
|
|
|
select
|
|
|
|
|
ppt.tools_id as id,
|
|
|
|
|
ppt.pro_id as proId,
|
|
|
|
|
ppt.cont_uuid as consUuid,
|
|
|
|
|
ppt.uuid as uuid,
|
|
|
|
|
ppt.tools_name as equipName,
|
|
|
|
|
ppt.tools_model as model,
|
|
|
|
|
ppt.tools_unit as unit,
|
|
|
|
|
ppt.tools_num as num,
|
|
|
|
|
sdd.dict_label as equipType,
|
|
|
|
|
ppt.detection_time as detectionTime,
|
|
|
|
|
ppt.next_detection_time as nextDetectionTime,
|
|
|
|
|
ppt.is_detection as isForceDetection,
|
|
|
|
|
ppt.create_time as createTime
|
|
|
|
|
from pt_pro_tools ppt
|
|
|
|
|
left join sys_dict_data sdd on sdd.dict_value = ppt.tools_type and sdd.dict_type = 'sys_tools_type' and sdd.status = '0'
|
|
|
|
|
where ppt.is_active = '1'
|
|
|
|
|
<if test="proId != null and proId != ''">
|
|
|
|
|
and ppt.pro_id = #{proId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="consUuid != null and consUuid != ''">
|
|
|
|
|
and ppt.cont_uuid = #{consUuid}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="equipName != null and equipName != ''">
|
|
|
|
|
and ppt.tools_name = #{equipName}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="entryOfUtensilsList" resultType="com.bonus.project.domain.Equipment">
|
|
|
|
|
select
|
|
|
|
|
ppt.tools_id as id,
|
|
|
|
|
ppt.pro_id as proId,
|
|
|
|
|
ppi.pro_name as proName,
|
|
|
|
|
ppt.cont_uuid as consUuid,
|
|
|
|
|
pci2.cont_name as consName,
|
|
|
|
|
ppt.task_id as taskId,
|
|
|
|
|
ppt.proc_inst_id as procInsId,
|
|
|
|
|
ppt.uuid as uuid,
|
|
|
|
|
ppt.tools_name as equipName,
|
|
|
|
|
ppt.tools_model as model,
|
|
|
|
|
ppt.tools_unit as unit,
|
|
|
|
|
ppt.tools_num as num,
|
|
|
|
|
if(ppt.tools_type = '1', '普通设备', '特殊设备') as equipType,
|
|
|
|
|
ppt.detection_time as detectionTime,
|
|
|
|
|
ppt.next_detection_time as nextDetectionTime,
|
|
|
|
|
if(ppt.is_detection = '1', '是', '否') as isForceDetection,
|
|
|
|
|
ppt.create_time as createTime,
|
|
|
|
|
ppt.admission_date as admissionDate,
|
|
|
|
|
ppt.departure_date as departureDate,
|
|
|
|
|
ppt.status as intoStatus,
|
2025-02-14 16:55:56 +08:00
|
|
|
#{dataType} as status,
|
2025-01-16 16:16:53 +08:00
|
|
|
group_concat(pci.information_path) as filePath
|
|
|
|
|
from pt_pro_tools ppt
|
|
|
|
|
left join sys_dict_data sdd on sdd.dict_value = ppt.status and sdd.dict_type = 'sys_approval_state' and
|
|
|
|
|
sdd.status = '0'
|
|
|
|
|
left join pt_cons_information pci on pci.uuid = ppt.uuid and pci.from_type = '4' and pci.information_type = '4'
|
|
|
|
|
and pci.is_active = '1'
|
|
|
|
|
left join pt_project_info ppi on ppi.pro_id = ppt.pro_id and ppi.is_active = '1'
|
|
|
|
|
left join pt_cont_info pci2 on pci2.uuid = ppt.cont_uuid and pci2.is_active = '1'
|
|
|
|
|
where ppt.is_active = '1'
|
|
|
|
|
<if test="userType == 01 and userType == '01'">
|
|
|
|
|
and ppt.pro_id = #{proId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="proName != null and proName != ''">
|
|
|
|
|
and ppt.pro_id = #{proName}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="consName != null and consName != ''">
|
|
|
|
|
and and ppt.cont_uuid = #{consName}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="keyWord != null and keyWord != ''">
|
|
|
|
|
and ppt.tools_name like concat('%', #{keyWord}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status != null and status != '' and status != 1 and status != '1' and status != '2' and status != 2 ">
|
|
|
|
|
and ppt.status = #{status}
|
|
|
|
|
</if>
|
2025-02-14 16:55:56 +08:00
|
|
|
<if test="status==2 or status=='2'">
|
|
|
|
|
and ppt.status = #{status}
|
|
|
|
|
</if>
|
|
|
|
|
<if test='dataType==1'>
|
|
|
|
|
AND ppt.proc_inst_id IN (
|
|
|
|
|
<foreach collection="proInsId" item="item" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
2025-01-16 16:16:53 +08:00
|
|
|
group by ppt.tools_id
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|
|