万材erp项目
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.
 
 
 
 

209 lines
14 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.MaterialRequisitionHeadMapper">
<resultMap type="MaterialRequisitionHead" id="MaterialRequisitionHeadResult">
<result property="materialRequisitionNo" column="materialRequisitionNo" />
<result property="workOrderNo" column="workOrderNo" />
<result property="departmentName" column="departmentName" />
<result property="linkman" column="linkman" />
<result property="stockNo" column="stockNo" />
<result property="stockName" column="stockName" />
<result property="outputClass" column="outputClass" />
<result property="outputDate" column="outputDate" />
<result property="remark" column="remark" />
<result property="endFlag" column="endFlag" />
<result property="itemClass" column="itemClass" />
<result property="confirmFlag" column="confirmFlag" />
<result property="confirmMan" column="confirmMan" />
<result property="confirmDate" column="confirmDate" />
<result property="auditingFlag" column="auditingFlag" />
<result property="auditingMan" column="auditingMan" />
<result property="auditingDate" column="auditingDate" />
<result property="approveFlag" column="approveFlag" />
<result property="approveMan" column="approveMan" />
<result property="spproveDate" column="spproveDate" />
<result property="createDate" column="createDate" />
<result property="outsourceOrderNo" column="outsourceOrderNo" />
<result property="getFlag" column="getFlag" />
<result property="orderNo" column="orderNo" />
<result property="batchNum" column="batchNum" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
</resultMap>
<sql id="selectMaterialRequisitionHeadVo">
select materialRequisitionNo, workOrderNo, departmentName, linkman, stockNo, stockName, outputClass, outputDate, remark, endFlag, itemClass, confirmFlag, confirmMan, confirmDate, auditingFlag, auditingMan, auditingDate, approveFlag, approveMan, spproveDate, createDate, outsourceOrderNo, getFlag, orderNo, batchNum, spare1, spare2, spare3, spare4, spare5, spare6 from material_requisition_head
</sql>
<select id="selectMaterialRequisitionHeadList" parameterType="MaterialRequisitionHead" resultMap="MaterialRequisitionHeadResult">
<include refid="selectMaterialRequisitionHeadVo"/>
<where>
<if test="materialRequisitionNo != null and materialRequisitionNo != ''"> and materialRequisitionNo like concat('%', #{materialRequisitionNo}, '%')</if>
<if test="workOrderNo != null and workOrderNo != ''"> and workOrderNo like concat('%', #{workOrderNo}, '%')</if>
<if test="departmentName != null and departmentName != ''"> and departmentName like concat('%', #{departmentName}, '%')</if>
<if test="linkman != null and linkman != ''"> and linkman like concat('%', #{linkman}, '%')</if>
<if test="stockNo != null and stockNo != ''"> and stockNo like concat('%', #{stockNo}, '%')</if>
<if test="stockName != null and stockName != ''"> and stockName like concat('%', #{stockName}, '%')</if>
<if test="outputClass != null and outputClass != ''"> and outputClass = #{outputClass}</if>
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and outputDate between #{params.beginOutputDate} and #{params.endOutputDate}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="endFlag != null and endFlag != ''"> and endFlag = #{endFlag}</if>
<if test="itemClass != null and itemClass != ''"> and itemClass = #{itemClass}</if>
<if test="confirmFlag != null and confirmFlag != ''"> and confirmFlag = #{confirmFlag}</if>
<if test="confirmMan != null and confirmMan != ''"> and confirmMan like concat('%', #{confirmMan}, '%')</if>
<if test="params.beginConfirmDate != null and params.beginConfirmDate != '' and params.endConfirmDate != null and params.endConfirmDate != ''"> and confirmDate between #{params.beginConfirmDate} and #{params.endConfirmDate}</if>
<if test="auditingFlag != null and auditingFlag != ''"> and auditingFlag = #{auditingFlag}</if>
<if test="auditingMan != null and auditingMan != ''"> and auditingMan like concat('%', #{auditingMan}, '%')</if>
<if test="params.beginAuditingDate != null and params.beginAuditingDate != '' and params.endAuditingDate != null and params.endAuditingDate != ''"> and auditingDate between #{params.beginAuditingDate} and #{params.endAuditingDate}</if>
<if test="approveFlag != null and approveFlag != ''"> and approveFlag = #{approveFlag}</if>
<if test="approveMan != null and approveMan != ''"> and approveMan like concat('%', #{approveMan}, '%')</if>
<if test="params.beginSpproveDate != null and params.beginSpproveDate != '' and params.endSpproveDate != null and params.endSpproveDate != ''"> and spproveDate between #{params.beginSpproveDate} and #{params.endSpproveDate}</if>
<if test="params.beginCreateDate != null and params.beginCreateDate != '' and params.endCreateDate != null and params.endCreateDate != ''"> and createDate between #{params.beginCreateDate} and #{params.endCreateDate}</if>
<if test="outsourceOrderNo != null and outsourceOrderNo != ''"> and outsourceOrderNo like concat('%', #{outsourceOrderNo}, '%')</if>
<if test="getFlag != null and getFlag != ''"> and getFlag = #{getFlag}</if>
<if test="orderNo != null and orderNo != ''"> and orderNo like concat('%', #{orderNo}, '%')</if>
<if test="batchNum != null and batchNum != ''"> and batchNum like concat('%', #{batchNum}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
</where>
</select>
<select id="selectMaterialRequisitionHeadById" parameterType="String" resultMap="MaterialRequisitionHeadResult">
<include refid="selectMaterialRequisitionHeadVo"/>
where materialRequisitionNo = #{materialRequisitionNo}
</select>
<insert id="insertMaterialRequisitionHead" parameterType="MaterialRequisitionHead">
insert into material_requisition_head
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialRequisitionNo != null and materialRequisitionNo != ''">materialRequisitionNo,</if>
<if test="workOrderNo != null">workOrderNo,</if>
<if test="departmentName != null">departmentName,</if>
<if test="linkman != null">linkman,</if>
<if test="stockNo != null">stockNo,</if>
<if test="stockName != null">stockName,</if>
<if test="outputClass != null and outputClass != ''">outputClass,</if>
<if test="outputDate != null">outputDate,</if>
<if test="remark != null">remark,</if>
<if test="endFlag != null">endFlag,</if>
<if test="itemClass != null">itemClass,</if>
<if test="confirmFlag != null">confirmFlag,</if>
<if test="confirmMan != null">confirmMan,</if>
<if test="confirmDate != null">confirmDate,</if>
<if test="auditingFlag != null">auditingFlag,</if>
<if test="auditingMan != null">auditingMan,</if>
<if test="auditingDate != null">auditingDate,</if>
<if test="approveFlag != null">approveFlag,</if>
<if test="approveMan != null">approveMan,</if>
<if test="spproveDate != null">spproveDate,</if>
<if test="createDate != null">createDate,</if>
<if test="outsourceOrderNo != null">outsourceOrderNo,</if>
<if test="getFlag != null">getFlag,</if>
<if test="orderNo != null">orderNo,</if>
<if test="batchNum != null">batchNum,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare3 != null">spare3,</if>
<if test="spare4 != null">spare4,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare6 != null">spare6,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialRequisitionNo != null and materialRequisitionNo != ''">#{materialRequisitionNo},</if>
<if test="workOrderNo != null">#{workOrderNo},</if>
<if test="departmentName != null">#{departmentName},</if>
<if test="linkman != null">#{linkman},</if>
<if test="stockNo != null">#{stockNo},</if>
<if test="stockName != null">#{stockName},</if>
<if test="outputClass != null and outputClass != ''">#{outputClass},</if>
<if test="outputDate != null">#{outputDate},</if>
<if test="remark != null">#{remark},</if>
<if test="endFlag != null">#{endFlag},</if>
<if test="itemClass != null">#{itemClass},</if>
<if test="confirmFlag != null">#{confirmFlag},</if>
<if test="confirmMan != null">#{confirmMan},</if>
<if test="confirmDate != null">#{confirmDate},</if>
<if test="auditingFlag != null">#{auditingFlag},</if>
<if test="auditingMan != null">#{auditingMan},</if>
<if test="auditingDate != null">#{auditingDate},</if>
<if test="approveFlag != null">#{approveFlag},</if>
<if test="approveMan != null">#{approveMan},</if>
<if test="spproveDate != null">#{spproveDate},</if>
<if test="createDate != null">#{createDate},</if>
<if test="outsourceOrderNo != null">#{outsourceOrderNo},</if>
<if test="getFlag != null">#{getFlag},</if>
<if test="orderNo != null">#{orderNo},</if>
<if test="batchNum != null">#{batchNum},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="spare4 != null">#{spare4},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare6 != null">#{spare6},</if>
</trim>
</insert>
<update id="updateMaterialRequisitionHead" parameterType="MaterialRequisitionHead">
update material_requisition_head
<trim prefix="SET" suffixOverrides=",">
<if test="workOrderNo != null">workOrderNo = #{workOrderNo},</if>
<if test="departmentName != null">departmentName = #{departmentName},</if>
<if test="linkman != null">linkman = #{linkman},</if>
<if test="stockNo != null">stockNo = #{stockNo},</if>
<if test="stockName != null">stockName = #{stockName},</if>
<if test="outputClass != null and outputClass != ''">outputClass = #{outputClass},</if>
<if test="outputDate != null">outputDate = #{outputDate},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="endFlag != null">endFlag = #{endFlag},</if>
<if test="itemClass != null">itemClass = #{itemClass},</if>
<if test="confirmFlag != null">confirmFlag = #{confirmFlag},</if>
<if test="confirmMan != null">confirmMan = #{confirmMan},</if>
<if test="confirmDate != null">confirmDate = #{confirmDate},</if>
<if test="auditingFlag != null">auditingFlag = #{auditingFlag},</if>
<if test="auditingMan != null">auditingMan = #{auditingMan},</if>
<if test="auditingDate != null">auditingDate = #{auditingDate},</if>
<if test="approveFlag != null">approveFlag = #{approveFlag},</if>
<if test="approveMan != null">approveMan = #{approveMan},</if>
<if test="spproveDate != null">spproveDate = #{spproveDate},</if>
<if test="createDate != null">createDate = #{createDate},</if>
<if test="outsourceOrderNo != null">outsourceOrderNo = #{outsourceOrderNo},</if>
<if test="getFlag != null">getFlag = #{getFlag},</if>
<if test="orderNo != null">orderNo = #{orderNo},</if>
<if test="batchNum != null">batchNum = #{batchNum},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
</trim>
where materialRequisitionNo = #{materialRequisitionNo}
</update>
<delete id="deleteMaterialRequisitionHeadById" parameterType="String">
delete from material_requisition_head where materialRequisitionNo = #{materialRequisitionNo}
</delete>
<delete id="deleteMaterialRequisitionHeadByIds" parameterType="String">
delete from material_requisition_head where materialRequisitionNo in
<foreach item="materialRequisitionNo" collection="array" open="(" separator="," close=")">
#{materialRequisitionNo}
</foreach>
</delete>
<select id="selectCountByDay" resultType="Integer">
select count(*) from material_requisition_head where to_days(outputDate) = to_days(now());
</select>
</mapper>