Merge remote-tracking branch 'origin/master'
# Conflicts: # op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderMapper.java # op-modules/op-plan/src/main/java/com/op/plan/service/IProOrderService.java # op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java # op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWetMaterialPlanServiceImpl.java # op-modules/op-plan/src/main/resources/mapper/plan/ProOrderMapper.xmlhighway
commit
f2a49bc24e
@ -1,14 +1,22 @@
|
||||
package com.op.system.api;
|
||||
|
||||
import com.op.common.core.constant.ServiceNameConstants;
|
||||
import com.op.common.core.domain.R;
|
||||
import com.op.system.api.factory.RemoteSapFallbackFactory;
|
||||
import com.op.system.api.model.SapProOrder;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* sap服务
|
||||
*
|
||||
* @author OP
|
||||
*/
|
||||
@FeignClient(contextId = "remoteSapService", value = ServiceNameConstants.SAP_SERVICE, fallbackFactory = RemoteSapFallbackFactory.class)
|
||||
|
||||
public interface RemoteSapService {
|
||||
@PostMapping("/sap/shopOrderSync")
|
||||
public R<List<SapProOrder>> shopOrderSync();
|
||||
public R<List<SapProOrder>> shopOrderSync(SapProOrder sapProOrder);
|
||||
|
||||
}
|
||||
|
@ -1,132 +0,0 @@
|
||||
<?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="com.op.mes.mapper.BaseFileMapper">
|
||||
|
||||
<resultMap type="BaseFile" id="BaseFileResult">
|
||||
<result property="fileId" column="file_id" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="fileAddress" column="file_address" />
|
||||
<result property="sourceId" column="source_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="selectBaseFileVo">
|
||||
select file_id, file_name, file_address, source_id, remark, attr1,
|
||||
attr2, attr3, attr4, create_by, create_time, update_by,
|
||||
update_time from base_file
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseFileList" parameterType="BaseFile" resultMap="BaseFileResult">
|
||||
<include refid="selectBaseFileVo"/>
|
||||
<where>
|
||||
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||
<if test="fileAddress != null and fileAddress != ''"> and file_address = #{fileAddress}</if>
|
||||
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</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 = #{attr3}</if>
|
||||
<if test="attr4 != null "> and attr4 = #{attr4}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseFileByFileId" parameterType="String" resultMap="BaseFileResult">
|
||||
<include refid="selectBaseFileVo"/>
|
||||
where file_id = #{fileId}
|
||||
</select>
|
||||
<select id="getBaseFileBatch" resultMap="BaseFileResult">
|
||||
<include refid="selectBaseFileVo"/>
|
||||
where source_id = #{sourceId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseFile" parameterType="BaseFile">
|
||||
insert into base_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="fileId != null">file_id,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
<if test="fileAddress != null">file_address,</if>
|
||||
<if test="sourceId != null">source_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="fileId != null">#{fileId},</if>
|
||||
<if test="fileName != null">#{fileName},</if>
|
||||
<if test="fileAddress != null">#{fileAddress},</if>
|
||||
<if test="sourceId != null">#{sourceId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertBaseFileBatch">
|
||||
INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time)
|
||||
VALUES
|
||||
<foreach collection="baseFiles" index="" item="baseFile" separator=",">
|
||||
(
|
||||
#{baseFile.fileId},
|
||||
#{baseFile.fileName},
|
||||
#{baseFile.fileAddress},
|
||||
#{baseFile.sourceId},
|
||||
#{baseFile.remark},
|
||||
#{baseFile.createBy},
|
||||
#{baseFile.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseFile" parameterType="BaseFile">
|
||||
update base_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="fileName != null">file_name = #{fileName},</if>
|
||||
<if test="fileAddress != null">file_address = #{fileAddress},</if>
|
||||
<if test="sourceId != null">source_id = #{sourceId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where file_id = #{fileId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseFileByFileId" parameterType="String">
|
||||
delete from base_file where file_id = #{fileId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseFileByFileIds" parameterType="String">
|
||||
delete from base_file where file_id in
|
||||
<foreach item="fileId" collection="array" open="(" separator="," close=")">
|
||||
#{fileId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteBaseFileBySourceId">
|
||||
delete from base_file where source_id = #{sourceId}
|
||||
</delete>
|
||||
</mapper>
|
@ -1,244 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProOrderMapper">
|
||||
|
||||
<resultMap type="ProOrder" id="ProOrderResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="planFactoryCode" column="plan_factory_code" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="orderType" column="order_type" />
|
||||
<result property="orderCode" column="order_code" />
|
||||
<result property="prodCode" column="prod_code" />
|
||||
<result property="prodDesc" column="prod_desc" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="quantitySplit" column="quantity_split" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="workerOrder" column="worker_order" />
|
||||
<result property="planProDate" column="plan_pro_date" />
|
||||
<result property="planComplete" column="plan_complete" />
|
||||
<result property="atrr1" column="atrr1" />
|
||||
<result property="atrr2" column="atrr2" />
|
||||
<result property="atrr3" column="atrr3" />
|
||||
<result property="status" column="status" />
|
||||
<result property="parentOrder" column="parent_order" />
|
||||
<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="prodType" column="prod_type" />
|
||||
<result property="prodSpc" column="prod_spc" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProOrderVo">
|
||||
select id, plan_factory_code, order_type, order_code, prod_code, prod_desc, quantity, quantity_split,
|
||||
unit, worker_order, plan_pro_date, plan_complete, atrr1, atrr2, atrr3,
|
||||
status, parent_order, create_by, create_time, update_by, update_time, prod_type,
|
||||
factory_code, prod_spc
|
||||
from pro_order
|
||||
</sql>
|
||||
|
||||
<select id="selectProOrderList" parameterType="ProOrder" resultMap="ProOrderResult">
|
||||
<include refid="selectProOrderVo"/>
|
||||
<where>
|
||||
<if test="planFactoryCode != null and planFactoryCode != ''"> and plan_factory_code = #{planFactoryCode}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
<if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
|
||||
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
||||
<if test="prodCode != null and prodCode != ''"> and prod_code = #{prodCode}</if>
|
||||
<if test="prodDesc != null and prodDesc != ''"> and prod_desc like concat('%', #{prodDesc}, '%')</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
||||
<if test="workerOrder != null and workerOrder != ''"> and worker_order = #{workerOrder}</if>
|
||||
<if test="planProDate != null "> and plan_pro_date = #{planProDate}</if>
|
||||
<if test="planComplete != null "> and plan_complete = #{planComplete}</if>
|
||||
<if test="atrr1 != null and atrr1 != ''"> and atrr1 = #{atrr1}</if>
|
||||
<if test="atrr2 != null and atrr2 != ''"> and atrr2 = #{atrr2}</if>
|
||||
<if test="atrr3 != null and atrr3 != ''"> and atrr3 = #{atrr3}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="parentOrder != null and parentOrder != ''"> and parent_order = #{parentOrder}</if>
|
||||
<if test="prodType != null and prodType != ''"> and prod_type = #{prodType}</if>
|
||||
<if test="prodSpc != null and prodSpc != ''"> and prod_spc = #{prodSpc}</if>
|
||||
</where>
|
||||
ORDER BY plan_pro_date DESC
|
||||
</select>
|
||||
|
||||
<select id="selectProOrderById" parameterType="String" resultMap="ProOrderResult">
|
||||
<include refid="selectProOrderVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectConvert" resultType="com.op.mes.domain.Convert">
|
||||
SELECT dict_code dictCode , dict_label dictLabel , dict_value dictValue , dict_sort dictSort FROM sys_dict_data WHERE dict_type = 'convert_type'
|
||||
</select>
|
||||
|
||||
<select id="selectChildProOrderByCode" parameterType="String" resultMap="ProOrderResult">
|
||||
<include refid="selectProOrderVo"/>
|
||||
where parent_order = #{orderCode}
|
||||
</select>
|
||||
|
||||
<select id="selectProdLine" resultType="com.op.mes.domain.ProLine">
|
||||
SELECT equipment_id AS 'key', equipment_name AS 'label'
|
||||
FROM base_equipment
|
||||
WHERE equipment_type_code = 'equ_type_cxj'
|
||||
</select>
|
||||
|
||||
<select id="selectProShift" resultType="com.op.mes.domain.ProShift">
|
||||
SELECT bst.Shift_Id shiftId,bst.Shift_Desc_Global shiftDesc
|
||||
FROM base_shifts_t bst
|
||||
</select>
|
||||
|
||||
<select id="selectProdLineName" resultType="java.lang.String">
|
||||
SELECT equipment_name AS 'prodLineName'
|
||||
FROM base_equipment
|
||||
WHERE equipment_id = #{prodLineCode}
|
||||
</select>
|
||||
|
||||
<select id="selectBatchCodes" resultType="java.lang.String">
|
||||
SELECT batch_code
|
||||
FROM pro_order_workorder_batch
|
||||
WHERE status = '1'
|
||||
GROUP BY batch_code
|
||||
</select>
|
||||
|
||||
<select id="selectBatchNameByCode" resultType="java.lang.String">
|
||||
SELECT sf.factory_name
|
||||
FROM sys_factory sf
|
||||
WHERE sf.f_code = #{prodLineCode}
|
||||
</select>
|
||||
|
||||
<select id="selectBatchCodesById" resultType="java.lang.String">
|
||||
SELECT powb.batch_code
|
||||
FROM pro_order_workorder_batch powb LEFT JOIN pro_order_workorder pow
|
||||
ON powb.workorder_id = pow.workorder_id
|
||||
WHERE pow.workorder_id = #{workorderId}
|
||||
</select>
|
||||
|
||||
<select id="selectPackageLine" resultType="com.op.mes.domain.ProLine">
|
||||
SELECT equipment_id AS 'key', equipment_name AS 'label'
|
||||
FROM base_equipment
|
||||
WHERE equipment_type_code = 'equ_type_bzx'
|
||||
</select>
|
||||
|
||||
<select id="selectShiftNameById" resultType="java.lang.String">
|
||||
SELECT bst.Shift_Desc_Global shiftDesc
|
||||
FROM base_shifts_t bst
|
||||
WHERE bst.Shift_Id = #{shiftId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProOrder" parameterType="ProOrder">
|
||||
insert into pro_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="planFactoryCode != null">plan_factory_code,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="orderType != null">order_type,</if>
|
||||
<if test="orderCode != null">order_code,</if>
|
||||
<if test="prodCode != null">prod_code,</if>
|
||||
<if test="prodDesc != null">prod_desc,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="quantitySplit != null">quantity_split,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="workerOrder != null">worker_order,</if>
|
||||
<if test="planProDate != null">plan_pro_date,</if>
|
||||
<if test="planComplete != null">plan_complete,</if>
|
||||
<if test="atrr1 != null">atrr1,</if>
|
||||
<if test="atrr2 != null">atrr2,</if>
|
||||
<if test="atrr3 != null">atrr3,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="parentOrder != null">parent_order,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="prodType != null">prod_type,</if>
|
||||
<if test="prodSpc != null">prod_spc,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="planFactoryCode != null">#{planFactoryCode},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="orderType != null">#{orderType},</if>
|
||||
<if test="orderCode != null">#{orderCode},</if>
|
||||
<if test="prodCode != null">#{prodCode},</if>
|
||||
<if test="prodDesc != null">#{prodDesc},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="quantitySplit != null">#{quantitySplit},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="workerOrder != null">#{workerOrder},</if>
|
||||
<if test="planProDate != null">#{planProDate},</if>
|
||||
<if test="planComplete != null">#{planComplete},</if>
|
||||
<if test="atrr1 != null">#{atrr1},</if>
|
||||
<if test="atrr2 != null">#{atrr2},</if>
|
||||
<if test="atrr3 != null">#{atrr3},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="parentOrder != null">#{parentOrder},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="prodType != null">#{prodType},</if>
|
||||
<if test="prodSpc != null">#{prodSpc},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProOrder" parameterType="ProOrder">
|
||||
update pro_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="planFactoryCode != null">plan_factoryCode = #{planFactoryCode},</if>
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="orderType != null">order_type = #{orderType},</if>
|
||||
<if test="orderCode != null">order_code = #{orderCode},</if>
|
||||
<if test="prodCode != null">prod_code = #{prodCode},</if>
|
||||
<if test="prodDesc != null">prod_desc = #{prodDesc},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="quantitySplit != null">quantity_split = #{quantitySplit},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="workerOrder != null">worker_order = #{workerOrder},</if>
|
||||
<if test="planProDate != null">plan_pro_date = #{planProDate},</if>
|
||||
<if test="planComplete != null">plan_complete = #{planComplete},</if>
|
||||
<if test="atrr1 != null">atrr1 = #{atrr1},</if>
|
||||
<if test="atrr2 != null">atrr2 = #{atrr2},</if>
|
||||
<if test="atrr3 != null">atrr3 = #{atrr3},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="parentOrder != null">parent_order = #{parentOrder},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="prodType != null">prod_type = #{prodType},</if>
|
||||
<if test="prodSpc != null">prod_spc = #{prodSpc},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateOrder">
|
||||
update pro_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="atrr1 != null and quantitySplit != null">quantity_split += #{atrr1},</if>
|
||||
<if test="quantitySplit == null">quantity_split = #{atrr1},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateOrderBatch">
|
||||
<foreach collection="workers" item="worker" index="index" separator=";">
|
||||
update pro_order set quantity_split = quantity_split-#{worker.quantitySplit},
|
||||
update_time = GETDATE()
|
||||
where id = #{worker.orderId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteProOrderById" parameterType="String">
|
||||
delete from pro_order where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProOrderByIds" parameterType="String">
|
||||
delete from pro_order where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,123 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProOrderWorkorderBatchMapper">
|
||||
|
||||
<resultMap type="ProOrderWorkorderBatch" id="ProOrderWorkorderBatchResult">
|
||||
<result property="batchId" column="batch_id" />
|
||||
<result property="workorderId" column="workorder_id" />
|
||||
<result property="batchCode" column="batch_code" />
|
||||
<result property="batchQuantity" column="batch_quantity" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="prodType" column="prod_type" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProOrderWorkorderBatchVo">
|
||||
select batch_id, workorder_id, batch_code, batch_quantity, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, prod_type, factory_code from pro_order_workorder_batch
|
||||
</sql>
|
||||
|
||||
<select id="selectProOrderWorkorderBatchList" parameterType="ProOrderWorkorderBatch" resultMap="ProOrderWorkorderBatchResult">
|
||||
<include refid="selectProOrderWorkorderBatchVo"/>
|
||||
<where>
|
||||
<if test="batchId != null and batchId != ''"> and batch_id = #{batchId}</if>
|
||||
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
|
||||
<if test="batchQuantity != null "> and batch_quantity = #{batchQuantity}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</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="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
|
||||
<if test="prodType != null and prodType != ''"> and prod_type = #{prodType}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProOrderWorkorderBatchByWorkorderId" parameterType="String" resultMap="ProOrderWorkorderBatchResult">
|
||||
<include refid="selectProOrderWorkorderBatchVo"/>
|
||||
where workorder_id = #{workorderId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProOrderWorkorderBatch" parameterType="ProOrderWorkorderBatch">
|
||||
insert into pro_order_workorder_batch
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="batchId != null and batchId != ''">batch_id,</if>
|
||||
<if test="workorderId != null">workorder_id,</if>
|
||||
<if test="batchCode != null">batch_code,</if>
|
||||
<if test="batchQuantity != null">batch_quantity,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="prodType != null">prod_type,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="batchId != null and batchId != ''">#{batchId},</if>
|
||||
<if test="workorderId != null">#{workorderId},</if>
|
||||
<if test="batchCode != null">#{batchCode},</if>
|
||||
<if test="batchQuantity != null">#{batchQuantity},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="prodType != null">#{prodType},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProOrderWorkorderBatch" parameterType="ProOrderWorkorderBatch">
|
||||
update pro_order_workorder_batch
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="batchId != null and batchId != ''">batch_id = #{batchId},</if>
|
||||
<if test="batchCode != null">batch_code = #{batchCode},</if>
|
||||
<if test="batchQuantity != null">batch_quantity = #{batchQuantity},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="prodType != null">prod_type = #{prodType},</if>
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
</trim>
|
||||
where workorder_id = #{workorderId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProOrderWorkorderBatchByWorkorderId" parameterType="String">
|
||||
delete from pro_order_workorder_batch where workorder_id = #{workorderId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProOrderWorkorderBatchByWorkorderIds" parameterType="String">
|
||||
delete from pro_order_workorder_batch where workorder_id in
|
||||
<foreach item="workorderId" collection="array" open="(" separator="," close=")">
|
||||
#{workorderId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,245 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProOrderWorkorderMapper">
|
||||
|
||||
<resultMap type="ProOrderWorkorder" id="ProOrderWorkorderResult">
|
||||
<result property="workorderId" column="workorder_id" />
|
||||
<result property="workorderCode" column="workorder_code" />
|
||||
<result property="workorderName" column="workorder_name" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="orderCode" column="order_code" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="productSpc" column="product_spc" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="quantityProduced" column="quantity_produced" />
|
||||
<result property="quantitySplit" column="quantity_split" />
|
||||
<result property="routeCode" column="route_code" />
|
||||
<result property="prodLineCode" column="prod_line_code" />
|
||||
<result property="productDate" column="product_date" />
|
||||
<result property="shiftId" column="shift_id" />
|
||||
<result property="parentOrder" column="parent_order" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="prodType" column="prod_type" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="isEnd" column="is_end" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProOrderWorkorderVo">
|
||||
select workorder_id, workorder_code, workorder_name, order_id, order_code, product_id, product_code, product_name, product_spc, unit, quantity_produced, quantity_split, route_code, prod_line_code, product_date, shift_id, parent_order, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, prod_type, factory_code , is_end from pro_order_workorder
|
||||
</sql>
|
||||
|
||||
<select id="selectProOrderWorkorderList" parameterType="ProOrderWorkorder" resultMap="ProOrderWorkorderResult">
|
||||
<include refid="selectProOrderWorkorderVo"/>
|
||||
<where>
|
||||
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
|
||||
<if test="workorderName != null and workorderName != ''"> and workorder_name like concat('%', #{workorderName}, '%')</if>
|
||||
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
||||
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
||||
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
|
||||
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="productSpc != null and productSpc != ''"> and product_spc = #{productSpc}</if>
|
||||
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
||||
<if test="quantityProduced != null "> and quantity_produced = #{quantityProduced}</if>
|
||||
<if test="quantitySplit != null "> and quantity_split = #{quantitySplit}</if>
|
||||
<if test="routeCode != null and routeCode != ''"> and route_code = #{routeCode}</if>
|
||||
<if test="prodLineCode != null and prodLineCode != ''"> and prod_line_code = #{prodLineCode}</if>
|
||||
<if test="productDate != null "> and product_date = #{productDate}</if>
|
||||
<if test="shiftId != null and shiftId != ''"> and shift_id = #{shiftId}</if>
|
||||
<if test="parentOrder != null and parentOrder != ''"> and parent_order = #{parentOrder}</if>
|
||||
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</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="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
|
||||
<if test="prodType != null and prodType != ''"> and prod_type = #{prodType}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
<if test="isEnd != null and isEnd != ''"> and is_end = #{isEnd}</if>
|
||||
<if test="productDateStart != null "> and CONVERT(varchar(10),product_date, 120) >= '${productDateStart}'</if>
|
||||
<if test="productDateEnd != null "> and '${productDateEnd}%' >= CONVERT(varchar(10),product_date, 120)</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProOrderWorkorderByWorkorderId" parameterType="String" resultMap="ProOrderWorkorderResult">
|
||||
<include refid="selectProOrderWorkorderVo"/>
|
||||
where workorder_id = #{workorderId}
|
||||
</select>
|
||||
|
||||
<select id="selectFirWorkOrder" parameterType="String" resultMap="ProOrderWorkorderResult">
|
||||
<include refid="selectProOrderWorkorderVo"/>
|
||||
where order_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectChildWorkOrder" parameterType="String" resultMap="ProOrderWorkorderResult">
|
||||
<include refid="selectProOrderWorkorderVo"/>
|
||||
WHERE parent_order = #{workorderCode}
|
||||
</select>
|
||||
|
||||
<select id="selectWorkOrderByCode" resultMap="ProOrderWorkorderResult">
|
||||
<include refid="selectProOrderWorkorderVo"/>
|
||||
where workorder_code = #{workorderCode}
|
||||
</select>
|
||||
|
||||
<select id="selectEndWorkOrder" resultType="java.lang.String">
|
||||
select TOP 1 workorder_code
|
||||
FROM pro_order_workorder
|
||||
WHERE order_id = #{id}
|
||||
ORDER BY workorder_code DESC
|
||||
</select>
|
||||
|
||||
<select id="selectWorkOrderByTime" resultMap="ProOrderWorkorderResult">
|
||||
<include refid="selectProOrderWorkorderVo"/>
|
||||
where workorder_id not in (
|
||||
select workorder_id
|
||||
from pro_wet_material_plan_detail) and CONVERT(date, product_date) = #{productDate}
|
||||
</select>
|
||||
<select id="getWorkOrderByIds" resultMap="ProOrderWorkorderResult">
|
||||
<include refid="selectProOrderWorkorderVo"/>
|
||||
where workorder_code in
|
||||
<foreach item="workorderCode" collection="array" open="(" separator="," close=")">
|
||||
#{workorderCode}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertProOrderWorkorder" parameterType="ProOrderWorkorder">
|
||||
insert into pro_order_workorder
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="workorderId != null">workorder_id,</if>
|
||||
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
|
||||
<if test="workorderName != null and workorderName != ''">workorder_name,</if>
|
||||
<if test="orderId != null and orderId != ''">order_id,</if>
|
||||
<if test="orderCode != null">order_code,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="productCode != null and productCode != ''">product_code,</if>
|
||||
<if test="productName != null and productName != ''">product_name,</if>
|
||||
<if test="productSpc != null">product_spc,</if>
|
||||
<if test="unit != null and unit != ''">unit,</if>
|
||||
<if test="quantityProduced != null">quantity_produced,</if>
|
||||
<if test="quantitySplit != null">quantity_split,</if>
|
||||
<if test="routeCode != null">route_code,</if>
|
||||
<if test="prodLineCode != null">prod_line_code,</if>
|
||||
<if test="productDate != null">product_date,</if>
|
||||
<if test="shiftId != null">shift_id,</if>
|
||||
<if test="parentOrder != null">parent_order,</if>
|
||||
<if test="ancestors != null">ancestors,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="prodType != null">prod_type,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="isEnd != null">is_end,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="workorderId != null">#{workorderId},</if>
|
||||
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
|
||||
<if test="workorderName != null and workorderName != ''">#{workorderName},</if>
|
||||
<if test="orderId != null and orderId != ''">#{orderId},</if>
|
||||
<if test="orderCode != null">#{orderCode},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="productCode != null and productCode != ''">#{productCode},</if>
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="productSpc != null">#{productSpc},</if>
|
||||
<if test="unit != null and unit != ''">#{unit},</if>
|
||||
<if test="quantityProduced != null">#{quantityProduced},</if>
|
||||
<if test="quantitySplit != null">#{quantitySplit},</if>
|
||||
<if test="routeCode != null">#{routeCode},</if>
|
||||
<if test="prodLineCode != null">#{prodLineCode},</if>
|
||||
<if test="productDate != null">#{productDate},</if>
|
||||
<if test="shiftId != null">#{shiftId},</if>
|
||||
<if test="parentOrder != null">#{parentOrder},</if>
|
||||
<if test="ancestors != null">#{ancestors},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="prodType != null">#{prodType},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="isEnd != null">#{isEnd},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProOrderWorkorder" parameterType="ProOrderWorkorder">
|
||||
update pro_order_workorder
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>
|
||||
<if test="workorderName != null and workorderName != ''">workorder_name = #{workorderName},</if>
|
||||
<if test="orderId != null and orderId != ''">order_id = #{orderId},</if>
|
||||
<if test="orderCode != null">order_code = #{orderCode},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
|
||||
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
||||
<if test="productSpc != null">product_spc = #{productSpc},</if>
|
||||
<if test="unit != null and unit != ''">unit = #{unit},</if>
|
||||
<if test="quantityProduced != null">quantity_produced = #{quantityProduced},</if>
|
||||
<if test="quantitySplit != null">quantity_split = #{quantitySplit},</if>
|
||||
<if test="routeCode != null">route_code = #{routeCode},</if>
|
||||
<if test="prodLineCode != null">prod_line_code = #{prodLineCode},</if>
|
||||
<if test="productDate != null">product_date = #{productDate},</if>
|
||||
<if test="shiftId != null">shift_id = #{shiftId},</if>
|
||||
<if test="parentOrder != null">parent_order = #{parentOrder},</if>
|
||||
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="prodType != null">prod_type = #{prodType},</if>
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="isEnd != null">is_end = #{isEnd},</if>
|
||||
</trim>
|
||||
where workorder_id = #{workorderId}
|
||||
</update>
|
||||
<!--工单下发-->
|
||||
<update id="downProOrderWorkorderByWorkorderIds">
|
||||
update pro_order_workorder
|
||||
set status = 'w1'
|
||||
where workorder_code in
|
||||
<foreach item="workorderCode" collection="array" open="(" separator="," close=")">
|
||||
#{workorderCode}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteProOrderWorkorderByWorkorderId" parameterType="String">
|
||||
delete from pro_order_workorder where workorder_id = #{workorderId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProOrderWorkorderByWorkorderIds" parameterType="String">
|
||||
delete from pro_order_workorder where workorder_id in
|
||||
<foreach item="workorderId" collection="array" open="(" separator="," close=")">
|
||||
#{workorderId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,120 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProProcessContentMapper">
|
||||
|
||||
<resultMap type="ProProcessContent" id="ProProcessContentResult">
|
||||
<result property="contentId" column="content_id" />
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="contentText" column="content_text" />
|
||||
<result property="device" column="device" />
|
||||
<result property="material" column="material" />
|
||||
<result property="docUrl" column="doc_url" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="selectProProcessContentVo">
|
||||
select content_id, process_id, order_num, content_text, device, material, doc_url, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_process_content
|
||||
</sql>
|
||||
|
||||
<select id="selectProProcessContentList" parameterType="ProProcessContent" resultMap="ProProcessContentResult">
|
||||
<include refid="selectProProcessContentVo"/>
|
||||
<where>
|
||||
<if test="processId != null "> and process_id = #{processId}</if>
|
||||
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||
<if test="contentText != null and contentText != ''"> and content_text = #{contentText}</if>
|
||||
<if test="device != null and device != ''"> and device = #{device}</if>
|
||||
<if test="material != null and material != ''"> and material = #{material}</if>
|
||||
<if test="docUrl != null and docUrl != ''"> and doc_url = #{docUrl}</if>
|
||||
</where>
|
||||
order by order_num asc
|
||||
</select>
|
||||
|
||||
<select id="selectProProcessContentByContentId" parameterType="String" resultMap="ProProcessContentResult">
|
||||
<include refid="selectProProcessContentVo"/>
|
||||
where content_id = #{contentId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProProcessContent" parameterType="ProProcessContent" useGeneratedKeys="true" keyProperty="contentId">
|
||||
insert into pro_process_content
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
content_id,
|
||||
<if test="processId != null">process_id,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="contentText != null">content_text,</if>
|
||||
<if test="device != null">device,</if>
|
||||
<if test="material != null">material,</if>
|
||||
<if test="docUrl != null">doc_url,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{contentId},
|
||||
<if test="processId != null">#{processId},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="contentText != null">#{contentText},</if>
|
||||
<if test="device != null">#{device},</if>
|
||||
<if test="material != null">#{material},</if>
|
||||
<if test="docUrl != null">#{docUrl},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProProcessContent" parameterType="ProProcessContent">
|
||||
update pro_process_content
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="processId != null">process_id = #{processId},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="contentText != null">content_text = #{contentText},</if>
|
||||
<if test="device != null">device = #{device},</if>
|
||||
<if test="material != null">material = #{material},</if>
|
||||
<if test="docUrl != null">doc_url = #{docUrl},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where content_id = #{contentId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProProcessContentByContentId" parameterType="String">
|
||||
delete from pro_process_content where content_id = #{contentId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProProcessContentByContentIds" parameterType="String">
|
||||
delete from pro_process_content where content_id in
|
||||
<foreach item="contentId" collection="array" open="(" separator="," close=")">
|
||||
#{contentId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,146 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProProcessMapper">
|
||||
|
||||
<resultMap type="ProProcess" id="ProProcessResult">
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="processCode" column="process_code" />
|
||||
<result property="processName" column="process_name" />
|
||||
<result property="attention" column="attention" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="splitMerge" column="split_merge" />
|
||||
<result property="splitMergNum" column="split_merg_num" />
|
||||
<result property="sync" column="sync"/>
|
||||
<result property="workCenter" column="work_center"/>
|
||||
<result property="workTime" column="work_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProProcessVo">
|
||||
select process_id, process_code, process_name, attention,
|
||||
enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time,split_merge,split_merg_num,sync,work_center,work_time
|
||||
from pro_process
|
||||
</sql>
|
||||
|
||||
<select id="selectProProcessList" parameterType="ProProcess" resultMap="ProProcessResult">
|
||||
<include refid="selectProProcessVo"/>
|
||||
<where>
|
||||
<if test="processCode != null and processCode != ''"> and process_code = #{processCode}</if>
|
||||
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||
<if test="attention != null and attention != ''"> and attention = #{attention}</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectProProcessByProcessId" parameterType="String" resultMap="ProProcessResult">
|
||||
<include refid="selectProProcessVo"/>
|
||||
where process_id = #{processId}
|
||||
</select>
|
||||
|
||||
<select id="checkProcessCodeUnique" parameterType="ProProcess" resultMap="ProProcessResult">
|
||||
select top 1 process_id, process_code, process_name, attention, enable_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time from pro_process
|
||||
where process_code = #{processCode}
|
||||
</select>
|
||||
|
||||
<select id="checkProcessNameUnique" parameterType="ProProcess" resultMap="ProProcessResult">
|
||||
select top 1 process_id, process_code, process_name, attention, enable_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time from pro_process
|
||||
where process_name = #{processName}
|
||||
</select>
|
||||
|
||||
<insert id="insertProProcess" parameterType="ProProcess" useGeneratedKeys="true" keyProperty="processId">
|
||||
insert into pro_process
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
process_id,
|
||||
<if test="processCode != null and processCode != ''">process_code,</if>
|
||||
<if test="processName != null and processName != ''">process_name,</if>
|
||||
<if test="attention != null">attention,</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="splitMerge != null">split_merge,</if>
|
||||
<if test="splitMergNum != null">split_merg_num,</if>
|
||||
<if test="sync != null">sync,</if>
|
||||
<if test="workCenter != null">work_center,</if>
|
||||
<if test="workTime != null">work_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{processId},
|
||||
<if test="processCode != null and processCode != ''">#{processCode},</if>
|
||||
<if test="processName != null and processName != ''">#{processName},</if>
|
||||
<if test="attention != null">#{attention},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="splitMerge != null">#{splitMerge},</if>
|
||||
<if test="splitMergNum != null">#{splitMergNum},</if>
|
||||
<if test="sync != null">#{sync},</if>
|
||||
<if test="workCenter != null">#{workCenter},</if>
|
||||
<if test="workTime != null">#{workTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateProProcess" parameterType="ProProcess">
|
||||
update pro_process
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="processCode != null and processCode != ''">process_code = #{processCode},</if>
|
||||
<if test="processName != null and processName != ''">process_name = #{processName},</if>
|
||||
<if test="attention != null">attention = #{attention},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="splitMerge != null">split_merge = #{splitMerge},</if>
|
||||
<if test="splitMergNum != null">split_merg_num = #{splitMergNum},</if>
|
||||
<if test="sync != null">sync = #{sync},</if>
|
||||
<if test="workCenter != null">work_center = #{workCenter},</if>
|
||||
<if test="workTime != null">work_time = #{workTime},</if>
|
||||
</trim>
|
||||
where process_id = #{processId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProProcessByProcessId" parameterType="String">
|
||||
delete from pro_process where process_id = #{processId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProProcessByProcessIds" parameterType="String">
|
||||
delete from pro_process where process_id in
|
||||
<foreach item="processId" collection="array" open="(" separator="," close=")">
|
||||
#{processId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,123 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProRecipeContentMapper">
|
||||
|
||||
<resultMap type="ProRecipeContent" id="ProRecipeContentResult">
|
||||
<result property="contentId" column="content_id" />
|
||||
<result property="recipeId" column="recipe_id" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="contentText" column="content_text" />
|
||||
<result property="device" column="device" />
|
||||
<result property="material" column="material" />
|
||||
<result property="docUrl" column="doc_url" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="selectProRecipeContentVo">
|
||||
select content_id, recipe_id, order_num, content_text, device, material,
|
||||
doc_url, remark, attr1, attr2, attr3, attr4, create_by,
|
||||
create_time, update_by, update_time
|
||||
from pro_recipe_content
|
||||
</sql>
|
||||
|
||||
<select id="selectProRecipeContentList" parameterType="ProRecipeContent" resultMap="ProRecipeContentResult">
|
||||
<include refid="selectProRecipeContentVo"/>
|
||||
<where>
|
||||
<if test="recipeId != null "> and recipe_id = #{recipeId}</if>
|
||||
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||
<if test="contentText != null and contentText != ''"> and content_text = #{contentText}</if>
|
||||
<if test="device != null and device != ''"> and device = #{device}</if>
|
||||
<if test="material != null and material != ''"> and material = #{material}</if>
|
||||
<if test="docUrl != null and docUrl != ''"> and doc_url = #{docUrl}</if>
|
||||
</where>
|
||||
order by order_num asc
|
||||
</select>
|
||||
|
||||
<select id="selectProRecipeContentByContentId" parameterType="String" resultMap="ProRecipeContentResult">
|
||||
<include refid="selectProRecipeContentVo"/>
|
||||
where content_id = #{contentId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProRecipeContent" parameterType="ProRecipeContent" useGeneratedKeys="true" keyProperty="contentId">
|
||||
insert into pro_recipe_content
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
content_id,
|
||||
<if test="recipeId != null">recipe_id,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="contentText != null">content_text,</if>
|
||||
<if test="device != null">device,</if>
|
||||
<if test="material != null">material,</if>
|
||||
<if test="docUrl != null">doc_url,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{contentId},
|
||||
<if test="recipeId != null">#{recipeId},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="contentText != null">#{contentText},</if>
|
||||
<if test="device != null">#{device},</if>
|
||||
<if test="material != null">#{material},</if>
|
||||
<if test="docUrl != null">#{docUrl},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProRecipeContent" parameterType="ProRecipeContent">
|
||||
update pro_recipe_content
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="recipeId != null">recipe_id = #{recipeId},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="contentText != null">content_text = #{contentText},</if>
|
||||
<if test="device != null">device = #{device},</if>
|
||||
<if test="material != null">material = #{material},</if>
|
||||
<if test="docUrl != null">doc_url = #{docUrl},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where content_id = #{contentId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProRecipeContentByContentId" parameterType="String">
|
||||
delete from pro_recipe_content where content_id = #{contentId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProRecipeContentByContentIds" parameterType="String">
|
||||
delete from pro_recipe_content where content_id in
|
||||
<foreach item="contentId" collection="array" open="(" separator="," close=")">
|
||||
#{contentId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,146 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProRecipeMapper">
|
||||
|
||||
<resultMap type="ProRecipe" id="ProRecipeResult">
|
||||
<result property="recipeId" column="recipe_id" />
|
||||
<result property="recipeCode" column="recipe_code" />
|
||||
<result property="recipeName" column="recipe_name" />
|
||||
<result property="attention" column="attention" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="splitMerge" column="split_merge" />
|
||||
<result property="splitMergNum" column="split_merg_num" />
|
||||
<result property="sync" column="sync"/>
|
||||
<result property="version" column="version"/>
|
||||
<result property="workTime" column="work_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProRecipeVo">
|
||||
select recipe_id, recipe_code, recipe_name, attention,
|
||||
enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time,split_merge,split_merg_num,sync,version,work_time
|
||||
from pro_recipe
|
||||
</sql>
|
||||
|
||||
<select id="selectProRecipeList" parameterType="ProRecipe" resultMap="ProRecipeResult">
|
||||
<include refid="selectProRecipeVo"/>
|
||||
<where>
|
||||
<if test="recipeCode != null and recipeCode != ''"> and recipe_code = #{recipeCode}</if>
|
||||
<if test="recipeName != null and recipeName != ''"> and recipe_name like concat('%', #{recipeName}, '%')</if>
|
||||
<if test="attention != null and attention != ''"> and attention = #{attention}</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectProRecipeByRecipeId" parameterType="String" resultMap="ProRecipeResult">
|
||||
<include refid="selectProRecipeVo"/>
|
||||
where recipe_id = #{recipeId}
|
||||
</select>
|
||||
|
||||
<select id="checkRecipeCodeUnique" parameterType="ProRecipe" resultMap="ProRecipeResult">
|
||||
select top 1 recipe_id, recipe_code, recipe_name, attention, enable_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time from pro_recipe
|
||||
where recipe_code = #{recipeCode}
|
||||
</select>
|
||||
|
||||
<select id="checkRecipeNameUnique" parameterType="ProRecipe" resultMap="ProRecipeResult">
|
||||
select top 1 recipe_id, recipe_code, recipe_name, attention, enable_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time from pro_recipe
|
||||
where recipe_name = #{recipeName}
|
||||
</select>
|
||||
|
||||
<insert id="insertProRecipe" parameterType="ProRecipe" useGeneratedKeys="true" keyProperty="recipeId">
|
||||
insert into pro_recipe
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
recipe_id,
|
||||
<if test="recipeCode != null and recipeCode != ''">recipe_code,</if>
|
||||
<if test="recipeName != null and recipeName != ''">recipe_name,</if>
|
||||
<if test="attention != null">attention,</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="splitMerge != null">split_merge,</if>
|
||||
<if test="splitMergNum != null">split_merg_num,</if>
|
||||
<if test="sync != null">sync,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="workTime != null">work_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{recipeId},
|
||||
<if test="recipeCode != null and recipeCode != ''">#{recipeCode},</if>
|
||||
<if test="recipeName != null and recipeName != ''">#{recipeName},</if>
|
||||
<if test="attention != null">#{attention},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="splitMerge != null">#{splitMerge},</if>
|
||||
<if test="splitMergNum != null">#{splitMergNum},</if>
|
||||
<if test="sync != null">#{sync},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="workTime != null">#{workTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateProRecipe" parameterType="ProRecipe">
|
||||
update pro_recipe
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="recipeCode != null and recipeCode != ''">recipe_code = #{recipeCode},</if>
|
||||
<if test="recipeName != null and recipeName != ''">recipe_name = #{recipeName},</if>
|
||||
<if test="attention != null">attention = #{attention},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="splitMerge != null">split_merge = #{splitMerge},</if>
|
||||
<if test="splitMergNum != null">split_merg_num = #{splitMergNum},</if>
|
||||
<if test="sync != null">sync = #{sync},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="workTime != null">work_time = #{workTime},</if>
|
||||
</trim>
|
||||
where recipe_id = #{recipeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProRecipeByRecipeId" parameterType="String">
|
||||
delete from pro_recipe where recipe_id = #{recipeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProRecipeByRecipeIds" parameterType="String">
|
||||
delete from pro_recipe where recipe_id in
|
||||
<foreach item="recipeId" collection="array" open="(" separator="," close=")">
|
||||
#{recipeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,146 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProRouteMapper">
|
||||
|
||||
<resultMap type="ProRoute" id="ProRouteResult">
|
||||
<result property="routeId" column="route_id" />
|
||||
<result property="routeCode" column="route_code" />
|
||||
<result property="routeName" column="route_name" />
|
||||
<result property="routeDesc" column="route_desc" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="routeVersion" column="route_version" />
|
||||
<result property="needCheck" column="need_check" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProRouteVo">
|
||||
select route_id, route_code, route_name, route_desc, enable_flag, remark,
|
||||
attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time,
|
||||
route_version,need_check
|
||||
from pro_route
|
||||
</sql>
|
||||
|
||||
<select id="selectProRouteList" parameterType="ProRoute" resultMap="ProRouteResult">
|
||||
<include refid="selectProRouteVo"/>
|
||||
<where>
|
||||
<if test="routeCode != null and routeCode != ''"> and route_code = #{routeCode}</if>
|
||||
<if test="routeName != null and routeName != ''"> and route_name like concat('%', #{routeName}, '%')</if>
|
||||
<if test="routeDesc != null and routeDesc != ''"> and route_desc = #{routeDesc}</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectProRouteByRouteId" parameterType="String" resultMap="ProRouteResult">
|
||||
<include refid="selectProRouteVo"/>
|
||||
where route_id = #{routeId}
|
||||
</select>
|
||||
|
||||
<select id="getRouteByProductId" parameterType="String" resultMap="ProRouteResult">
|
||||
select r.*
|
||||
from pro_route r
|
||||
left join pro_route_product p
|
||||
on p.route_id = r.route_id
|
||||
where r.enable_flag = 'Y'
|
||||
and p.item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<select id="checkRouteCodeUnique" parameterType="ProRoute" resultMap="ProRouteResult">
|
||||
select top 1 route_id, route_code, route_name, route_desc,
|
||||
enable_flag, remark, attr1, attr2, attr3, attr4,
|
||||
create_by, create_time, update_by, update_time,need_check
|
||||
from pro_route
|
||||
where route_code = #{routeCode}
|
||||
</select>
|
||||
|
||||
<select id="selectAllRoute" resultMap="ProRouteResult">
|
||||
select route_code, route_name
|
||||
from pro_route
|
||||
where enable_flag = 'Y'
|
||||
</select>
|
||||
|
||||
<insert id="insertProRoute" parameterType="ProRoute" useGeneratedKeys="true" keyProperty="routeId">
|
||||
insert into pro_route
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="routeId != null and routeId != ''">route_id,</if>
|
||||
<if test="routeCode != null and routeCode != ''">route_code,</if>
|
||||
<if test="routeName != null and routeName != ''">route_name,</if>
|
||||
<if test="routeDesc != null">route_desc,</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="routeVersion != null">route_version,</if>
|
||||
<if test="needCheck != null">need_check,</if>
|
||||
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="routeId != null and routeId != ''">#{routeId},</if>
|
||||
<if test="routeCode != null and routeCode != ''">#{routeCode},</if>
|
||||
<if test="routeName != null and routeName != ''">#{routeName},</if>
|
||||
<if test="routeDesc != null">#{routeDesc},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="routeVersion != null">#{routeVersion},</if>
|
||||
<if test="needCheck != null">#{needCheck},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProRoute" parameterType="ProRoute">
|
||||
update pro_route
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="routeCode != null and routeCode != ''">route_code = #{routeCode},</if>
|
||||
<if test="routeName != null and routeName != ''">route_name = #{routeName},</if>
|
||||
<if test="routeDesc != null">route_desc = #{routeDesc},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="routeVersion != null">route_version = #{routeVersion},</if>
|
||||
<if test="needCheck != null">#{needCheck},</if>
|
||||
</trim>
|
||||
where route_id = #{routeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProRouteByRouteId" parameterType="String">
|
||||
delete from pro_route where route_id = #{routeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProRouteByRouteIds" parameterType="String">
|
||||
delete from pro_route where route_id in
|
||||
<foreach item="routeId" collection="array" open="(" separator="," close=")">
|
||||
#{routeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,229 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProRouteProcessMapper">
|
||||
|
||||
<resultMap type="ProRouteProcess" id="ProRouteProcessResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="routeId" column="route_id" />
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="processCode" column="process_code" />
|
||||
<result property="processName" column="process_name" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="nextProcessId" column="next_process_id" />
|
||||
<result property="nextProcessCode" column="next_process_code" />
|
||||
<result property="nextProcessName" column="next_process_name" />
|
||||
<result property="linkType" column="link_type" />
|
||||
<result property="defaultPreTime" column="default_pre_time" />
|
||||
<result property="defaultSufTime" column="default_suf_time" />
|
||||
<result property="colorCode" column="color_code" />
|
||||
<result property="keyFlag" column="key_flag" ></result>
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="selectProRouteProcessVo">
|
||||
select record_id, route_id, process_id, process_code, process_name, order_num, next_process_id, next_process_code, next_process_name, link_type, default_pre_time, default_suf_time, color_code,key_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_route_process
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectProRouteProcessList" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
|
||||
<include refid="selectProRouteProcessVo"/>
|
||||
<where>
|
||||
<if test="routeId != null "> and route_id = #{routeId}</if>
|
||||
<if test="processId != null "> and process_id = #{processId}</if>
|
||||
<if test="processCode != null and processCode != ''"> and process_code = #{processCode}</if>
|
||||
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||
<if test="nextProcessId != null "> and next_process_id = #{nextProcessId}</if>
|
||||
<if test="nextProcessCode != null and nextProcessCode != ''"> and next_process_code = #{nextProcessCode}</if>
|
||||
<if test="nextProcessName != null and nextProcessName != ''"> and next_process_name like concat('%', #{nextProcessName}, '%')</if>
|
||||
<if test="linkType != null and linkType != ''"> and link_type = #{linkType}</if>
|
||||
<if test="defaultPreTime != null "> and default_pre_time = #{defaultPreTime}</if>
|
||||
<if test="defaultSufTime != null "> and default_suf_time = #{defaultSufTime}</if>
|
||||
<if test="colorCode != null and colorCode != ''"> and color_code = #{colorCode}</if>
|
||||
<if test="keyFlag !=null and keyFlag !=''"> and key_flag = #{keyFlag}</if>
|
||||
</where>
|
||||
order by order_num asc
|
||||
</select>
|
||||
|
||||
<select id="selectProRouteProcessByRecordId" parameterType="String" resultMap="ProRouteProcessResult">
|
||||
<include refid="selectProRouteProcessVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<select id="checkOrderNumExists" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
|
||||
select top 1 record_id, route_id, process_id, process_code, process_name,
|
||||
order_num, next_process_id, next_process_code, next_process_name,
|
||||
link_type, default_pre_time, default_suf_time, color_code,key_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by,
|
||||
update_time
|
||||
from pro_route_process
|
||||
where route_id = #{routeId} and order_num = #{orderNum}
|
||||
</select>
|
||||
|
||||
<select id="checkProcessExists" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
|
||||
select top 1 record_id, route_id, process_id, process_code, process_name,
|
||||
order_num, next_process_id, next_process_code, next_process_name,
|
||||
link_type, default_pre_time, default_suf_time, color_code,key_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by,
|
||||
update_time
|
||||
from pro_route_process
|
||||
where route_id = #{routeId} and process_id = #{processId}
|
||||
</select>
|
||||
|
||||
<select id="checkUpdateFlagUnique" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
|
||||
select top 1 record_id, route_id, process_id, process_code, process_name,
|
||||
order_num, next_process_id, next_process_code, next_process_name,
|
||||
link_type, default_pre_time, default_suf_time, color_code,key_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by,
|
||||
update_time
|
||||
from pro_route_process
|
||||
where route_id = #{routeId} and key_flag = 'Y'
|
||||
</select>
|
||||
|
||||
<select id="findPreProcess" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
|
||||
select top 1 record_id, route_id, process_id, process_code, process_name,
|
||||
order_num, next_process_id, next_process_code, next_process_name,
|
||||
link_type, default_pre_time, default_suf_time, color_code,key_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by,
|
||||
update_time
|
||||
from pro_route_process
|
||||
where route_id = #{routeId}
|
||||
<choose>
|
||||
<when test="orderNum != null "> and order_num < #{orderNum}</when>
|
||||
<otherwise>
|
||||
AND order_num < (
|
||||
SELECT top 1 order_num
|
||||
FROM pro_route_process
|
||||
WHERE route_id = #{routeId}
|
||||
)
|
||||
</otherwise>
|
||||
</choose>
|
||||
ORDER BY order_num DESC
|
||||
</select>
|
||||
|
||||
<select id="findNextProcess" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
|
||||
select top 1 record_id, route_id, process_id, process_code, process_name, order_num,
|
||||
next_process_id, next_process_code, next_process_name, link_type, default_pre_time,
|
||||
default_suf_time, color_code,key_flag, remark, attr1, attr2, attr3, attr4, create_by,
|
||||
create_time, update_by, update_time from pro_route_process
|
||||
where route_id = #{routeId}
|
||||
<choose>
|
||||
<when test="orderNum != null "> and order_num > #{orderNum}</when>
|
||||
<otherwise>
|
||||
AND order_num > (
|
||||
SELECT top 1 order_num
|
||||
FROM pro_route_process
|
||||
WHERE route_id = #{routeId}
|
||||
)
|
||||
</otherwise>
|
||||
</choose>
|
||||
ORDER BY order_num ASC
|
||||
</select>
|
||||
|
||||
<insert id="insertProRouteProcess" parameterType="ProRouteProcess" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into pro_route_process
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null and recordId != ''">record_id,</if>
|
||||
<if test="routeId != null">route_id,</if>
|
||||
<if test="processId != null">process_id,</if>
|
||||
<if test="processCode != null">process_code,</if>
|
||||
<if test="processName != null">process_name,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="nextProcessId != null">next_process_id,</if>
|
||||
<if test="nextProcessCode != null">next_process_code,</if>
|
||||
<if test="nextProcessName != null">next_process_name,</if>
|
||||
<if test="linkType != null">link_type,</if>
|
||||
<if test="defaultPreTime != null">default_pre_time,</if>
|
||||
<if test="defaultSufTime != null">default_suf_time,</if>
|
||||
<if test="colorCode != null">color_code,</if>
|
||||
<if test="keyFlag !=null">key_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null and recordId != ''">#{recordId},</if>
|
||||
<if test="routeId != null">#{routeId},</if>
|
||||
<if test="processId != null">#{processId},</if>
|
||||
<if test="processCode != null">#{processCode},</if>
|
||||
<if test="processName != null">#{processName},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="nextProcessId != null">#{nextProcessId},</if>
|
||||
<if test="nextProcessCode != null">#{nextProcessCode},</if>
|
||||
<if test="nextProcessName != null">#{nextProcessName},</if>
|
||||
<if test="linkType != null">#{linkType},</if>
|
||||
<if test="defaultPreTime != null">#{defaultPreTime},</if>
|
||||
<if test="defaultSufTime != null">#{defaultSufTime},</if>
|
||||
<if test="colorCode != null">#{colorCode},</if>
|
||||
<if test="keyFlag !=null">#{keyFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProRouteProcess" parameterType="ProRouteProcess">
|
||||
update pro_route_process
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="routeId != null">route_id = #{routeId},</if>
|
||||
<if test="processId != null">process_id = #{processId},</if>
|
||||
<if test="processCode != null">process_code = #{processCode},</if>
|
||||
<if test="processName != null">process_name = #{processName},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="nextProcessId != null">next_process_id = #{nextProcessId},</if>
|
||||
<if test="nextProcessCode != null">next_process_code = #{nextProcessCode},</if>
|
||||
<if test="nextProcessName != null">next_process_name = #{nextProcessName},</if>
|
||||
<if test="linkType != null">link_type = #{linkType},</if>
|
||||
<if test="defaultPreTime != null">default_pre_time = #{defaultPreTime},</if>
|
||||
<if test="defaultSufTime != null">default_suf_time = #{defaultSufTime},</if>
|
||||
<if test="keyFlag !=null">key_flag = #{keyFlag},</if>
|
||||
<if test="colorCode != null">color_code = #{colorCode},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProRouteProcessByRecordId" parameterType="String">
|
||||
delete from pro_route_process where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProRouteProcessByRecordIds" parameterType="String">
|
||||
delete from pro_route_process where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteByRouteId" parameterType="String">
|
||||
delete from pro_route_process where route_id = #{routeId}
|
||||
</delete>
|
||||
</mapper>
|
@ -1,148 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProRouteProductMapper">
|
||||
|
||||
<resultMap type="ProRouteProduct" id="ProRouteProductResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="routeId" column="route_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="selectProRouteProductVo">
|
||||
select record_id, route_id, item_id, item_code, item_name, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_route_product
|
||||
</sql>
|
||||
|
||||
<select id="selectProRouteProductList" parameterType="ProRouteProduct" resultMap="ProRouteProductResult">
|
||||
<include refid="selectProRouteProductVo"/>
|
||||
<where>
|
||||
<if test="routeId != null and routeId != ''"> and route_id = #{routeId}</if>
|
||||
<if test="itemId != null and itemId != ''"> and item_id = #{itemId}</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</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="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProRouteProductByRecordId" parameterType="String" resultMap="ProRouteProductResult">
|
||||
<include refid="selectProRouteProductVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
<!-- 原来逻辑:关联工厂里面的线体-->
|
||||
<!-- <select id="getRouteProdProductListUndo" resultType="com.op.mes.domain.ProRouteProduct">-->
|
||||
<!-- select sf.f_code [key],-->
|
||||
<!-- sf.factory_name label-->
|
||||
<!-- from sys_factory sf-->
|
||||
<!-- where sf.f_type='l' and sf.status = '1' and sf.del_flag = '0'-->
|
||||
<!-- </select>-->
|
||||
<!-- 现在逻辑:关联产品-->
|
||||
<select id="getRouteProdProductListUndo" resultType="com.op.mes.domain.ProRouteProduct">
|
||||
select bp.product_code [key],
|
||||
bp.product_desc_zh label,
|
||||
bp.product_desc_zh itemName,
|
||||
bp.product_id itemId
|
||||
from base_product bp
|
||||
where bp.active_flag = '1' and bp.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<!-- <select id="getRouteProdProductListDo" resultType="com.op.mes.domain.ProRouteProduct">-->
|
||||
<!-- select pl.item_code [key],-->
|
||||
<!-- sf.factory_name label-->
|
||||
<!-- from pro_route_product pl-->
|
||||
<!-- left join sys_factory sf on pl.item_code = sf.f_code-->
|
||||
<!-- where pl.route_id = #{routeId}-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getRouteProdProductListDo" resultType="com.op.mes.domain.ProRouteProduct">
|
||||
select pp.item_code [key],
|
||||
bp.product_desc_zh label
|
||||
from pro_route_product pp
|
||||
left join base_product bp on pp.item_code = bp.product_code
|
||||
where pp.route_id = #{routeId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProRouteProduct" parameterType="ProRouteProduct">
|
||||
insert into pro_route_product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">record_id,</if>
|
||||
<if test="routeId != null and routeId != ''">route_id,</if>
|
||||
<if test="itemId != null and itemId != ''">item_id,</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code,</if>
|
||||
<if test="itemName != null and itemName != ''">item_name,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">#{recordId},</if>
|
||||
<if test="routeId != null and routeId != ''">#{routeId},</if>
|
||||
<if test="itemId != null and itemId != ''">#{itemId},</if>
|
||||
<if test="itemCode != null and itemCode != ''">#{itemCode},</if>
|
||||
<if test="itemName != null and itemName != ''">#{itemName},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProRouteProduct" parameterType="ProRouteProduct">
|
||||
update pro_route_product
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="routeId != null and routeId != ''">route_id = #{routeId},</if>
|
||||
<if test="itemId != null and itemId != ''">item_id = #{itemId},</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code = #{itemCode},</if>
|
||||
<if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProRouteProductByRecordId" parameterType="String">
|
||||
delete from pro_route_product where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProRouteProductByRecordIds" parameterType="String">
|
||||
delete from pro_route_product where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteByRouteId">
|
||||
delete from pro_route_product where route_id = #{routeId}
|
||||
</delete>
|
||||
</mapper>
|
@ -1,164 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProWetMaterialPlanDetailMapper">
|
||||
|
||||
<resultMap type="ProWetMaterialPlanDetail" id="ProWetMaterialPlanDetailResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="wetMaterialPlanId" column="wet_material_plan_id" />
|
||||
<result property="workorderId" column="workorder_id" />
|
||||
<result property="atrr1" column="atrr1" />
|
||||
<result property="atrr2" column="atrr2" />
|
||||
<result property="atrr3" column="atrr3" />
|
||||
<result property="status" column="status" />
|
||||
<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="bucketId" column="bucket_id" />
|
||||
<result property="bucketCode" column="bucket_code" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="shiftId" column="shift_id" />
|
||||
<result property="shiftCode" column="shift_code" />
|
||||
<result property="shiftDesc" column="shift_desc" />
|
||||
<result property="planTime" column="plan_time" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="productDate" column="product_date" />
|
||||
<result property="workorderCode" column="workorder_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProWetMaterialPlanDetailVo">
|
||||
select id, factory_code, wet_material_plan_id, workorder_id, atrr1, atrr2, atrr3, status, create_by, create_time, update_by, update_time, bucket_id, bucket_code, material_code, material_id, material_name, product_name, shift_id, shift_code, shift_desc, plan_time from pro_wet_material_plan_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectProWetMaterialPlanDetailList" parameterType="ProWetMaterialPlanDetail" resultMap="ProWetMaterialPlanDetailResult">
|
||||
<include refid="selectProWetMaterialPlanDetailVo"/>
|
||||
<where>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
<if test="wetMaterialPlanId != null and wetMaterialPlanId != ''"> and wet_material_plan_id = #{wetMaterialPlanId}</if>
|
||||
<if test="workorderId != null and workorderId != ''"> and workorder_id = #{workorderId}</if>
|
||||
<if test="atrr1 != null and atrr1 != ''"> and atrr1 = #{atrr1}</if>
|
||||
<if test="atrr2 != null and atrr2 != ''"> and atrr2 = #{atrr2}</if>
|
||||
<if test="atrr3 != null and atrr3 != ''"> and atrr3 = #{atrr3}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="bucketId != null and bucketId != ''"> and bucket_id = #{bucketId}</if>
|
||||
<if test="bucketCode != null and bucketCode != ''"> and bucket_code = #{bucketCode}</if>
|
||||
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||||
<if test="materialId != null and materialId != ''"> and material_id = #{materialId}</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="shiftId != null "> and shift_id = #{shiftId}</if>
|
||||
<if test="shiftCode != null and shiftCode != ''"> and shift_code = #{shiftCode}</if>
|
||||
<if test="shiftDesc != null and shiftDesc != ''"> and shift_desc = #{shiftDesc}</if>
|
||||
<if test="planTime != null and planTime != ''"> and plan_time = #{planTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProWetMaterialPlanDetailById" parameterType="String" resultMap="ProWetMaterialPlanDetailResult">
|
||||
<include refid="selectProWetMaterialPlanDetailVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectProWetMaterialPlanDetailListById" parameterType="String" resultMap="ProWetMaterialPlanDetailResult">
|
||||
select p.*,w.workorder_code,w.product_date
|
||||
from pro_wet_material_plan_detail p join pro_order_workorder w
|
||||
on w.workorder_id = p.workorder_id
|
||||
where p.wet_material_plan_id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertProWetMaterialPlanDetail" parameterType="ProWetMaterialPlanDetail">
|
||||
insert into pro_wet_material_plan_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="wetMaterialPlanId != null">wet_material_plan_id,</if>
|
||||
<if test="workorderId != null">workorder_id,</if>
|
||||
<if test="atrr1 != null">atrr1,</if>
|
||||
<if test="atrr2 != null">atrr2,</if>
|
||||
<if test="atrr3 != null">atrr3,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="bucketId != null">bucket_id,</if>
|
||||
<if test="bucketCode != null">bucket_code,</if>
|
||||
<if test="materialCode != null">material_code,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="shiftId != null">shift_id,</if>
|
||||
<if test="shiftCode != null">shift_code,</if>
|
||||
<if test="shiftDesc != null">shift_desc,</if>
|
||||
<if test="planTime != null">plan_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="wetMaterialPlanId != null">#{wetMaterialPlanId},</if>
|
||||
<if test="workorderId != null">#{workorderId},</if>
|
||||
<if test="atrr1 != null">#{atrr1},</if>
|
||||
<if test="atrr2 != null">#{atrr2},</if>
|
||||
<if test="atrr3 != null">#{atrr3},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="bucketId != null">#{bucketId},</if>
|
||||
<if test="bucketCode != null">#{bucketCode},</if>
|
||||
<if test="materialCode != null">#{materialCode},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="shiftId != null">#{shiftId},</if>
|
||||
<if test="shiftCode != null">#{shiftCode},</if>
|
||||
<if test="shiftDesc != null">#{shiftDesc},</if>
|
||||
<if test="planTime != null">#{planTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProWetMaterialPlanDetail" parameterType="ProWetMaterialPlanDetail">
|
||||
update pro_wet_material_plan_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="wetMaterialPlanId != null">wet_material_plan_id = #{wetMaterialPlanId},</if>
|
||||
<if test="workorderId != null">workorder_id = #{workorderId},</if>
|
||||
<if test="atrr1 != null">atrr1 = #{atrr1},</if>
|
||||
<if test="atrr2 != null">atrr2 = #{atrr2},</if>
|
||||
<if test="atrr3 != null">atrr3 = #{atrr3},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="bucketId != null">bucket_id = #{bucketId},</if>
|
||||
<if test="bucketCode != null">bucket_code = #{bucketCode},</if>
|
||||
<if test="materialCode != null">material_code = #{materialCode},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
<if test="shiftId != null">shift_id = #{shiftId},</if>
|
||||
<if test="shiftCode != null">shift_code = #{shiftCode},</if>
|
||||
<if test="shiftDesc != null">shift_desc = #{shiftDesc},</if>
|
||||
<if test="planTime != null">plan_time = #{planTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProWetMaterialPlanDetailById" parameterType="String">
|
||||
delete from pro_wet_material_plan_detail where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProWetMaterialPlanDetailByIds" parameterType="String">
|
||||
delete from pro_wet_material_plan_detail where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,185 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProWetMaterialPlanMapper">
|
||||
|
||||
<resultMap type="ProWetMaterialPlan" id="ProWetMaterialPlanResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="planTime" column="plan_time" />
|
||||
<result property="syncFlag" column="sync_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="orderType" column="order_type" />
|
||||
<result property="prodCode" column="prod_code" />
|
||||
<result property="prodDesc" column="prod_desc" />
|
||||
<result property="prodSource" column="prod_source" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="atrr1" column="atrr1" />
|
||||
<result property="atrr2" column="atrr2" />
|
||||
<result property="atrr3" column="atrr3" />
|
||||
<result property="status" column="status" />
|
||||
<result property="prodType" column="prod_type" />
|
||||
<result property="planCode" column="plan_code" />
|
||||
<result property="shiftId" column="shift_id" />
|
||||
<result property="shiftDesc" column="shift_desc" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProWetMaterialPlanVo">
|
||||
select id, factory_code, plan_time, sync_flag, create_by, create_time, update_by, update_time, order_type, prod_code, prod_desc, prod_source, quantity, unit, atrr1, atrr2, atrr3, status, prod_type, plan_code, shift_id, shift_desc from pro_wet_material_plan
|
||||
</sql>
|
||||
|
||||
<select id="selectProWetMaterialPlanList" parameterType="ProWetMaterialPlan" resultMap="ProWetMaterialPlanResult">
|
||||
<include refid="selectProWetMaterialPlanVo"/>
|
||||
<where>
|
||||
<if test="syncFlag != null and syncFlag != ''"> and sync_flag = #{syncFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProWetMaterialPlanById" parameterType="String" resultMap="ProWetMaterialPlanResult">
|
||||
<include refid="selectProWetMaterialPlanVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectProWetMaterialPlanListByTime" parameterType="ProWetMaterialPlan" resultMap="ProWetMaterialPlanResult">
|
||||
<include refid="selectProWetMaterialPlanVo"/>
|
||||
WHERE CONVERT(date, plan_time) BETWEEN #{startTime} AND #{endTime}
|
||||
ORDER BY CONVERT(date, plan_time) DESC , sync_flag
|
||||
</select>
|
||||
<select id="selectBMSList" resultType="com.op.mes.domain.BMS">
|
||||
SELECT bucket_id AS 'bucketId', material_id AS 'materialId',shift_id AS 'shiftId'
|
||||
FROM pro_wet_material_plan_detail
|
||||
WHERE status = '0' AND CONVERT(date, plan_time) = #{planTime}
|
||||
GROUP BY bucket_id,material_id,shift_id
|
||||
</select>
|
||||
|
||||
<select id="selectShiftById" resultType="java.lang.String">
|
||||
SELECT bst.Shift_Desc_Global shiftName
|
||||
FROM base_shifts_t bst
|
||||
WHERE bst.Shift_Id = #{shiftId}
|
||||
</select>
|
||||
|
||||
<select id="selectBucketList" resultType="com.op.mes.domain.Bucket">
|
||||
SELECT equipment_id AS 'bucketId',equipment_code AS 'bucketCode',equipment_name AS 'bucketName'
|
||||
FROM base_equipment
|
||||
WHERE equipment_type_code = 'equ_type_lg'
|
||||
</select>
|
||||
|
||||
<select id="selectProductList" resultType="com.op.mes.domain.Product">
|
||||
SELECT product_id AS 'productId', product_code AS 'productCode',product_desc_zh AS 'productDesc'
|
||||
FROM base_product
|
||||
WHERE active_flag = '1'
|
||||
</select>
|
||||
|
||||
<select id="selectProWetMaterialPlanByPlanTime" resultType="java.lang.String">
|
||||
select id
|
||||
from pro_wet_material_plan
|
||||
where prod_source = #{bucketCode} and plan_time = #{planTime} and shift_id = #{shiftId}
|
||||
</select>
|
||||
|
||||
<select id="selectWetMaterialPlanByPlanTime" resultType="java.lang.String">
|
||||
select id
|
||||
from pro_wet_material_plan
|
||||
where CONVERT(date, plan_time) = CONVERT(date, #{planTime})
|
||||
</select>
|
||||
|
||||
<select id="selectBucketNameById" resultType="java.lang.String">
|
||||
select equipment_name as 'bucketName'
|
||||
from base_equipment
|
||||
where equipment_type_code = 'equ_type_lg' and equipment_id = #{bucketId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProWetMaterialPlan" parameterType="ProWetMaterialPlan">
|
||||
insert into pro_wet_material_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="planTime != null">plan_time,</if>
|
||||
<if test="syncFlag != null">sync_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="orderType != null">order_type,</if>
|
||||
<if test="prodCode != null">prod_code,</if>
|
||||
<if test="prodDesc != null">prod_desc,</if>
|
||||
<if test="prodSource != null">prod_source,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="atrr1 != null">atrr1,</if>
|
||||
<if test="atrr2 != null">atrr2,</if>
|
||||
<if test="atrr3 != null">atrr3,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="prodType != null">prod_type,</if>
|
||||
<if test="planCode != null">plan_code,</if>
|
||||
<if test="shiftId != null">shift_id,</if>
|
||||
<if test="shiftDesc != null">shift_desc,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="planTime != null">#{planTime},</if>
|
||||
<if test="syncFlag != null">#{syncFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="orderType != null">#{orderType},</if>
|
||||
<if test="prodCode != null">#{prodCode},</if>
|
||||
<if test="prodDesc != null">#{prodDesc},</if>
|
||||
<if test="prodSource != null">#{prodSource},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="atrr1 != null">#{atrr1},</if>
|
||||
<if test="atrr2 != null">#{atrr2},</if>
|
||||
<if test="atrr3 != null">#{atrr3},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="prodType != null">#{prodType},</if>
|
||||
<if test="planCode != null">#{planCode},</if>
|
||||
<if test="shiftId != null">#{shiftId},</if>
|
||||
<if test="shiftDesc != null">#{shiftDesc},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProWetMaterialPlan" parameterType="ProWetMaterialPlan">
|
||||
update pro_wet_material_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="planTime != null">plan_time = #{planTime},</if>
|
||||
<if test="syncFlag != null">sync_flag = #{syncFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="orderType != null">order_type = #{orderType},</if>
|
||||
<if test="prodCode != null">prod_code = #{prodCode},</if>
|
||||
<if test="prodDesc != null">prod_desc = #{prodDesc},</if>
|
||||
<if test="prodSource != null">prod_source = #{prodSource},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="atrr1 != null">atrr1 = #{atrr1},</if>
|
||||
<if test="atrr2 != null">atrr2 = #{atrr2},</if>
|
||||
<if test="atrr3 != null">atrr3 = #{atrr3},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="prodType != null">prod_type = #{prodType},</if>
|
||||
<if test="planCode != null">plan_code = #{planCode},</if>
|
||||
<if test="shiftId != null">plan_code = #{shiftId},</if>
|
||||
<if test="shiftDesc != null">plan_code = #{shiftDesc},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProWetMaterialPlanById" parameterType="String">
|
||||
delete from pro_wet_material_plan where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProWetMaterialPlanByIds" parameterType="String">
|
||||
delete from pro_wet_material_plan where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,221 +0,0 @@
|
||||
<?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="com.op.mes.mapper.ProWorkorderProcessDetailMapper">
|
||||
|
||||
<resultMap type="ProWorkorderProcessDetail" id="ProWorkorderProcessDetailResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="workorderId" column="workorder_id" />
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="prodType" column="prod_type" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="machineId" column="machine_id" />
|
||||
<result property="machineCode" column="machine_code" />
|
||||
<result property="routeId" column="route_id" />
|
||||
<result property="routeVersion" column="route_version" />
|
||||
<result property="routeCode" column="route_code" />
|
||||
<result property="nextProcessId" column="next_process_id" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProWorkorderProcessDetailVo">
|
||||
select record_id, workorder_id, process_id, status, remark,
|
||||
attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time, prod_type, factory_code, machine_id,
|
||||
machine_code, route_id, route_version, route_code ,
|
||||
next_process_id,order_num
|
||||
from pro_workorder_process_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectProWorkorderProcessDetailList" parameterType="ProWorkorderProcessDetail" resultMap="ProWorkorderProcessDetailResult">
|
||||
<include refid="selectProWorkorderProcessDetailVo"/>
|
||||
<where>
|
||||
<if test="workorderId != null and workorderId != ''"> and workorder_id = #{workorderId}</if>
|
||||
<if test="processId != null and processId != ''"> and process_id = #{processId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</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="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
|
||||
<if test="prodType != null and prodType != ''"> and prod_type = #{prodType}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
<if test="machineId != null and machineId != ''"> and machine_id = #{machineId}</if>
|
||||
<if test="machineCode != null and machineCode != ''"> and machine_code = #{machineCode}</if>
|
||||
<if test="routeId != null and routeId != ''"> and route_id = #{routeId}</if>
|
||||
<if test="routeVersion != null and routeVersion != ''"> and route_version = #{routeVersion}</if>
|
||||
<if test="routeCode != null and routeCode != ''"> and route_code = #{routeCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProWorkorderProcessDetailByRecordId" parameterType="String" resultMap="ProWorkorderProcessDetailResult">
|
||||
<include refid="selectProWorkorderProcessDetailVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
<select id="getWorkOrderDetailsByRouteCode" resultType="com.op.mes.domain.ProWorkorderProcessDetail">
|
||||
select
|
||||
r.route_id routeId,
|
||||
r.route_code routeCode,
|
||||
r.route_name routeName,
|
||||
r.route_version routeVersion,
|
||||
rp.process_id processId,
|
||||
rp.next_process_id nextProcessId,
|
||||
rp.process_name processName,
|
||||
rp.order_num orderNum
|
||||
from pro_route r
|
||||
left join pro_route_process rp on r.route_id = rp.route_id
|
||||
where r.route_code = #{routeCode}
|
||||
order by rp.order_num
|
||||
</select>
|
||||
|
||||
<insert id="insertProWorkorderProcessDetail" parameterType="ProWorkorderProcessDetail">
|
||||
insert into pro_workorder_process_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">record_id,</if>
|
||||
<if test="workorderId != null and workorderId != ''">workorder_id,</if>
|
||||
<if test="processId != null and processId != ''">process_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="prodType != null">prod_type,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="machineId != null">machine_id,</if>
|
||||
<if test="machineCode != null">machine_code,</if>
|
||||
<if test="routeId != null">route_id,</if>
|
||||
<if test="routeVersion != null">route_version,</if>
|
||||
<if test="routeCode != null">route_code,</if>
|
||||
<if test="nextProcessId != null">next_process_id,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">#{recordId},</if>
|
||||
<if test="workorderId != null and workorderId != ''">#{workorderId},</if>
|
||||
<if test="processId != null and processId != ''">#{processId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="prodType != null">#{prodType},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="machineId != null">#{machineId},</if>
|
||||
<if test="machineCode != null">#{machineCode},</if>
|
||||
<if test="routeId != null">#{routeId},</if>
|
||||
<if test="routeVersion != null">#{routeVersion},</if>
|
||||
<if test="routeCode != null">#{routeCode},</if>
|
||||
<if test="nextProcessId != null">#{nextProcessId},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="addWorkOrderDetails">
|
||||
<foreach collection="processes" item="process" index="index" separator=";">
|
||||
insert into pro_workorder_process_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="process.recordId != null">record_id,</if>
|
||||
<if test="process.workorderId != null">workorder_id,</if>
|
||||
<if test="process.processId != null">process_id,</if>
|
||||
<if test="process.status != null">status,</if>
|
||||
<if test="process.remark != null">remark,</if>
|
||||
<if test="process.attr1 != null">attr1,</if>
|
||||
<if test="process.attr2 != null">attr2,</if>
|
||||
<if test="process.attr3 != null">attr3,</if>
|
||||
<if test="process.attr4 != null">attr4,</if>
|
||||
<if test="process.createBy != null">create_by,</if>
|
||||
<if test="process.createTime != null">create_time,</if>
|
||||
<if test="process.prodType != null">prod_type,</if>
|
||||
<if test="process.factoryCode != null">factory_code,</if>
|
||||
<if test="process.machineId != null">machine_id,</if>
|
||||
<if test="process.machineCode != null">machine_code,</if>
|
||||
<if test="process.routeId != null">route_id,</if>
|
||||
<if test="process.routeVersion != null">route_version,</if>
|
||||
<if test="process.routeCode != null">route_code,</if>
|
||||
<if test="process.nextProcessId != null">next_process_id,</if>
|
||||
<if test="process.orderNum != null">order_num,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="process.recordId != null">#{process.recordId},</if>
|
||||
<if test="process.workorderId != null">#{process.workorderId},</if>
|
||||
<if test="process.processId != null">#{process.processId},</if>
|
||||
<if test="process.status != null">#{process.status},</if>
|
||||
<if test="process.remark != null">#{process.remark},</if>
|
||||
<if test="process.attr1 != null">#{process.attr1},</if>
|
||||
<if test="process.attr2 != null">#{process.attr2},</if>
|
||||
<if test="process.attr3 != null">#{process.attr3},</if>
|
||||
<if test="process.attr4 != null">#{process.attr4},</if>
|
||||
<if test="process.createBy != null">#{process.createBy},</if>
|
||||
<if test="process.createTime != null">#{process.createTime},</if>
|
||||
<if test="process.prodType != null">#{process.prodType},</if>
|
||||
<if test="process.factoryCode != null">#{process.factoryCode},</if>
|
||||
<if test="process.machineId != null">#{process.machineId},</if>
|
||||
<if test="process.machineCode != null">#{process.machineCode},</if>
|
||||
<if test="process.routeId != null">#{process.routeId},</if>
|
||||
<if test="process.routeVersion != null">#{process.routeVersion},</if>
|
||||
<if test="process.routeCode != null">#{process.routeCode},</if>
|
||||
<if test="process.nextProcessId != null">#{process.nextProcessId},</if>
|
||||
<if test="process.orderNum != null">#{process.orderNum},</if>
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateProWorkorderProcessDetail" parameterType="ProWorkorderProcessDetail">
|
||||
update pro_workorder_process_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="workorderId != null and workorderId != ''">workorder_id = #{workorderId},</if>
|
||||
<if test="processId != null and processId != ''">process_id = #{processId},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="prodType != null">prod_type = #{prodType},</if>
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="machineId != null">machine_id = #{machineId},</if>
|
||||
<if test="machineCode != null">machine_code = #{machineCode},</if>
|
||||
<if test="routeId != null">route_id = #{routeId},</if>
|
||||
<if test="routeVersion != null">route_version = #{routeVersion},</if>
|
||||
<if test="routeCode != null">route_code = #{routeCode},</if>
|
||||
<if test="nextProcessId != null">next_process_id=#{nextProcessId},</if>
|
||||
<if test="orderNum != null">order_num=#{orderNum},</if>
|
||||
</trim>
|
||||
where record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProWorkorderProcessDetailByRecordId" parameterType="String">
|
||||
delete from pro_workorder_process_detail where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProWorkorderProcessDetailByRecordIds" parameterType="String">
|
||||
delete from pro_workorder_process_detail where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,67 @@
|
||||
package com.op.plan.domain.dto;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class WCSDTO {
|
||||
|
||||
private String reqCode;
|
||||
|
||||
private Date reqTime;
|
||||
|
||||
private String planNo;
|
||||
|
||||
private String code;
|
||||
|
||||
private String message;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
private List<WCSDataDTO> data;
|
||||
|
||||
public String getReqCode() {
|
||||
return reqCode;
|
||||
}
|
||||
|
||||
public void setReqCode(String reqCode) {
|
||||
this.reqCode = reqCode;
|
||||
}
|
||||
|
||||
public Date getReqTime() {
|
||||
return reqTime;
|
||||
}
|
||||
|
||||
public void setReqTime(Date reqTime) {
|
||||
this.reqTime = reqTime;
|
||||
}
|
||||
|
||||
public String getPlanNo() {
|
||||
return planNo;
|
||||
}
|
||||
|
||||
public void setPlanNo(String planNo) {
|
||||
this.planNo = planNo;
|
||||
}
|
||||
|
||||
public List<WCSDataDTO> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<WCSDataDTO> data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.op.plan.domain.dto;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class WCSDataDTO {
|
||||
|
||||
private String sku;
|
||||
|
||||
private String loadNo;
|
||||
|
||||
private List<WCSDataItemsDTO> unLoadItems;
|
||||
|
||||
public String getSku() {
|
||||
return sku;
|
||||
}
|
||||
|
||||
public void setSku(String sku) {
|
||||
this.sku = sku;
|
||||
}
|
||||
|
||||
public String getLoadNo() {
|
||||
return loadNo;
|
||||
}
|
||||
|
||||
public void setLoadNo(String loadNo) {
|
||||
this.loadNo = loadNo;
|
||||
}
|
||||
|
||||
public List<WCSDataItemsDTO> getUnLoadItems() {
|
||||
return unLoadItems;
|
||||
}
|
||||
|
||||
public void setUnLoadItems(List<WCSDataItemsDTO> unLoadItems) {
|
||||
this.unLoadItems = unLoadItems;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.op.plan.domain.dto;
|
||||
|
||||
|
||||
public class WCSDataItemsDTO {
|
||||
|
||||
private String unloadNo;
|
||||
|
||||
public String getUnloadNo() {
|
||||
return unloadNo;
|
||||
}
|
||||
|
||||
public void setUnloadNo(String unloadNo) {
|
||||
this.unloadNo = unloadNo;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue