万材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.

155 lines
9.3 KiB

2 years ago
<?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.MaterialRequisitionListMapper">
<resultMap type="MaterialRequisitionList" id="MaterialRequisitionListResult">
<result property="materialRequisitionNo" column="materialRequisitionNo" />
<result property="batchNum" column="batchNum" />
<result property="itemCode" column="itemCode" />
<result property="itemName" column="itemName" />
<result property="itemSpecification" column="itemSpecification" />
<result property="machineType" column="machineType" />
<result property="unit" column="unit" />
<result property="planQty" column="planQty" />
<result property="qty" column="qty" />
<result property="returnQty" column="returnQty" />
<result property="coinType" column="coinType" />
<result property="price" column="price" />
<result property="totalPrice" column="totalPrice" />
<result property="depositPosition" column="depositPosition" />
<result property="remark" column="remark" />
<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="selectMaterialRequisitionListVo">
select materialRequisitionNo, batchNum, itemCode, itemName, itemSpecification, machineType, unit, planQty, qty, returnQty, coinType, price, totalPrice, depositPosition, remark, spare1, spare2, spare3, spare4, spare5, spare6 from material_requisition_list
</sql>
<select id="selectMaterialRequisitionListList" parameterType="MaterialRequisitionList" resultMap="MaterialRequisitionListResult">
<include refid="selectMaterialRequisitionListVo"/>
<where>
<if test="materialRequisitionNo != null and materialRequisitionNo != ''"> and materialRequisitionNo like concat('%', #{materialRequisitionNo}, '%')</if>
<if test="batchNum != null and batchNum != ''"> and batchNum like concat('%', #{batchNum}, '%')</if>
<if test="itemCode != null and itemCode != ''"> and itemCode like concat('%', #{itemCode}, '%')</if>
<if test="itemName != null and itemName != ''"> and itemName like concat('%', #{itemName}, '%')</if>
<if test="itemSpecification != null and itemSpecification != ''"> and itemSpecification like concat('%', #{itemSpecification}, '%')</if>
<if test="machineType != null and machineType != ''"> and machineType like concat('%', #{machineType}, '%')</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
<if test="planQty != null "> and planQty = #{planQty}</if>
<if test="qty != null "> and qty = #{qty}</if>
<if test="returnQty != null "> and returnQty = #{returnQty}</if>
<if test="coinType != null and coinType != ''"> and coinType = #{coinType}</if>
<if test="price != null "> and price like concat('%', #{price}, '%')</if>
<if test="totalPrice != null "> and totalPrice like concat('%', #{totalPrice}, '%')</if>
<if test="depositPosition != null and depositPosition != ''"> and depositPosition like concat('%', #{depositPosition}, '%')</if>
<if test="remark != null and remark != ''"> and remark = #{remark}</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="selectMaterialRequisitionListById" parameterType="String" resultMap="MaterialRequisitionListResult">
<include refid="selectMaterialRequisitionListVo"/>
where materialRequisitionNo = #{materialRequisitionNo}
</select>
<insert id="insertMaterialRequisitionList" parameterType="MaterialRequisitionList">
insert into material_requisition_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialRequisitionNo != null and materialRequisitionNo != ''">materialRequisitionNo,</if>
<if test="batchNum != null">batchNum,</if>
<if test="itemCode != null">itemCode,</if>
<if test="itemName != null">itemName,</if>
<if test="itemSpecification != null">itemSpecification,</if>
<if test="machineType != null">machineType,</if>
<if test="unit != null">unit,</if>
<if test="planQty != null">planQty,</if>
<if test="qty != null">qty,</if>
<if test="returnQty != null">returnQty,</if>
<if test="coinType != null">coinType,</if>
<if test="price != null">price,</if>
<if test="totalPrice != null">totalPrice,</if>
<if test="depositPosition != null">depositPosition,</if>
<if test="remark != null">remark,</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="batchNum != null">#{batchNum},</if>
<if test="itemCode != null">#{itemCode},</if>
<if test="itemName != null">#{itemName},</if>
<if test="itemSpecification != null">#{itemSpecification},</if>
<if test="machineType != null">#{machineType},</if>
<if test="unit != null">#{unit},</if>
<if test="planQty != null">#{planQty},</if>
<if test="qty != null">#{qty},</if>
<if test="returnQty != null">#{returnQty},</if>
<if test="coinType != null">#{coinType},</if>
<if test="price != null">#{price},</if>
<if test="totalPrice != null">#{totalPrice},</if>
<if test="depositPosition != null">#{depositPosition},</if>
<if test="remark != null">#{remark},</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="updateMaterialRequisitionList" parameterType="MaterialRequisitionList">
update material_requisition_list
<trim prefix="SET" suffixOverrides=",">
<if test="batchNum != null">batchNum = #{batchNum},</if>
<if test="itemCode != null">itemCode = #{itemCode},</if>
<if test="itemName != null">itemName = #{itemName},</if>
<if test="itemSpecification != null">itemSpecification = #{itemSpecification},</if>
<if test="machineType != null">machineType = #{machineType},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="planQty != null">planQty = #{planQty},</if>
<if test="qty != null">qty = #{qty},</if>
<if test="returnQty != null">returnQty = #{returnQty},</if>
<if test="coinType != null">coinType = #{coinType},</if>
<if test="price != null">price = #{price},</if>
<if test="totalPrice != null">totalPrice = #{totalPrice},</if>
<if test="depositPosition != null">depositPosition = #{depositPosition},</if>
<if test="remark != null">remark = #{remark},</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="deleteMaterialRequisitionListById" parameterType="String">
delete from material_requisition_list where materialRequisitionNo = #{materialRequisitionNo}
</delete>
<delete id="deleteMaterialRequisitionListByIds" parameterType="String">
delete from material_requisition_list where materialRequisitionNo in
<foreach item="materialRequisitionNo" collection="array" open="(" separator="," close=")">
#{materialRequisitionNo}
</foreach>
</delete>
</mapper>