|
|
|
@ -5,57 +5,89 @@
|
|
|
|
|
<mapper namespace="com.op.device.mapper.EquOperationMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="EquOperation" id="EquOperationResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="workshop" column="workshop" />
|
|
|
|
|
<result property="groupLine" column="group_Line" />
|
|
|
|
|
<result property="equipmentName" column="equipment_name" />
|
|
|
|
|
<result property="equipmentCode" column="equipment_code" />
|
|
|
|
|
<result property="faultTime" column="fault_time" />
|
|
|
|
|
<result property="actualOperationTime" column="actual_operation_time" />
|
|
|
|
|
<result property="operationTime" column="operation_time" />
|
|
|
|
|
<result property="failureRate" column="failure_rate" />
|
|
|
|
|
<result property="failureDescription" column="failure_description" />
|
|
|
|
|
<result property="reasonAnalyze" column="reason_analyze" />
|
|
|
|
|
<result property="handlingMethod" column="handling_method" />
|
|
|
|
|
<result property="repairPerson" column="repair_person" />
|
|
|
|
|
<result property="equStatusDes" column="equ_status_des" />
|
|
|
|
|
<result property="replaceSpare" column="replace_spare" />
|
|
|
|
|
<result property="factoryCode" column="factory_code" />
|
|
|
|
|
<result property="attr1" column="attr1" />
|
|
|
|
|
<result property="attr2" column="attr2" />
|
|
|
|
|
<result property="attr3" column="attr3" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
|
<result property="workshop" column="workshop"/>
|
|
|
|
|
<result property="groupLine" column="group_line"/>
|
|
|
|
|
<result property="equipmentName" column="equipment_name"/>
|
|
|
|
|
<result property="equipmentCode" column="equipment_code"/>
|
|
|
|
|
<result property="faultTime" column="fault_time"/>
|
|
|
|
|
<result property="actualOperationTime" column="actual_operation_time"/>
|
|
|
|
|
<result property="operationTime" column="operation_time"/>
|
|
|
|
|
<result property="failureRate" column="failure_rate"/>
|
|
|
|
|
<result property="failureDescription" column="failure_description"/>
|
|
|
|
|
<result property="reasonAnalyze" column="reason_analyze"/>
|
|
|
|
|
<result property="handlingMethod" column="handling_method"/>
|
|
|
|
|
<result property="repairPerson" column="repair_person"/>
|
|
|
|
|
<result property="equStatusDes" column="equ_status_des"/>
|
|
|
|
|
<result property="replaceSpare" column="replace_spare"/>
|
|
|
|
|
<result property="factoryCode" column="factory_code"/>
|
|
|
|
|
<result property="attr1" column="attr1"/>
|
|
|
|
|
<result property="attr2" column="attr2"/>
|
|
|
|
|
<result property="attr3" column="attr3"/>
|
|
|
|
|
<result property="delFlag" column="del_flag"/>
|
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectEquOperationVo">
|
|
|
|
|
select id, workshop, group_Line, equipment_name, equipment_code, fault_time, actual_operation_time, operation_time, failure_rate, failure_description, reason_analyze, handling_method, repair_person, equ_status_des, replace_spare, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_operation
|
|
|
|
|
select id,
|
|
|
|
|
workshop,
|
|
|
|
|
group_line,
|
|
|
|
|
equipment_name,
|
|
|
|
|
equipment_code,
|
|
|
|
|
fault_time,
|
|
|
|
|
actual_operation_time,
|
|
|
|
|
operation_time,
|
|
|
|
|
failure_rate,
|
|
|
|
|
failure_description,
|
|
|
|
|
reason_analyze,
|
|
|
|
|
handling_method,
|
|
|
|
|
repair_person,
|
|
|
|
|
equ_status_des,
|
|
|
|
|
replace_spare,
|
|
|
|
|
factory_code,
|
|
|
|
|
attr1,
|
|
|
|
|
attr2,
|
|
|
|
|
attr3,
|
|
|
|
|
del_flag,
|
|
|
|
|
create_by,
|
|
|
|
|
create_time,
|
|
|
|
|
update_by,
|
|
|
|
|
update_time
|
|
|
|
|
from equ_operation
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectEquOperationList" parameterType="EquOperation" resultMap="EquOperationResult">
|
|
|
|
|
<include refid="selectEquOperationVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="workshop != null and workshop != ''"> and workshop = #{workshop}</if>
|
|
|
|
|
<if test="groupLine != null and groupLine != ''"> and group_Line = #{groupLine}</if>
|
|
|
|
|
<if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
|
|
|
|
|
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
|
|
|
|
|
<if test="faultTime != null and faultTime != ''"> and fault_time = #{faultTime}</if>
|
|
|
|
|
<if test="actualOperationTime != null and actualOperationTime != ''"> and actual_operation_time = #{actualOperationTime}</if>
|
|
|
|
|
<if test="operationTime != null and operationTime != ''"> and operation_time = #{operationTime}</if>
|
|
|
|
|
<if test="failureRate != null and failureRate != ''"> and failure_rate = #{failureRate}</if>
|
|
|
|
|
<if test="failureDescription != null and failureDescription != ''"> and failure_description = #{failureDescription}</if>
|
|
|
|
|
<if test="reasonAnalyze != null and reasonAnalyze != ''"> and reason_analyze = #{reasonAnalyze}</if>
|
|
|
|
|
<if test="handlingMethod != null and handlingMethod != ''"> and handling_method = #{handlingMethod}</if>
|
|
|
|
|
<if test="repairPerson != null and repairPerson != ''"> and repair_person = #{repairPerson}</if>
|
|
|
|
|
<if test="equStatusDes != null and equStatusDes != ''"> and equ_status_des = #{equStatusDes}</if>
|
|
|
|
|
<if test="replaceSpare != null and replaceSpare != ''"> and replace_spare = #{replaceSpare}</if>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
|
|
|
|
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
|
|
|
|
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
|
|
|
|
|
<if test="workshop != null and workshop != ''">and workshop like concat('%', #{workshop}, '%')</if>
|
|
|
|
|
<if test="groupLine != null and groupLine != ''">and group_line like concat('%', #{groupLine}, '%')</if>
|
|
|
|
|
<if test="equipmentName != null and equipmentName != ''">and equipment_name like concat('%',
|
|
|
|
|
#{equipmentName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="equipmentCode != null and equipmentCode != ''">and equipment_code like concat('%', #{equipmentCode}, '%')</if>
|
|
|
|
|
<if test="faultTime != null and faultTime != ''">and fault_time = #{faultTime}</if>
|
|
|
|
|
<if test="actualOperationTime != null and actualOperationTime != ''">and actual_operation_time =
|
|
|
|
|
#{actualOperationTime}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="operationTime != null and operationTime != ''">and operation_time = #{operationTime}</if>
|
|
|
|
|
<if test="failureRate != null and failureRate != ''">and failure_rate = #{failureRate}</if>
|
|
|
|
|
<if test="failureDescription != null and failureDescription != ''">and failure_description =
|
|
|
|
|
#{failureDescription}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="reasonAnalyze != null and reasonAnalyze != ''">and reason_analyze = #{reasonAnalyze}</if>
|
|
|
|
|
<if test="handlingMethod != null and handlingMethod != ''">and handling_method = #{handlingMethod}</if>
|
|
|
|
|
<if test="repairPerson != null and repairPerson != ''">and repair_person concat('%', #{repairPerson}, '%')</if>
|
|
|
|
|
<if test="equStatusDes != null and equStatusDes != ''">and equ_status_des = #{equStatusDes}</if>
|
|
|
|
|
<if test="replaceSpare != null and replaceSpare != ''">and replace_spare = #{replaceSpare}</if>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
|
|
|
|
|
<if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if>
|
|
|
|
|
<if test="attr3 != null and attr3 != ''">and attr3 = #{attr3}</if>
|
|
|
|
|
<if test="createTimeStart != null "> and CONVERT(date,create_time) >= #{createTimeStart}</if>
|
|
|
|
|
<if test="createTimeEnd != null "> and #{createTimeEnd} >= CONVERT(date,create_time)</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -64,12 +96,35 @@
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectEquipmentOperationTime" resultType="java.lang.String">
|
|
|
|
|
select top 1 da.dict_value
|
|
|
|
|
from sys_dict_data da
|
|
|
|
|
where dict_type = 'device_operation_time'
|
|
|
|
|
order by dict_sort
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectEquipments" resultType="com.op.device.domain.EquOperation">
|
|
|
|
|
select be.equipment_code AS 'equipmentCode',be.equipment_name AS 'equipmentName',zx.equipment_name AS 'groupLine',be.workshop_name AS 'workshop'
|
|
|
|
|
from base_equipment be
|
|
|
|
|
left join equ_bind_auxiliary_equipment bae
|
|
|
|
|
on bae.auxiliary_equipment_code = be.equipment_code
|
|
|
|
|
left join base_equipment zx
|
|
|
|
|
on bae.equipment_code = zx.equipment_code
|
|
|
|
|
where be.del_flag = '0' and be.equipment_category = '0'
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="checkInsertOperation" resultType="java.lang.Integer">
|
|
|
|
|
select count(id)
|
|
|
|
|
from equ_operation
|
|
|
|
|
where CONVERT(date, create_time) = CONVERT(date, GETDATE())
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertEquOperation" parameterType="EquOperation">
|
|
|
|
|
insert into equ_operation
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">id,</if>
|
|
|
|
|
<if test="workshop != null">workshop,</if>
|
|
|
|
|
<if test="groupLine != null">group_Line,</if>
|
|
|
|
|
<if test="groupLine != null">group_line,</if>
|
|
|
|
|
<if test="equipmentName != null">equipment_name,</if>
|
|
|
|
|
<if test="equipmentCode != null">equipment_code,</if>
|
|
|
|
|
<if test="faultTime != null">fault_time,</if>
|
|
|
|
@ -120,11 +175,24 @@
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertEquOperationByBatch">
|
|
|
|
|
insert into equ_operation
|
|
|
|
|
(
|
|
|
|
|
id,workshop,group_line,equipment_name,equipment_code,actual_operation_time,operation_time,factory_code,create_by,create_time
|
|
|
|
|
)
|
|
|
|
|
values
|
|
|
|
|
<foreach collection="list" index="index" item="item" separator=",">
|
|
|
|
|
(
|
|
|
|
|
#{item.id},#{item.workshop},#{item.groupLine},#{item.equipmentName},#{item.equipmentCode},#{item.actualOperationTime},#{item.operationTime},#{item.factoryCode},#{item.createBy},#{item.createTime}
|
|
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateEquOperation" parameterType="EquOperation">
|
|
|
|
|
update equ_operation
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="workshop != null">workshop = #{workshop},</if>
|
|
|
|
|
<if test="groupLine != null">group_Line = #{groupLine},</if>
|
|
|
|
|
<if test="groupLine != null">group_line = #{groupLine},</if>
|
|
|
|
|
<if test="equipmentName != null">equipment_name = #{equipmentName},</if>
|
|
|
|
|
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
|
|
|
|
|
<if test="faultTime != null">fault_time = #{faultTime},</if>
|
|
|
|
@ -151,7 +219,9 @@
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEquOperationById" parameterType="String">
|
|
|
|
|
delete from equ_operation where id = #{id}
|
|
|
|
|
delete
|
|
|
|
|
from equ_operation
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEquOperationByIds" parameterType="String">
|
|
|
|
|