| | |
| | | <!--分页查询--> |
| | | <select id="pageList" resultType="org.jeecg.modules.mdc.dto.MdcProcessQuantityDto"> |
| | | SELECT |
| | | mpq.id id, |
| | | mspd.equipment_id equipmentId, |
| | | mspd.equipment_name equipmentName, |
| | | mspd.parts_code partsCode, |
| | | mspd.batch_code batchCode, |
| | | mspd.sequence_number sequenceNumber, |
| | | mpq.standard_id standardId, |
| | | mpq.efficient_date efficientDate, |
| | | mpq.process_quantity processQuantity, |
| | | mspd.duration duration, |
| | | mpq.remark remark, |
| | | mpq.create_by createBy, |
| | | mpq.create_time createTime, |
| | | mpq.update_by updateBy, |
| | | mpq.update_time updateTime |
| | | FROM mdc_process_quantity mpq LEFT JOIN mdc_standard_process_duration mspd ON mpq.standard_id = mspd.id |
| | | t1.id id, |
| | | t3.equipment_id equipmentId, |
| | | t3.equipment_name equipmentName, |
| | | t2.parts_code partsCode, |
| | | t2.batch_code batchCode, |
| | | t2.sequence_number sequenceNumber, |
| | | t1.standard_id standardId, |
| | | t1.efficient_date efficientDate, |
| | | t1.process_quantity processQuantity, |
| | | t2.duration duration, |
| | | t1.remark remark, |
| | | t1.create_by createBy, |
| | | t1.create_time createTime, |
| | | t1.update_by updateBy, |
| | | t1.update_time updateTime |
| | | FROM |
| | | mdc_process_quantity t1 |
| | | LEFT JOIN mdc_standard_process_duration t2 ON t1.standard_id = t2.id |
| | | LEFT JOIN mdc_equipment t3 ON t1.equipment_id = t3.equipment_id |
| | | <where> |
| | | <if test="mdcProcessQuantity.equipmentId != null and mdcProcessQuantity.equipmentId != ''"> |
| | | AND mspd.equipment_id LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentId }),'%') |
| | | AND t3.equipment_id LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentId }),'%') |
| | | </if> |
| | | <if test="mdcProcessQuantity.equipmentName != null and mdcProcessQuantity.equipmentName != ''"> |
| | | AND mspd.equipment_name LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentName }),'%') |
| | | AND t3.equipment_name LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentName }),'%') |
| | | </if> |
| | | <if test="mdcProcessQuantity.partsCode != null and mdcProcessQuantity.partsCode != ''"> |
| | | AND mspd.parts_code LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.partsCode }),'%') |
| | | AND t2.parts_code LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.partsCode }),'%') |
| | | </if> |
| | | <if test="mdcProcessQuantity.batchCode != null and mdcProcessQuantity.batchCode != ''"> |
| | | AND mspd.batch_code LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.batchCode }),'%') |
| | | AND t2.batch_code LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.batchCode }),'%') |
| | | </if> |
| | | <if test="mdcProcessQuantity.sequenceNumber != null and mdcProcessQuantity.sequenceNumber != ''"> |
| | | AND mspd.sequence_number LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.sequenceNumber }),'%') |
| | | AND t2.sequence_number LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.sequenceNumber }),'%') |
| | | </if> |
| | | <if test="mdcProcessQuantity.startTime != null and mdcProcessQuantity.endTime != null"> |
| | | AND mpq.efficient_date BETWEEN #{ mdcProcessQuantity.startTime } AND #{ mdcProcessQuantity.endTime } |
| | | AND t1.efficient_date BETWEEN #{ mdcProcessQuantity.startTime } AND #{ mdcProcessQuantity.endTime } |
| | | </if> |
| | | <if test="mdcProcessQuantity.processQuantity != null and mdcProcessQuantity.processQuantity != ''"> |
| | | AND mpq.process_quantity = #{ mdcProcessQuantity.processQuantity } |
| | | AND t1.process_quantity = #{ mdcProcessQuantity.processQuantity } |
| | | </if> |
| | | <if test="mdcProcessQuantity.mdcSectionIds != null and mdcProcessQuantity.mdcSectionIds.size() > 0 "> |
| | | AND mspd.equipment_id IN |
| | | AND t3.equipment_id IN |
| | | <foreach collection="mdcProcessQuantity.mdcSectionIds" item="id" index="index" open="(" close=")" separator=","> |
| | | #{ id } |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ORDER BY mspd.equipment_name ASC, mpq.efficient_date DESC |
| | | ORDER BY t3.equipment_name ASC, t1.efficient_date DESC |
| | | </select> |
| | | |
| | | <!--导出数据查询--> |
| | | <select id="list" resultType="org.jeecg.modules.mdc.dto.MdcProcessQuantityDto"> |
| | | SELECT |
| | | mpq.id id, |
| | | mspd.equipment_id equipmentId, |
| | | mspd.equipment_name equipmentName, |
| | | mspd.parts_code partsCode, |
| | | mspd.batch_code batchCode, |
| | | mspd.sequence_number sequenceNumber, |
| | | mpq.standard_id standardId, |
| | | mpq.efficient_date efficientDate, |
| | | mpq.process_quantity processQuantity, |
| | | mspd.duration duration, |
| | | mpq.remark remark, |
| | | mpq.create_by createBy, |
| | | mpq.create_time createTime, |
| | | mpq.update_by updateBy, |
| | | mpq.update_time updateTime |
| | | FROM mdc_process_quantity mpq LEFT JOIN mdc_standard_process_duration mspd ON mpq.standard_id = mspd.id |
| | | t1.id id, |
| | | t3.equipment_id equipmentId, |
| | | t3.equipment_name equipmentName, |
| | | t2.parts_code partsCode, |
| | | t2.batch_code batchCode, |
| | | t2.sequence_number sequenceNumber, |
| | | t1.standard_id standardId, |
| | | t1.efficient_date efficientDate, |
| | | t1.process_quantity processQuantity, |
| | | t2.duration duration, |
| | | t1.remark remark, |
| | | t1.create_by createBy, |
| | | t1.create_time createTime, |
| | | t1.update_by updateBy, |
| | | t1.update_time updateTime |
| | | FROM |
| | | mdc_process_quantity t1 |
| | | LEFT JOIN mdc_standard_process_duration t2 ON t1.standard_id = t2.id |
| | | LEFT JOIN mdc_equipment t3 ON t1.equipment_id = t3.equipment_id |
| | | <where> |
| | | <if test="mdcProcessQuantity.equipmentId != null and mdcProcessQuantity.equipmentId != ''"> |
| | | AND mspd.equipment_id LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentId }),'%') |
| | | AND t3.equipment_id LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentId }),'%') |
| | | </if> |
| | | <if test="mdcProcessQuantity.equipmentName != null and mdcProcessQuantity.equipmentName != ''"> |
| | | AND mspd.equipment_name LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentName }),'%') |
| | | AND t3.equipment_name LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentName }),'%') |
| | | </if> |
| | | <if test="mdcProcessQuantity.partsCode != null and mdcProcessQuantity.partsCode != ''"> |
| | | AND mspd.parts_code LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.partsCode }),'%') |
| | | AND t2.parts_code LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.partsCode }),'%') |
| | | </if> |
| | | <if test="mdcProcessQuantity.batchCode != null and mdcProcessQuantity.batchCode != ''"> |
| | | AND mspd.batch_code LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.batchCode }),'%') |
| | | AND t2.batch_code LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.batchCode }),'%') |
| | | </if> |
| | | <if test="mdcProcessQuantity.sequenceNumber != null and mdcProcessQuantity.sequenceNumber != ''"> |
| | | AND mspd.sequence_number LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.sequenceNumber }),'%') |
| | | AND t2.sequence_number LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.sequenceNumber }),'%') |
| | | </if> |
| | | <if test="mdcProcessQuantity.startTime != null and mdcProcessQuantity.endTime != null"> |
| | | AND mpq.efficient_date BETWEEN #{ mdcProcessQuantity.startTime } AND #{ mdcProcessQuantity.endTime } |
| | | AND t1.efficient_date BETWEEN #{ mdcProcessQuantity.startTime } AND #{ mdcProcessQuantity.endTime } |
| | | </if> |
| | | <if test="mdcProcessQuantity.processQuantity != null and mdcProcessQuantity.processQuantity != ''"> |
| | | AND mpq.process_quantity = #{ mdcProcessQuantity.processQuantity } |
| | | AND t1.process_quantity = #{ mdcProcessQuantity.processQuantity } |
| | | </if> |
| | | <if test="mdcProcessQuantity.mdcSectionIds != null and mdcProcessQuantity.mdcSectionIds.size() > 0 "> |
| | | AND mspd.equipment_id IN |
| | | AND t3.equipment_id IN |
| | | <foreach collection="mdcProcessQuantity.mdcSectionIds" item="id" index="index" open="(" close=")" separator=","> |
| | | #{ id } |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ORDER BY mspd.equipment_name ASC, mpq.efficient_date DESC |
| | | ORDER BY t3.equipment_name ASC, t1.efficient_date DESC |
| | | </select> |
| | | |
| | | <!--根据id查询--> |
| | | <select id="findById" resultType="org.jeecg.modules.mdc.dto.MdcProcessQuantityDto"> |
| | | SELECT |
| | | mpq.id id, |
| | | mspd.equipment_id equipmentId, |
| | | mspd.equipment_name equipmentName, |
| | | mspd.parts_code partsCode, |
| | | mspd.batch_code batchCode, |
| | | mspd.sequence_number sequenceNumber, |
| | | mpq.standard_id standardId, |
| | | mpq.efficient_date efficientDate, |
| | | mpq.process_quantity processQuantity, |
| | | mspd.duration duration, |
| | | mpq.remark remark, |
| | | mpq.create_by createBy, |
| | | mpq.create_time createTime, |
| | | mpq.update_by updateBy, |
| | | mpq.update_time updateTime |
| | | FROM mdc_process_quantity mpq LEFT JOIN mdc_standard_process_duration mspd ON mpq.standard_id = mspd.id |
| | | WHERE mpq.id = { id } |
| | | t1.id id, |
| | | t3.equipment_id equipmentId, |
| | | t3.equipment_name equipmentName, |
| | | t2.parts_code partsCode, |
| | | t2.batch_code batchCode, |
| | | t2.sequence_number sequenceNumber, |
| | | t1.standard_id standardId, |
| | | t1.efficient_date efficientDate, |
| | | t1.process_quantity processQuantity, |
| | | t2.duration duration, |
| | | t1.remark remark, |
| | | t1.create_by createBy, |
| | | t1.create_time createTime, |
| | | t1.update_by updateBy, |
| | | t1.update_time updateTime |
| | | FROM mdc_process_quantity t1 |
| | | LEFT JOIN mdc_standard_process_duration t2 ON t1.standard_id = t2.id |
| | | LEFT JOIN mdc_equipment t3 ON t1.equipment_id = t3.equipment_id |
| | | WHERE t1.id = #{ id } |
| | | </select> |
| | | |
| | | <select id="findList" resultType="org.jeecg.modules.mdc.dto.MdcProcessQuantityDto"> |
| | | SELECT |
| | | t1.id id, |
| | | t1.equipment_id equipmentId, |
| | | t2.parts_code partsCode, |
| | | t2.batch_code batchCode, |
| | | t2.sequence_number sequenceNumber, |
| | | t1.standard_id standardId, |
| | | t1.efficient_date efficientDate, |
| | | t1.process_quantity processQuantity, |
| | | t2.duration duration |
| | | FROM |
| | | mdc_process_quantity t1 |
| | | LEFT JOIN mdc_standard_process_duration t2 ON t1.standard_id = t2.id |
| | | WHERE |
| | | t1.equipment_id = #{equipmentId} |
| | | AND t1.efficient_date LIKE CONCAT(CONCAT('%',#{ validDate }),'%') |
| | | </select> |
| | | </mapper> |