|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
<result property="objId" column="obj_id"/>
|
|
|
|
|
<result property="materialBarcode" column="material_barcode"/>
|
|
|
|
|
<result property="switchStationCode" column="switch_station_code"/>
|
|
|
|
|
<result property="switchStationName" column="switch_station_name"/>
|
|
|
|
|
<result property="oldOrderCode" column="old_order_code"/>
|
|
|
|
|
<result property="isSwitch" column="is_switch"/>
|
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
@ -20,49 +21,54 @@
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectRecordSwitchOrderVo">
|
|
|
|
|
select obj_id,
|
|
|
|
|
material_barcode,
|
|
|
|
|
switch_station_code,
|
|
|
|
|
old_order_code,
|
|
|
|
|
is_switch,
|
|
|
|
|
create_by,
|
|
|
|
|
create_time,
|
|
|
|
|
update_by,
|
|
|
|
|
update_time,
|
|
|
|
|
remark,
|
|
|
|
|
order_code,
|
|
|
|
|
is_print
|
|
|
|
|
from record_switch_order
|
|
|
|
|
SELECT rso.obj_id,
|
|
|
|
|
rso.material_barcode,
|
|
|
|
|
rso.switch_station_code,
|
|
|
|
|
pl.PRODUCT_LINE_NAME switch_station_name,
|
|
|
|
|
rso.old_order_code,
|
|
|
|
|
rso.is_switch,
|
|
|
|
|
rso.create_by,
|
|
|
|
|
rso.create_time,
|
|
|
|
|
rso.update_by,
|
|
|
|
|
rso.update_time,
|
|
|
|
|
rso.remark,
|
|
|
|
|
PB.ORDER_CODE,
|
|
|
|
|
ps.IS_PRINT is_print
|
|
|
|
|
FROM record_switch_order rso
|
|
|
|
|
left join BASE_PRODUCTLINE pl ON rso.switch_station_code = pl.PRODUCT_LINE_CODE
|
|
|
|
|
left join C##AUCMA_SCADA.PRINT_BARCODE PB ON PB.MATERIAL_BARCODE = rso.MATERIAL_BARCODE
|
|
|
|
|
left join C##AUCMA_SCADA.PRINT_SUPPLEMENTBARCODE ps ON ps.MATERIAL_BARCODE = rso.MATERIAL_BARCODE
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectRecordSwitchOrderList" parameterType="RecordSwitchOrder" resultMap="RecordSwitchOrderResult">
|
|
|
|
|
<include refid="selectRecordSwitchOrderVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="objId != null ">and obj_id = #{objId}</if>
|
|
|
|
|
<if test="materialBarcode != null and materialBarcode != ''">and material_barcode = #{materialBarcode}</if>
|
|
|
|
|
<if test="switchStationCode != null and switchStationCode != ''">and switch_station_code =
|
|
|
|
|
<if test="objId != null ">and rso.obj_id = #{objId}</if>
|
|
|
|
|
<if test="materialBarcode != null and materialBarcode != ''">and rso.material_barcode = #{materialBarcode}</if>
|
|
|
|
|
<if test="switchStationCode != null and switchStationCode != ''">and rso.switch_station_code =
|
|
|
|
|
#{switchStationCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="oldOrderCode != null and oldOrderCode != ''">and old_order_code = #{oldOrderCode}</if>
|
|
|
|
|
<if test="isSwitch != null and isSwitch != ''">and is_switch = #{isSwitch}</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
|
|
|
|
|
<if test="oldOrderCode != null and oldOrderCode != ''">and rso.old_order_code = #{oldOrderCode}</if>
|
|
|
|
|
<if test="isSwitch != null and isSwitch != ''">and rso.is_switch = #{isSwitch}</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and rso.create_by = #{createBy}</if>
|
|
|
|
|
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
|
|
|
|
and create_time between to_date(#{params.beginCreateTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
|
|
|
|
and rso.create_time between to_date(#{params.beginCreateTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
|
|
|
|
to_date(#{params.endCreateTime}, 'yyyy-mm-dd hh24:mi:ss')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">and rso.update_by = #{updateBy}</if>
|
|
|
|
|
<if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''">
|
|
|
|
|
and update_time between to_date(#{params.beginUpdateTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
|
|
|
|
and rso.update_time between to_date(#{params.beginUpdateTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
|
|
|
|
to_date(#{params.endUpdateTime}, 'yyyy-mm-dd hh24:mi:ss')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderCode != null and orderCode != ''">and order_code = #{orderCode}</if>
|
|
|
|
|
<if test="isPrint != null and isPrint != ''">and is_print = #{isPrint}</if>
|
|
|
|
|
<if test="orderCode != null and orderCode != ''">and PB.order_code = #{orderCode}</if>
|
|
|
|
|
<if test="isPrint != null and isPrint != ''">and rso.is_print = #{isPrint}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by rso.create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectRecordSwitchOrderByObjId" parameterType="Long" resultMap="RecordSwitchOrderResult">
|
|
|
|
|
<include refid="selectRecordSwitchOrderVo"/>
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
|
where rso.obj_id = #{objId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertRecordSwitchOrder" parameterType="RecordSwitchOrder">
|
|
|
|
@ -115,6 +121,12 @@
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updatePrintCode" parameterType="RecordSwitchOrder">
|
|
|
|
|
update C##AUCMA_SCADA.PRINT_BARCODE
|
|
|
|
|
set ORDER_CODE = #{orderCode}
|
|
|
|
|
where MATERIAL_BARCODE = #{materialBarcode}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteRecordSwitchOrderByObjId" parameterType="Long">
|
|
|
|
|
delete
|
|
|
|
|
from record_switch_order
|
|
|
|
@ -127,4 +139,40 @@
|
|
|
|
|
#{objId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="selectPrintBarcode" resultType="java.util.HashMap">
|
|
|
|
|
SELECT PB.ORDER_CODE,
|
|
|
|
|
PB.MATERIAL_CODE,
|
|
|
|
|
PB.MATERIAL_NAME,
|
|
|
|
|
PB.MATERIAL_BARCODE,
|
|
|
|
|
PB.PRINT_BARTYPE,
|
|
|
|
|
OI.PRINT_NAME,
|
|
|
|
|
NVL(MIN(PS.IS_PRINT), 1) IS_PRINT
|
|
|
|
|
FROM BASE_ORDERINFO OI
|
|
|
|
|
JOIN C##AUCMA_SCADA.PRINT_BARCODE PB ON PB.ORDER_CODE = OI.ORDER_CODE
|
|
|
|
|
LEFT JOIN C##AUCMA_SCADA.PRINT_SUPPLEMENTBARCODE PS ON PS.MATERIAL_BARCODE = PB.MATERIAL_BARCODE
|
|
|
|
|
WHERE PB.MATERIAL_BARCODE = #{boxCode}
|
|
|
|
|
GROUP BY PB.ORDER_CODE, PB.MATERIAL_CODE, PB.MATERIAL_NAME, PB.MATERIAL_BARCODE, PB.PRINT_BARTYPE,
|
|
|
|
|
OI.PRINT_NAME
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="printSupplementBarcode">
|
|
|
|
|
INSERT INTO C##AUCMA_SCADA.PRINT_SUPPLEMENTBARCODE
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="ORDER_CODE != null">ORDER_CODE,</if>
|
|
|
|
|
<if test="MATERIAL_CODE != null">MATERIAL_CODE,</if>
|
|
|
|
|
<if test="MATERIAL_NAME != null">MATERIAL_NAME,</if>
|
|
|
|
|
<if test="MATERIAL_BARCODE != null">MATERIAL_BARCODE,</if>
|
|
|
|
|
<if test="PRINT_BARTYPE != null">PRINT_BARTYPE,</if>
|
|
|
|
|
<if test="PRINT_NAME != null">PRINT_NAME,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="ORDER_CODE != null">#{ORDER_CODE},</if>
|
|
|
|
|
<if test="MATERIAL_CODE != null">#{MATERIAL_CODE},</if>
|
|
|
|
|
<if test="MATERIAL_NAME != null">#{MATERIAL_NAME},</if>
|
|
|
|
|
<if test="MATERIAL_BARCODE != null">#{MATERIAL_BARCODE},</if>
|
|
|
|
|
<if test="PRINT_BARTYPE != null">#{PRINT_BARTYPE},</if>
|
|
|
|
|
<if test="PRINT_NAME != null">#{PRINT_NAME},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
</mapper>
|