Browse Source

1、工位关联步骤代码优化

master_hella_20240701
bjang03 1 year ago
parent
commit
03ebbe37f0
  1. 16
      win-module-mes/win-module-mes-biz/src/main/resources/mapper/workstation/WorkstationEquipmentMapper.xml
  2. 8
      win-module-mes/win-module-mes-biz/src/main/resources/mapper/workstation/WorkstationOperstepsMapper.xml

16
win-module-mes/win-module-mes-biz/src/main/resources/mapper/workstation/WorkstationEquipmentMapper.xml

@ -4,28 +4,28 @@
<select id="count" resultType="java.lang.Long">
select count(1) from basic_device_info t where exists (
select 1 from strategy_mes_workstation_equipment where t.device_code=equipment_code and workstation_code=#{workstationCode}
)
select 1 from strategy_mes_workstation_equipment where deleted=0 and t.device_code=equipment_code and workstation_code=#{workstationCode}
) and deleted=0
</select>
<select id="listByWorkstationCode" resultType="com.win.module.mes.controller.workstation.vo.WorkstationEquipmentRespVO">
select t.device_code code,t.device_name name from basic_device_info t where exists (
select 1 from strategy_mes_workstation_equipment where t.device_code=equipment_code and workstation_code=#{workstationCode}
) limit #{pageStart},#{pageSize}
select 1 from strategy_mes_workstation_equipment where deleted=0 and t.device_code=equipment_code and workstation_code=#{workstationCode}
) and deleted=0 limit #{pageStart},#{pageSize}
</select>
<select id="checkCountByWorkstationCode" resultType="java.lang.Long">
select count(1) from basic_device_info t where exists(
select 1 from basic_workstation where code=#{workstationCode} and t.workroom_code=workshop_code
select 1 from basic_workstation where deleted=0 and code=#{workstationCode} and t.workroom_code=workshop_code
<if test="productionLineCodeCheck">
and t.line_code=production_line_code
</if>
)
) and deleted=0
</select>
<select id="checkListByWorkstationCode" resultType="com.win.module.mes.controller.workstation.vo.WorkstationEquipmentRespVO">
select t.device_code code,t.device_name name from basic_device_info t where exists(
select 1 from basic_workstation where code=#{workstationCode} and t.workroom_code=workshop_code
select 1 from basic_workstation where deleted=0 and code=#{workstationCode} and t.workroom_code=workshop_code
<if test="productionLineCodeCheck">
and t.line_code=production_line_code
</if>
) limit #{pageStart},#{pageSize}
) and deleted=0 limit #{pageStart},#{pageSize}
</select>
</mapper>

8
win-module-mes/win-module-mes-biz/src/main/resources/mapper/workstation/WorkstationOperstepsMapper.xml

@ -4,12 +4,12 @@
<select id="count" resultType="java.lang.Long">
select count(1) from basic_opersteps t where exists (
select 1 from strategy_mes_workstation_opersteps where t.steps_code=opersteps_code and workstation_code=#{workstationCode}
)
select 1 from strategy_mes_workstation_opersteps where deleted=0 and t.steps_code=opersteps_code and workstation_code=#{workstationCode}
) and deleted=0
</select>
<select id="listByWorkstationCode" resultType="com.win.module.mes.controller.workstation.vo.WorkstationOperstepsRespVO">
select t.steps_code code,t.steps_name name from basic_opersteps t where exists(
select 1 from strategy_mes_workstation_opersteps where t.steps_code=opersteps_code and workstation_code=#{workstationCode}
)
select 1 from strategy_mes_workstation_opersteps where deleted=0 and t.steps_code=opersteps_code and workstation_code=#{workstationCode}
) and deleted=0
</select>
</mapper>

Loading…
Cancel
Save