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

160 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.stock.mapper.StockAdjustMapper">
<resultMap type="StockAdjust" id="StockAdjustResult">
<result property="id" column="id" />
<result property="registerDate" column="registerDate" />
<result property="itemType" column="itemType" />
<result property="stockNo" column="stockNo" />
<result property="stockName" column="stockName" />
<result property="itemCode" column="itemCode" />
<result property="itemName" column="itemName" />
<result property="machineType" column="machineType" />
<result property="itemSpecification" column="itemSpecification" />
<result property="unit" column="unit" />
<result property="customerNo" column="customerNo" />
<result property="customerName" column="customerName" />
<result property="batchNumber" column="batchNumber" />
<result property="adjustQty" column="adjustQty" />
<result property="adjustReel" column="adjustReel" />
<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="selectStockAdjustVo">
select id, registerDate, itemType, stockNo, stockName, itemCode, itemName, machineType, itemSpecification, unit, customerNo, customerName, batchNumber, adjustQty, adjustReel, remark, spare1, spare2, spare3, spare4, spare5, spare6 from stock_adjust
</sql>
<select id="selectStockAdjustList" parameterType="StockAdjust" resultMap="StockAdjustResult">
<include refid="selectStockAdjustVo"/>
<where>
<if test="id != null "> and id like concat('%', #{id}, '%')</if>
<if test="params.beginRegisterDate != null and params.beginRegisterDate !=''"> and registerDate >= #{params.beginRegisterDate}</if>
<if test="params.endRegisterDate != null and params.endRegisterDate != ''">and #{params.endRegisterDate} >= registerDate</if>
<if test="itemType != null and itemType != ''"> and itemType = #{itemType}</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="itemCode != null and itemCode != ''"> and itemCode like concat('%', #{itemCode}, '%')</if>
<if test="itemName != null and itemName != ''"> and itemName like concat('%', #{itemName}, '%')</if>
<if test="machineType != null and machineType != ''"> and machineType like concat('%', #{machineType}, '%')</if>
<if test="itemSpecification != null and itemSpecification != ''"> and itemSpecification like concat('%', #{itemSpecification}, '%')</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
<if test="customerNo != null and customerNo != ''"> and customerNo like concat('%', #{customerNo}, '%')</if>
<if test="customerName != null and customerName != ''"> and customerName like concat('%', #{customerName}, '%')</if>
<if test="batchNumber != null and batchNumber != ''"> and batchNumber like concat('%', #{batchNumber}, '%')</if>
<if test="adjustQty != null "> and adjustQty = #{adjustQty}</if>
<if test="adjustReel != null "> and adjustReel = #{adjustReel}</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="selectStockAdjustById" parameterType="Long" resultMap="StockAdjustResult">
<include refid="selectStockAdjustVo"/>
where id = #{id}
</select>
<insert id="insertStockAdjust" parameterType="StockAdjust">
insert into stock_adjust
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="registerDate != null">registerDate,</if>
<if test="itemType != null">itemType,</if>
<if test="stockNo != null">stockNo,</if>
<if test="stockName != null">stockName,</if>
<if test="itemCode != null">itemCode,</if>
<if test="itemName != null">itemName,</if>
<if test="machineType != null">machineType,</if>
<if test="itemSpecification != null">itemSpecification,</if>
<if test="unit != null">unit,</if>
<if test="customerNo != null">customerNo,</if>
<if test="customerName != null">customerName,</if>
<if test="batchNumber != null">batchNumber,</if>
<if test="adjustQty != null">adjustQty,</if>
<if test="adjustReel != null">adjustReel,</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="id != null">#{id},</if>
<if test="registerDate != null">#{registerDate},</if>
<if test="itemType != null">#{itemType},</if>
<if test="stockNo != null">#{stockNo},</if>
<if test="stockName != null">#{stockName},</if>
<if test="itemCode != null">#{itemCode},</if>
<if test="itemName != null">#{itemName},</if>
<if test="machineType != null">#{machineType},</if>
<if test="itemSpecification != null">#{itemSpecification},</if>
<if test="unit != null">#{unit},</if>
<if test="customerNo != null">#{customerNo},</if>
<if test="customerName != null">#{customerName},</if>
<if test="batchNumber != null">#{batchNumber},</if>
<if test="adjustQty != null">#{adjustQty},</if>
<if test="adjustReel != null">#{adjustReel},</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="updateStockAdjust" parameterType="StockAdjust">
update stock_adjust
<trim prefix="SET" suffixOverrides=",">
<if test="registerDate != null">registerDate = #{registerDate},</if>
<if test="itemType != null">itemType = #{itemType},</if>
<if test="stockNo != null">stockNo = #{stockNo},</if>
<if test="stockName != null">stockName = #{stockName},</if>
<if test="itemCode != null">itemCode = #{itemCode},</if>
<if test="itemName != null">itemName = #{itemName},</if>
<if test="machineType != null">machineType = #{machineType},</if>
<if test="itemSpecification != null">itemSpecification = #{itemSpecification},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="customerNo != null">customerNo = #{customerNo},</if>
<if test="customerName != null">customerName = #{customerName},</if>
<if test="batchNumber != null">batchNumber = #{batchNumber},</if>
<if test="adjustQty != null">adjustQty = #{adjustQty},</if>
<if test="adjustReel != null">adjustReel = #{adjustReel},</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 id = #{id}
</update>
<delete id="deleteStockAdjustById" parameterType="Long">
delete from stock_adjust where id = #{id}
</delete>
<delete id="deleteStockAdjustByIds" parameterType="String">
delete from stock_adjust where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>