<?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="org.jeecg.modules.eam.mapper.EquipmentChangeDetailMapper">
|
|
|
<select id="getEquipmentChangeDetailList" parameterType="Map" resultType="Map">
|
SELECT
|
t1.id,
|
t1.equipment_change_id as equipmentChangeId,
|
t1.change_type as changeType,
|
t1.change_reason as changeReason,
|
t1.before_depart_id as beforeDepartId,
|
t1.after_depart_id as afterDepartId,
|
t1.before_manager as beforeManager,
|
t1.after_manager as afterManager,
|
t1.before_usage_depart_id as beforeUsageDepartId,
|
t1.after_usage_depart_id as afterUsageDepartId,
|
t1.before_team_id as beforeTeamId,
|
t1.after_team_id as afterTeamId,
|
t1.before_functionary as beforeFunctionary,
|
t1.after_functionary as afterFunctionary,
|
t1.before_location as beforeLocation,
|
t1.after_location as afterLocation,
|
t1.before_equipment_status as beforeEquipmentStatus,
|
t1.after_equipment_status as afterEquipmentStatus,
|
t1.before_technology_status as beforeTechnologyStatus,
|
t1.after_technology_status as afterTechnologyStatus,
|
t1.remark,
|
t1.equipment_id as equipmentId,
|
t2.id AS equipmentId,
|
t2.num as equipmentNum,
|
t2.name as equipmentName,
|
t2.id as equipmentId,
|
t2.model as model,
|
t2.specification as specification,
|
t1.update_by as updateBy,
|
t1.update_time as updateTime
|
|
FROM
|
mom_eam_equipment_change_detail t1
|
LEFT JOIN mom_eam_equipment t2 ON t1.equipment_id = t2.id
|
<if test="equipmentChangeId != null and equipmentChangeId != ''">
|
WHERE t1.del_flag = 0 and t1.equipment_change_id = #{equipmentChangeId}
|
</if>
|
|
ORDER BY t1.create_time desc
|
</select>
|
|
|
<select id="getEquipmentChangeDetailById" parameterType="Map" resultType="Map">
|
SELECT
|
t1.id,
|
t1.equipment_change_id as equipmentChangeId,
|
t1.change_type as changeType,
|
t1.change_reason as changeReason,
|
t1.before_depart_id as beforeDepartId,
|
t1.after_depart_id as afterDepartId,
|
t1.before_manager as beforeManager,
|
t1.after_manager as afterManager,
|
t1.before_usage_depart_id as beforeUsageDepartId,
|
t1.after_usage_depart_id as afterUsageDepartId,
|
t1.before_team_id as beforeTeamId,
|
t1.after_team_id as afterTeamId,
|
t1.before_functionary as beforeFunctionary,
|
t1.after_functionary as afterFunctionary,
|
t1.before_location as beforeLocation,
|
t1.after_location as afterLocation,
|
t1.before_equipment_status as beforeEquipmentStatus,
|
t1.after_equipment_status as afterEquipmentStatus,
|
t1.before_technology_status as beforeTechnologyStatus,
|
t1.after_technology_status as afterTechnologyStatus,
|
t1.remark,
|
t1.equipment_id as equipmentId,
|
t2.id AS equipmentId,
|
t2.num as equipmentNum,
|
t2.name as equipmentName,
|
t2.id as equipmentId,
|
t2.model as model,
|
t2.specification as specification,
|
t1.update_by as updateBy,
|
t1.update_time as updateTime,
|
t3.id AS beforeUsageDepartId,
|
t3.depart_name as beforeUsageDepartName,
|
t4.id AS afterUsageDepartId,
|
t4.depart_name as afterUsageDepartName,
|
t5.id AS beforeManager,
|
t5.realname as beforeManagerName,
|
t6.id AS afterManager,
|
t6.realname as afterManagerName,
|
t7.id AS beforeDepartId,
|
t7.depart_name as beforeDepartName,
|
t8.id AS afterDepartId,
|
t8.depart_name as afterDepartName,
|
t9.id AS beforeFunctionary,
|
t9.realname as beforeFunctionaryName,
|
t10.id AS afterFunctionary,
|
t10.realname as afterFunctionaryName,
|
t11.item_text as afterEquipmentStatusName,
|
t12.item_text as afterTechnologyStatusName,
|
t12.item_text as changeTypeName
|
FROM
|
mom_eam_equipment_change_detail t1
|
LEFT JOIN mom_eam_equipment t2 ON t1.equipment_id = t2.id
|
LEFT JOIN sys_depart t3 ON t1.before_usage_depart_id = t3.id
|
LEFT JOIN sys_depart t4 ON t1.after_usage_depart_id = t4.id
|
LEFT JOIN sys_user t5 ON t1.before_manager = t5.id
|
LEFT JOIN sys_user t6 ON t1.after_manager = t6.id
|
LEFT JOIN sys_depart t7 ON t1.before_depart_id = t7.id
|
LEFT JOIN sys_depart t8 ON t1.after_depart_id = t8.id
|
LEFT JOIN sys_user t9 ON t1.before_functionary = t9.id
|
LEFT JOIN sys_user t10 ON t1.after_functionary = t10.id
|
LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'equipment_status' ) t11 ON t11.item_value = t1.after_equipment_status
|
LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'technology_status' ) t12 ON t12.item_value = t1.after_technology_status
|
LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'change_type' ) t13 ON t13.item_value = t1.change_type
|
WHERE t1.del_flag = 0
|
<if test="params.equipmentChangeId != null and params.equipmentChangeId != ''">
|
and t1.equipment_change_id = #{params.equipmentChangeId}
|
</if>
|
|
ORDER BY t1.create_time desc
|
</select>
|
|
<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.eam.entity.EquipmentChangeDetail">
|
SELECT *
|
FROM mom_eam_equipment_change_detail
|
WHERE
|
equipment_change_id = #{mainId}
|
</select>
|
</mapper>
|