|
|
|
@ -41,6 +41,7 @@
|
|
|
|
|
<result property="enterpriseId" column="Enterprise_Id"/>
|
|
|
|
|
<result property="enterpriseCode" column="Enterprise_Code"/>
|
|
|
|
|
<result property="workorderCode" column="workorderCode"/>
|
|
|
|
|
<result property="needDate" column="needDate"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="pagination_tail">
|
|
|
|
|
limit #{page.pageOffset} , #{page.rows}
|
|
|
|
@ -686,4 +687,257 @@
|
|
|
|
|
factory_code,
|
|
|
|
|
unit
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectMesPrepareBC" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
|
|
|
|
|
SELECT
|
|
|
|
|
prepare_id ID,
|
|
|
|
|
workorder_name Produce_Code,
|
|
|
|
|
workorder_code workorderCode
|
|
|
|
|
FROM mes_prepare WHERE
|
|
|
|
|
workorder_code =#{userDefined4}
|
|
|
|
|
and del_flag='0'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectMesPrepareDetailBC" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
|
|
|
|
|
SELECT
|
|
|
|
|
material_code Material_Code,
|
|
|
|
|
material_name Material_Desc,
|
|
|
|
|
unit Unit,
|
|
|
|
|
quantity Plan_Number,
|
|
|
|
|
factory_code Site_code,
|
|
|
|
|
need_date needDate,
|
|
|
|
|
recoil User_Defined3
|
|
|
|
|
FROM
|
|
|
|
|
mes_prepare_detail
|
|
|
|
|
WHERE
|
|
|
|
|
prepare_id=#{ID} and
|
|
|
|
|
del_flag = '0'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectWmsOdsProcureOutOrderByID" parameterType="String" resultMap="OdsProcureOutOrderResult">
|
|
|
|
|
SELECT
|
|
|
|
|
Site_code,
|
|
|
|
|
ID,
|
|
|
|
|
Produce_Code,
|
|
|
|
|
Material_Code,
|
|
|
|
|
Material_Desc,
|
|
|
|
|
Plan_Date,
|
|
|
|
|
Plan_Number,
|
|
|
|
|
Unit,
|
|
|
|
|
COALESCE ( Out_Number, 0 ) AS Out_Number,
|
|
|
|
|
Loc_Code,
|
|
|
|
|
Loc_Desc,
|
|
|
|
|
Production_Line_Desc,
|
|
|
|
|
Production_Line_Code,
|
|
|
|
|
Order_Status,
|
|
|
|
|
User_Defined1,
|
|
|
|
|
User_Defined2,
|
|
|
|
|
User_Defined3,
|
|
|
|
|
User_Defined4,
|
|
|
|
|
User_Defined5,
|
|
|
|
|
User_Defined6,
|
|
|
|
|
User_Defined7,
|
|
|
|
|
User_Defined8,
|
|
|
|
|
User_Defined9,
|
|
|
|
|
User_Defined10,
|
|
|
|
|
User_Defined11,
|
|
|
|
|
Supplier_Code,
|
|
|
|
|
Supplier_Name,
|
|
|
|
|
Create_By,
|
|
|
|
|
Create_Date,
|
|
|
|
|
Last_Update_By,
|
|
|
|
|
Last_Update_Date,
|
|
|
|
|
Active,
|
|
|
|
|
Enterprise_Id,
|
|
|
|
|
Enterprise_Code
|
|
|
|
|
FROM
|
|
|
|
|
wms_ods_procure_out_order
|
|
|
|
|
where ID = #{ID}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectWmsOdsProcureOutOrder" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
|
|
|
|
|
SELECT
|
|
|
|
|
Site_code,
|
|
|
|
|
ID,
|
|
|
|
|
Produce_Code,
|
|
|
|
|
Material_Code,
|
|
|
|
|
Material_Desc,
|
|
|
|
|
Plan_Date,
|
|
|
|
|
Plan_Number,
|
|
|
|
|
Unit,
|
|
|
|
|
COALESCE ( Out_Number, 0 ) AS Out_Number,
|
|
|
|
|
Loc_Code,
|
|
|
|
|
Loc_Desc,
|
|
|
|
|
Production_Line_Desc,
|
|
|
|
|
Production_Line_Code,
|
|
|
|
|
Order_Status,
|
|
|
|
|
User_Defined1,
|
|
|
|
|
User_Defined2,
|
|
|
|
|
User_Defined3,
|
|
|
|
|
User_Defined4,
|
|
|
|
|
User_Defined5,
|
|
|
|
|
User_Defined6,
|
|
|
|
|
User_Defined7,
|
|
|
|
|
User_Defined8,
|
|
|
|
|
User_Defined9,
|
|
|
|
|
User_Defined10,
|
|
|
|
|
User_Defined11,
|
|
|
|
|
Supplier_Code,
|
|
|
|
|
Supplier_Name,
|
|
|
|
|
Create_By,
|
|
|
|
|
Create_Date,
|
|
|
|
|
Last_Update_By,
|
|
|
|
|
Last_Update_Date,
|
|
|
|
|
Active,
|
|
|
|
|
Enterprise_Id,
|
|
|
|
|
Enterprise_Code
|
|
|
|
|
FROM
|
|
|
|
|
wms_ods_procure_out_order
|
|
|
|
|
<where>
|
|
|
|
|
<if test="siteCode != null and siteCode != ''"> and Site_code = #{siteCode}</if>
|
|
|
|
|
<if test="produceCode != null and produceCode != ''"> and Produce_Code = #{produceCode}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''"> and Material_Code = #{materialCode}</if>
|
|
|
|
|
<if test="materialDesc != null and materialDesc != ''"> and Material_Desc = #{materialDesc}</if>
|
|
|
|
|
<if test="planDate != null "> and Plan_Date = #{planDate}</if>
|
|
|
|
|
<if test="planNumber != null "> and Plan_Number = #{planNumber}</if>
|
|
|
|
|
<if test="Unit != null and Unit != ''"> and Unit = #{Unit}</if>
|
|
|
|
|
<if test="outNumber != null "> and Out_Number = #{outNumber}</if>
|
|
|
|
|
<if test="locCode != null and locCode != ''"> and Loc_Code = #{locCode}</if>
|
|
|
|
|
<if test="locDesc != null and locDesc != ''"> and Loc_Desc = #{locDesc}</if>
|
|
|
|
|
<if test="productionLineDesc != null and productionLineDesc != ''"> and Production_Line_Desc = #{productionLineDesc}</if>
|
|
|
|
|
<if test="productionLineCode != null and productionLineCode != ''"> and Production_Line_Code = #{productionLineCode}</if>
|
|
|
|
|
<if test="orderStatus != null and orderStatus != ''"> and Order_Status = #{orderStatus}</if>
|
|
|
|
|
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
|
|
|
|
|
<if test="userDefined2 != null and userDefined2 != ''"> and User_Defined2 = #{userDefined2}</if>
|
|
|
|
|
<if test="userDefined3 != null and userDefined3 != ''"> and User_Defined3 = #{userDefined3}</if>
|
|
|
|
|
<if test="userDefined4 != null and userDefined4 != ''"> and User_Defined4 = #{userDefined4}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''"> and User_Defined5 = #{userDefined5}</if>
|
|
|
|
|
<if test="userDefined6 != null and userDefined6 != ''"> and User_Defined6 = #{userDefined6}</if>
|
|
|
|
|
<if test="userDefined7 != null and userDefined7 != ''"> and User_Defined7 = #{userDefined7}</if>
|
|
|
|
|
<if test="userDefined8 != null and userDefined8 != ''"> and User_Defined8 = #{userDefined8}</if>
|
|
|
|
|
<if test="userDefined9 != null and userDefined9 != ''"> and User_Defined9 = #{userDefined9}</if>
|
|
|
|
|
<if test="userDefined10 != null and userDefined10 != ''"> and User_Defined10 = #{userDefined10}</if>
|
|
|
|
|
<if test="userDefined11 != null and userDefined11 != ''"> and User_Defined11 = #{userDefined11}</if>
|
|
|
|
|
<if test="supplierCode != null and supplierCode != ''"> and Supplier_Code = #{supplierCode}</if>
|
|
|
|
|
<if test="supplierName != null and supplierName != ''"> and Supplier_Name like concat('%', #{supplierName}, '%')</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''"> and Create_By = #{createBy}</if>
|
|
|
|
|
<if test="createDate != null "> and Create_Date = #{createDate}</if>
|
|
|
|
|
<if test="lastUpdateBy != null and lastUpdateBy != ''"> and Last_Update_By = #{lastUpdateBy}</if>
|
|
|
|
|
<if test="lastUpdateDate != null "> and Last_Update_Date = #{lastUpdateDate}</if>
|
|
|
|
|
<if test="Active != null and Active != ''"> and Active = #{Active}</if>
|
|
|
|
|
<if test="enterpriseId != null and enterpriseId != ''"> and Enterprise_Id = #{enterpriseId}</if>
|
|
|
|
|
<if test="enterpriseCode != null and enterpriseCode != ''"> and Enterprise_Code = #{enterpriseCode}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertWmsOdsProcureOutOrder" parameterType="OdsProcureOutOrder">
|
|
|
|
|
insert into wms_ods_procure_out_order
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="siteCode != null">Site_code,</if>
|
|
|
|
|
<if test="ID != null">ID,</if>
|
|
|
|
|
<if test="produceCode != null">Produce_Code,</if>
|
|
|
|
|
<if test="materialCode != null">Material_Code,</if>
|
|
|
|
|
<if test="materialDesc != null">Material_Desc,</if>
|
|
|
|
|
<if test="planDate != null">Plan_Date,</if>
|
|
|
|
|
<if test="planNumber != null">Plan_Number,</if>
|
|
|
|
|
<if test="Unit != null">Unit,</if>
|
|
|
|
|
<if test="outNumber != null">Out_Number,</if>
|
|
|
|
|
<if test="locCode != null">Loc_Code,</if>
|
|
|
|
|
<if test="locDesc != null">Loc_Desc,</if>
|
|
|
|
|
<if test="productionLineDesc != null">Production_Line_Desc,</if>
|
|
|
|
|
<if test="productionLineCode != null">Production_Line_Code,</if>
|
|
|
|
|
<if test="orderStatus != null">Order_Status,</if>
|
|
|
|
|
<if test="userDefined1 != null">User_Defined1,</if>
|
|
|
|
|
<if test="userDefined2 != null">User_Defined2,</if>
|
|
|
|
|
<if test="userDefined3 != null">User_Defined3,</if>
|
|
|
|
|
<if test="userDefined4 != null">User_Defined4,</if>
|
|
|
|
|
<if test="userDefined5 != null">User_Defined5,</if>
|
|
|
|
|
<if test="userDefined6 != null">User_Defined6,</if>
|
|
|
|
|
<if test="userDefined7 != null">User_Defined7,</if>
|
|
|
|
|
<if test="userDefined8 != null">User_Defined8,</if>
|
|
|
|
|
<if test="userDefined9 != null">User_Defined9,</if>
|
|
|
|
|
<if test="userDefined10 != null">User_Defined10,</if>
|
|
|
|
|
<if test="userDefined11 != null">User_Defined11,</if>
|
|
|
|
|
<if test="supplierCode != null">Supplier_Code,</if>
|
|
|
|
|
<if test="supplierName != null">Supplier_Name,</if>
|
|
|
|
|
<if test="createBy != null">Create_By,</if>
|
|
|
|
|
<if test="createDate != null">Create_Date,</if>
|
|
|
|
|
<if test="lastUpdateBy != null">Last_Update_By,</if>
|
|
|
|
|
<if test="lastUpdateDate != null">Last_Update_Date,</if>
|
|
|
|
|
<if test="Active != null">Active,</if>
|
|
|
|
|
<if test="enterpriseId != null">Enterprise_Id,</if>
|
|
|
|
|
<if test="enterpriseCode != null">Enterprise_Code,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="siteCode != null">#{siteCode},</if>
|
|
|
|
|
<if test="ID != null">#{ID},</if>
|
|
|
|
|
<if test="produceCode != null">#{produceCode},</if>
|
|
|
|
|
<if test="materialCode != null">#{materialCode},</if>
|
|
|
|
|
<if test="materialDesc != null">#{materialDesc},</if>
|
|
|
|
|
<if test="planDate != null">#{planDate},</if>
|
|
|
|
|
<if test="planNumber != null">#{planNumber},</if>
|
|
|
|
|
<if test="Unit != null">#{Unit},</if>
|
|
|
|
|
<if test="outNumber != null">#{outNumber},</if>
|
|
|
|
|
<if test="locCode != null">#{locCode},</if>
|
|
|
|
|
<if test="locDesc != null">#{locDesc},</if>
|
|
|
|
|
<if test="productionLineDesc != null">#{productionLineDesc},</if>
|
|
|
|
|
<if test="productionLineCode != null">#{productionLineCode},</if>
|
|
|
|
|
<if test="orderStatus != null">#{orderStatus},</if>
|
|
|
|
|
<if test="userDefined1 != null">#{userDefined1},</if>
|
|
|
|
|
<if test="userDefined2 != null">#{userDefined2},</if>
|
|
|
|
|
<if test="userDefined3 != null">#{userDefined3},</if>
|
|
|
|
|
<if test="userDefined4 != null">#{userDefined4},</if>
|
|
|
|
|
<if test="userDefined5 != null">#{userDefined5},</if>
|
|
|
|
|
<if test="userDefined6 != null">#{userDefined6},</if>
|
|
|
|
|
<if test="userDefined7 != null">#{userDefined7},</if>
|
|
|
|
|
<if test="userDefined8 != null">#{userDefined8},</if>
|
|
|
|
|
<if test="userDefined9 != null">#{userDefined9},</if>
|
|
|
|
|
<if test="userDefined10 != null">#{userDefined10},</if>
|
|
|
|
|
<if test="userDefined11 != null">#{userDefined11},</if>
|
|
|
|
|
<if test="supplierCode != null">#{supplierCode},</if>
|
|
|
|
|
<if test="supplierName != null">#{supplierName},</if>
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
<if test="createDate != null">#{createDate},</if>
|
|
|
|
|
<if test="lastUpdateBy != null">#{lastUpdateBy},</if>
|
|
|
|
|
<if test="lastUpdateDate != null">#{lastUpdateDate},</if>
|
|
|
|
|
<if test="Active != null">#{Active},</if>
|
|
|
|
|
<if test="enterpriseId != null">#{enterpriseId},</if>
|
|
|
|
|
<if test="enterpriseCode != null">#{enterpriseCode},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<select id="updateWmsOdsProcureOutOrder" parameterType="OdsProcureOutOrder">
|
|
|
|
|
update wms_ods_procure_out_order
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="siteCode != null">Site_code = #{siteCode},</if>
|
|
|
|
|
<if test="produceCode != null">Produce_Code = #{produceCode},</if>
|
|
|
|
|
<if test="materialCode != null">Material_Code = #{materialCode},</if>
|
|
|
|
|
<if test="materialDesc != null">Material_Desc = #{materialDesc},</if>
|
|
|
|
|
<if test="planDate != null">Plan_Date = #{planDate},</if>
|
|
|
|
|
<if test="planNumber != null">Plan_Number = #{planNumber},</if>
|
|
|
|
|
<if test="Unit != null">Unit = #{Unit},</if>
|
|
|
|
|
<if test="outNumber != null">Out_Number = #{outNumber},</if>
|
|
|
|
|
<if test="locCode != null">Loc_Code = #{locCode},</if>
|
|
|
|
|
<if test="locDesc != null">Loc_Desc = #{locDesc},</if>
|
|
|
|
|
<if test="productionLineDesc != null">Production_Line_Desc = #{productionLineDesc},</if>
|
|
|
|
|
<if test="productionLineCode != null">Production_Line_Code = #{productionLineCode},</if>
|
|
|
|
|
<if test="orderStatus != null">Order_Status = #{orderStatus},</if>
|
|
|
|
|
<if test="userDefined1 != null">User_Defined1 = #{userDefined1},</if>
|
|
|
|
|
<if test="userDefined2 != null">User_Defined2 = #{userDefined2},</if>
|
|
|
|
|
<if test="userDefined3 != null">User_Defined3 = #{userDefined3},</if>
|
|
|
|
|
<if test="userDefined4 != null">User_Defined4 = #{userDefined4},</if>
|
|
|
|
|
<if test="userDefined5 != null">User_Defined5 = #{userDefined5},</if>
|
|
|
|
|
<if test="userDefined6 != null">User_Defined6 = #{userDefined6},</if>
|
|
|
|
|
<if test="userDefined7 != null">User_Defined7 = #{userDefined7},</if>
|
|
|
|
|
<if test="userDefined8 != null">User_Defined8 = #{userDefined8},</if>
|
|
|
|
|
<if test="userDefined9 != null">User_Defined9 = #{userDefined9},</if>
|
|
|
|
|
<if test="userDefined10 != null">User_Defined10 = #{userDefined10},</if>
|
|
|
|
|
<if test="userDefined11 != null">User_Defined11 = #{userDefined11},</if>
|
|
|
|
|
<if test="supplierCode != null">Supplier_Code = #{supplierCode},</if>
|
|
|
|
|
<if test="supplierName != null">Supplier_Name = #{supplierName},</if>
|
|
|
|
|
<if test="createBy != null">Create_By = #{createBy},</if>
|
|
|
|
|
<if test="createDate != null">Create_Date = #{createDate},</if>
|
|
|
|
|
<if test="lastUpdateBy != null">Last_Update_By = #{lastUpdateBy},</if>
|
|
|
|
|
<if test="lastUpdateDate != null">Last_Update_Date = #{lastUpdateDate},</if>
|
|
|
|
|
<if test="Active != null">Active = #{Active},</if>
|
|
|
|
|
<if test="enterpriseId != null">Enterprise_Id = #{enterpriseId},</if>
|
|
|
|
|
<if test="enterpriseCode != null">Enterprise_Code = #{enterpriseCode},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where ID = #{ID}
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|