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.
156 lines
8.4 KiB
156 lines
8.4 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.CheckListMapper">
|
||
|
|
||
|
<resultMap type="CheckList" id="CheckListResult">
|
||
|
<result property="checkId" column="checkId" />
|
||
|
<result property="itemNo" column="itemNo" />
|
||
|
<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="qty" column="qty" />
|
||
|
<result property="nowQty" column="nowQty" />
|
||
|
<result property="remark" column="remark" />
|
||
|
<result property="checkQty" column="checkQty" />
|
||
|
<result property="batchNumber" column="batchNumber" />
|
||
|
<result property="isUpdate" column="isUpdate" />
|
||
|
<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="selectCheckListVo">
|
||
|
select checkId, itemNo, itemCode, itemName, itemSpecification, machineType, unit, qty, nowQty, remark, checkQty, batchNumber, isUpdate, spare1, spare2, spare3, spare4, spare5, spare6 from check_list
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectCheckListList" parameterType="CheckList" resultMap="CheckListResult">
|
||
|
<include refid="selectCheckListVo"/>
|
||
|
<where>
|
||
|
<if test="checkId != null and checkId != ''"> and checkId like concat('%', #{checkId}, '%')</if>
|
||
|
<if test="itemNo != null and itemNo != ''"> and itemNo like concat('%', #{itemNo}, '%')</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="qty != null and qty != ''"> and qty = #{qty}</if>
|
||
|
<if test="nowQty != null and nowQty != ''"> and nowQty = #{nowQty}</if>
|
||
|
<if test="checkQty != null and checkQty != ''"> and checkQty = #{checkQty}</if>
|
||
|
<if test="batchNumber != null and batchNumber != ''"> and batchNumber like concat('%', #{batchNumber}, '%')</if>
|
||
|
<if test="isUpdate != null and isUpdate != ''"> and isUpdate = #{isUpdate}</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="selectCheckListById" parameterType="String" resultMap="CheckListResult">
|
||
|
<include refid="selectCheckListVo"/>
|
||
|
where checkId = #{checkId}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertCheckList" parameterType="CheckList">
|
||
|
insert into check_list
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="checkId != null and checkId != ''">checkId,</if>
|
||
|
<if test="itemNo != null">itemNo,</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="qty != null">qty,</if>
|
||
|
<if test="nowQty != null">nowQty,</if>
|
||
|
<if test="remark != null">remark,</if>
|
||
|
<if test="checkQty != null">checkQty,</if>
|
||
|
<if test="batchNumber != null">batchNumber,</if>
|
||
|
<if test="isUpdate != null">isUpdate,</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="checkId != null and checkId != ''">#{checkId},</if>
|
||
|
<if test="itemNo != null">#{itemNo},</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="qty != null">#{qty},</if>
|
||
|
<if test="nowQty != null">#{nowQty},</if>
|
||
|
<if test="remark != null">#{remark},</if>
|
||
|
<if test="checkQty != null">#{checkQty},</if>
|
||
|
<if test="batchNumber != null">#{batchNumber},</if>
|
||
|
<if test="isUpdate != null">#{isUpdate},</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="updateCheckList" parameterType="CheckList">
|
||
|
update check_list
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="itemNo != null">itemNo = #{itemNo},</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="qty != null">qty = #{qty},</if>
|
||
|
<if test="nowQty != null">nowQty = #{nowQty},</if>
|
||
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
<if test="checkQty != null">checkQty = #{checkQty},</if>
|
||
|
<if test="batchNumber != null">batchNumber = #{batchNumber},</if>
|
||
|
<if test="isUpdate != null">isUpdate = #{isUpdate},</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 checkId = #{checkId}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteCheckListById" parameterType="String">
|
||
|
delete from check_list where checkId = #{checkId}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteCheckListByIds" parameterType="String">
|
||
|
delete from check_list where checkId in
|
||
|
<foreach item="checkId" collection="array" open="(" separator="," close=")">
|
||
|
#{checkId}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
<select id="selectByCheckId" parameterType="CheckList" resultMap="CheckListResult">
|
||
|
select * from check_list where checkId=#{checkId}
|
||
|
</select>
|
||
|
|
||
|
<select id="selectByCheckIdWithItemCode" parameterType="CheckList" resultMap="CheckListResult">
|
||
|
select * from check_list where checkId=#{checkId} and itemCode=#{itemCode}
|
||
|
</select>
|
||
|
|
||
|
<update id="updateNowQty" parameterType="CheckList">
|
||
|
update check_list set nowQty = #{nowQty},isUpdate = #{isUpdate} where checkId = #{checkId} and itemCode=#{itemCode}
|
||
|
</update>
|
||
|
|
||
|
</mapper>
|