You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
227 lines
13 KiB
227 lines
13 KiB
<?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.ruoyi.produce.mapper.WorkorderheadMapper">
|
|
|
|
<resultMap type="Workorderhead" id="WorkorderheadResult">
|
|
<result property="poId" column="PO_ID" />
|
|
<result property="poNo" column="PO_NO" />
|
|
<result property="workNo" column="Work_NO" />
|
|
<result property="piNo" column="PI_NO" />
|
|
<result property="pCode" column="P_CODE" />
|
|
<result property="pName" column="P_Name" />
|
|
<result property="beginDate" column="Begin_date" />
|
|
<result property="endDate" column="End_date" />
|
|
<result property="poDate" column="PO_date" />
|
|
<result property="sendDate" column="Send_date" />
|
|
<result property="workorderClass" column="workorder_Class" />
|
|
<result property="cpCode" column="CP_CODE" />
|
|
<result property="cpName" column="CP_NAME" />
|
|
<result property="cpType" column="CP_TYPE" />
|
|
<result property="cpMachineno" column="CP_MachineNO" />
|
|
<result property="cpDw" column="CP_DW" />
|
|
<result property="cpQty" column="CP_QTY" />
|
|
<result property="ylCpQty" column="YL_CP_QTY" />
|
|
<result property="cpInQty" column="CP_IN_QTY" />
|
|
<result property="qdQty" column="QD_QTY" />
|
|
<result property="bzMemo" column="BZ_memo" />
|
|
<result property="endFlag" column="End_flag" />
|
|
<result property="chinaInOrOut" column="China_in_or_out" />
|
|
<result property="isDelete" column="Is_delete" />
|
|
<result property="cpwldm" column="cpwldm" />
|
|
<result property="nowcpstockqty" column="nowcpstockqty" />
|
|
<result property="NWX" column="NWX" />
|
|
<result property="haveprint" column="haveprint" />
|
|
<result property="bomVersionNo" column="BOM_Version_NO" />
|
|
<result property="badQty" column="BAD_QTY" />
|
|
<result property="jaMan" column="ja_man" />
|
|
<result property="jaTime" column="ja_time" />
|
|
<result property="department" column="department" />
|
|
<result property="cpWeizhi" column="CP_Weizhi" />
|
|
<result property="mjWeizhi" column="MJ_Weizhi" />
|
|
<result property="versionNo" column="Version_NO" />
|
|
<result property="Factory" column="Factory" />
|
|
<result property="madeQty" column="Made_Qty" />
|
|
<result property="qMadeQty" column="Q_Made_Qty" />
|
|
</resultMap>
|
|
|
|
<sql id="selectWorkorderheadVo">
|
|
select PO_ID, PO_NO, Work_NO, PI_NO, P_CODE, P_Name, Begin_date, End_date, PO_date, Send_date, workorder_Class, CP_CODE, CP_NAME, CP_TYPE, CP_MachineNO, CP_DW, CP_QTY, YL_CP_QTY, CP_IN_QTY, QD_QTY, BZ_memo, End_flag, China_in_or_out, Is_delete, cpwldm, nowcpstockqty, NWX, haveprint, BOM_Version_NO, BAD_QTY, ja_man, ja_time, department, CP_Weizhi, MJ_Weizhi, Version_NO, Factory, Made_Qty, Q_Made_Qty from workorderhead
|
|
</sql>
|
|
|
|
<select id="selectWorkorderheadList" parameterType="Workorderhead" resultMap="WorkorderheadResult">
|
|
<include refid="selectWorkorderheadVo"/>
|
|
<where>
|
|
<if test="poId != null and poId != ''"> and PO_ID like concat('%', #{poId}, '%')</if>
|
|
<!-- <if test="poNo != null and poNo != ''"> and PO_NO like concat('%', #{poNo}, '%')</if>-->
|
|
<if test="poNo != null and poNo != ''"> and PO_NO = #{poNo}</if>
|
|
<if test="pName != null and pName != ''"> and P_Name like concat('%', #{pName}, '%')</if>
|
|
<!-- <if test="params.beginPoDate != null and params.beginPoDate != '' and params.endPoDate != null and params.endPoDate != ''"> and PO_date between #{params.beginPoDate} and #{params.endPoDate}</if>-->
|
|
<!-- <if test="params.beginSendDate != null and params.beginSendDate != '' and params.endSendDate != null and params.endSendDate != ''"> and Send_date between #{params.beginSendDate} and #{params.endSendDate}</if>-->
|
|
<if test="params.beginPoDate != null and params.beginPoDate !=''"> and PO_date >= #{params.beginPoDate}</if>
|
|
<if test="params.endPoDate != null and params.endPoDate != ''">and #{params.endPoDate} >= PO_date</if>
|
|
|
|
<if test="params.beginSendDate != null and params.beginSendDate !=''"> and Send_date >= #{params.beginSendDate}</if>
|
|
<if test="params.endSendDate != null and params.endSendDate != ''">and #{params.endSendDate} >= Send_date</if>
|
|
<if test="workorderClass != null and workorderClass != ''"> and workorder_Class = #{workorderClass}</if>
|
|
<if test="cpCode != null and cpCode != ''"> and CP_CODE like concat('%', #{cpCode}, '%')</if>
|
|
<if test="cpName != null and cpName != ''"> and CP_NAME like concat('%', #{cpName}, '%')</if>
|
|
<if test="endFlag != null and endFlag != ''"> and End_flag = #{endFlag}</if>
|
|
<if test="NWX != null and NWX != ''"> and NWX = #{NWX}</if>
|
|
<if test="department != null and department != ''"> and department = #{department}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectWorkorderheadById" parameterType="String" resultMap="WorkorderheadResult">
|
|
<include refid="selectWorkorderheadVo"/>
|
|
where PO_ID = #{poId}
|
|
</select>
|
|
|
|
<insert id="insertWorkorderhead" parameterType="Workorderhead">
|
|
insert into workorderhead
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="poId != null and poId != ''">PO_ID,</if>
|
|
<if test="poNo != null">PO_NO,</if>
|
|
<if test="workNo != null and workNo != ''">Work_NO,</if>
|
|
<if test="piNo != null and piNo != ''">PI_NO,</if>
|
|
<if test="pCode != null and pCode != ''">P_CODE,</if>
|
|
<if test="pName != null">P_Name,</if>
|
|
<if test="beginDate != null">Begin_date,</if>
|
|
<if test="endDate != null">End_date,</if>
|
|
<if test="poDate != null">PO_date,</if>
|
|
<if test="sendDate != null">Send_date,</if>
|
|
<if test="workorderClass != null and workorderClass != ''">workorder_Class,</if>
|
|
<if test="cpCode != null and cpCode != ''">CP_CODE,</if>
|
|
<if test="cpName != null">CP_NAME,</if>
|
|
<if test="cpType != null">CP_TYPE,</if>
|
|
<if test="cpMachineno != null">CP_MachineNO,</if>
|
|
<if test="cpDw != null">CP_DW,</if>
|
|
<if test="cpQty != null">CP_QTY,</if>
|
|
<if test="ylCpQty != null">YL_CP_QTY,</if>
|
|
<if test="cpInQty != null">CP_IN_QTY,</if>
|
|
<if test="qdQty != null">QD_QTY,</if>
|
|
<if test="bzMemo != null">BZ_memo,</if>
|
|
<if test="endFlag != null">End_flag,</if>
|
|
<if test="chinaInOrOut != null">China_in_or_out,</if>
|
|
<if test="isDelete != null">Is_delete,</if>
|
|
<if test="cpwldm != null">cpwldm,</if>
|
|
<if test="nowcpstockqty != null">nowcpstockqty,</if>
|
|
<if test="NWX != null">NWX,</if>
|
|
<if test="haveprint != null">haveprint,</if>
|
|
<if test="bomVersionNo != null">BOM_Version_NO,</if>
|
|
<if test="badQty != null">BAD_QTY,</if>
|
|
<if test="jaMan != null">ja_man,</if>
|
|
<if test="jaTime != null">ja_time,</if>
|
|
<if test="department != null">department,</if>
|
|
<if test="cpWeizhi != null">CP_Weizhi,</if>
|
|
<if test="mjWeizhi != null">MJ_Weizhi,</if>
|
|
<if test="versionNo != null">Version_NO,</if>
|
|
<if test="Factory != null">Factory,</if>
|
|
<if test="madeQty != null">Made_Qty,</if>
|
|
<if test="qMadeQty != null">Q_Made_Qty,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="poId != null and poId != ''">#{poId},</if>
|
|
<if test="poNo != null">#{poNo},</if>
|
|
<if test="workNo != null and workNo != ''">#{workNo},</if>
|
|
<if test="piNo != null and piNo != ''">#{piNo},</if>
|
|
<if test="pCode != null and pCode != ''">#{pCode},</if>
|
|
<if test="pName != null">#{pName},</if>
|
|
<if test="beginDate != null">#{beginDate},</if>
|
|
<if test="endDate != null">#{endDate},</if>
|
|
<if test="poDate != null">#{poDate},</if>
|
|
<if test="sendDate != null">#{sendDate},</if>
|
|
<if test="workorderClass != null and workorderClass != ''">#{workorderClass},</if>
|
|
<if test="cpCode != null and cpCode != ''">#{cpCode},</if>
|
|
<if test="cpName != null">#{cpName},</if>
|
|
<if test="cpType != null">#{cpType},</if>
|
|
<if test="cpMachineno != null">#{cpMachineno},</if>
|
|
<if test="cpDw != null">#{cpDw},</if>
|
|
<if test="cpQty != null">#{cpQty},</if>
|
|
<if test="ylCpQty != null">#{ylCpQty},</if>
|
|
<if test="cpInQty != null">#{cpInQty},</if>
|
|
<if test="qdQty != null">#{qdQty},</if>
|
|
<if test="bzMemo != null">#{bzMemo},</if>
|
|
<if test="endFlag != null">#{endFlag},</if>
|
|
<if test="chinaInOrOut != null">#{chinaInOrOut},</if>
|
|
<if test="isDelete != null">#{isDelete},</if>
|
|
<if test="cpwldm != null">#{cpwldm},</if>
|
|
<if test="nowcpstockqty != null">#{nowcpstockqty},</if>
|
|
<if test="NWX != null">#{NWX},</if>
|
|
<if test="haveprint != null">#{haveprint},</if>
|
|
<if test="bomVersionNo != null">#{bomVersionNo},</if>
|
|
<if test="badQty != null">#{badQty},</if>
|
|
<if test="jaMan != null">#{jaMan},</if>
|
|
<if test="jaTime != null">#{jaTime},</if>
|
|
<if test="department != null">#{department},</if>
|
|
<if test="cpWeizhi != null">#{cpWeizhi},</if>
|
|
<if test="mjWeizhi != null">#{mjWeizhi},</if>
|
|
<if test="versionNo != null">#{versionNo},</if>
|
|
<if test="Factory != null">#{Factory},</if>
|
|
<if test="madeQty != null">#{madeQty},</if>
|
|
<if test="qMadeQty != null">#{qMadeQty},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateWorkorderhead" parameterType="Workorderhead">
|
|
update workorderhead
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="poNo != null">PO_NO = #{poNo},</if>
|
|
<if test="workNo != null and workNo != ''">Work_NO = #{workNo},</if>
|
|
<if test="piNo != null and piNo != ''">PI_NO = #{piNo},</if>
|
|
<if test="pCode != null and pCode != ''">P_CODE = #{pCode},</if>
|
|
<if test="pName != null">P_Name = #{pName},</if>
|
|
<if test="beginDate != null">Begin_date = #{beginDate},</if>
|
|
<if test="endDate != null">End_date = #{endDate},</if>
|
|
<if test="poDate != null">PO_date = #{poDate},</if>
|
|
<if test="sendDate != null">Send_date = #{sendDate},</if>
|
|
<if test="workorderClass != null and workorderClass != ''">workorder_Class = #{workorderClass},</if>
|
|
<if test="cpCode != null and cpCode != ''">CP_CODE = #{cpCode},</if>
|
|
<if test="cpName != null">CP_NAME = #{cpName},</if>
|
|
<if test="cpType != null">CP_TYPE = #{cpType},</if>
|
|
<if test="cpMachineno != null">CP_MachineNO = #{cpMachineno},</if>
|
|
<if test="cpDw != null">CP_DW = #{cpDw},</if>
|
|
<if test="cpQty != null">CP_QTY = #{cpQty},</if>
|
|
<if test="ylCpQty != null">YL_CP_QTY = #{ylCpQty},</if>
|
|
<if test="cpInQty != null">CP_IN_QTY = #{cpInQty},</if>
|
|
<if test="qdQty != null">QD_QTY = #{qdQty},</if>
|
|
<if test="bzMemo != null">BZ_memo = #{bzMemo},</if>
|
|
<if test="endFlag != null">End_flag = #{endFlag},</if>
|
|
<if test="chinaInOrOut != null">China_in_or_out = #{chinaInOrOut},</if>
|
|
<if test="isDelete != null">Is_delete = #{isDelete},</if>
|
|
<if test="cpwldm != null">cpwldm = #{cpwldm},</if>
|
|
<if test="nowcpstockqty != null">nowcpstockqty = #{nowcpstockqty},</if>
|
|
<if test="NWX != null">NWX = #{NWX},</if>
|
|
<if test="haveprint != null">haveprint = #{haveprint},</if>
|
|
<if test="bomVersionNo != null">BOM_Version_NO = #{bomVersionNo},</if>
|
|
<if test="badQty != null">BAD_QTY = #{badQty},</if>
|
|
<if test="jaMan != null">ja_man = #{jaMan},</if>
|
|
<if test="jaTime != null">ja_time = #{jaTime},</if>
|
|
<if test="department != null">department = #{department},</if>
|
|
<if test="cpWeizhi != null">CP_Weizhi = #{cpWeizhi},</if>
|
|
<if test="mjWeizhi != null">MJ_Weizhi = #{mjWeizhi},</if>
|
|
<if test="versionNo != null">Version_NO = #{versionNo},</if>
|
|
<if test="Factory != null">Factory = #{Factory},</if>
|
|
<if test="madeQty != null">Made_Qty = #{madeQty},</if>
|
|
<if test="qMadeQty != null">Q_Made_Qty = #{qMadeQty},</if>
|
|
</trim>
|
|
where PO_ID = #{poId}
|
|
</update>
|
|
|
|
<delete id="deleteWorkorderheadById" parameterType="String">
|
|
delete from workorderhead where PO_ID = #{poId}
|
|
</delete>
|
|
|
|
<delete id="deleteWorkorderheadByIds" parameterType="String">
|
|
delete from workorderhead where PO_ID in
|
|
<foreach item="poId" collection="array" open="(" separator="," close=")">
|
|
#{poId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectCountByDay" resultType="Integer">
|
|
select count(*) from workorderhead where to_days(PO_date)=to_days(now())
|
|
</select>
|
|
|
|
</mapper>
|