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.
154 lines
10 KiB
154 lines
10 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.stock.mapper.WarehousingCheckMapper">
|
|
|
|
<resultMap type="WarehousingCheck" id="WarehousingCheckResult">
|
|
<result property="warehousingcheckId" column="warehousingCheck_id" />
|
|
<result property="warehousingnoticeId" column="warehousingNotice_id" />
|
|
<result property="materialCode" column="material_Code" />
|
|
<result property="materialName" column="material_name" />
|
|
<result property="specificationModel" column="specificationModel" />
|
|
<result property="machineType" column="machineType" />
|
|
<result property="unit" column="unit" />
|
|
<result property="orderAmt" column="order_amt" />
|
|
<result property="qualifiedAmt" column="qualified_amt" />
|
|
<result property="unqualifiedAmt" column="unqualified_amt" />
|
|
<result property="qualifiedRate" column="qualifiedRate" />
|
|
<result property="note" column="note" />
|
|
<result property="batchNumber" column="batchNumber" />
|
|
<result property="notcieTime" column="notcieTime" />
|
|
<result property="checkTime" column="checkTime" />
|
|
<result property="isQualified" column="isQualified" />
|
|
<result property="inspector" column="inspector" />
|
|
<result property="spell1" column="spell_1" />
|
|
<result property="spell2" column="spell_2" />
|
|
<result property="spell3" column="spell_3" />
|
|
</resultMap>
|
|
|
|
<sql id="selectWarehousingCheckVo">
|
|
select warehousingCheck_id, warehousingNotice_id, material_Code, material_name, specificationModel, machineType, unit, order_amt, qualified_amt, unqualified_amt, qualifiedRate, note, batchNumber, notcieTime, checkTime, isQualified, inspector, spell_1, spell_2, spell_3 from warehousing_check
|
|
</sql>
|
|
|
|
<select id="selectWarehousingCheckList" parameterType="WarehousingCheck" resultMap="WarehousingCheckResult">
|
|
<include refid="selectWarehousingCheckVo"/>
|
|
<where>
|
|
<if test="warehousingnoticeId != null and warehousingnoticeId != ''"> and warehousingNotice_id like concat('%', #{warehousingnoticeId}, '%')</if>
|
|
<if test="materialCode != null and materialCode != ''"> and material_Code like concat('%', #{materialCode}, '%')</if>
|
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
|
<if test="specificationModel != null and specificationModel != ''"> and specificationModel like concat('%', #{specificationModel}, '%')</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="orderAmt != null "> and order_amt = #{orderAmt}</if>
|
|
<if test="qualifiedAmt != null "> and qualified_amt = #{qualifiedAmt}</if>
|
|
<if test="unqualifiedAmt != null "> and unqualified_amt = #{unqualifiedAmt}</if>
|
|
<if test="qualifiedRate != null and qualifiedRate != ''"> and qualifiedRate = #{qualifiedRate}</if>
|
|
<if test="note != null and note != ''"> and note like concat('%', #{note}, '%')</if>
|
|
<if test="batchNumber != null and batchNumber != ''"> and batchNumber like concat('%', #{batchNumber}, '%')</if>
|
|
<if test="params.beginNotcieTime != null and params.beginNotcieTime != '' and params.endNotcieTime != null and params.endNotcieTime != ''"> and notcieTime between #{params.beginNotcieTime} and #{params.endNotcieTime}</if>
|
|
<if test="params.beginCheckTime != null and params.beginCheckTime != '' and params.endCheckTime != null and params.endCheckTime != ''"> and checkTime between #{params.beginCheckTime} and #{params.endCheckTime}</if>
|
|
<if test="isQualified != null "> and isQualified = #{isQualified}</if>
|
|
<if test="inspector != null and inspector != ''"> and inspector like concat('%', #{inspector}, '%')</if>
|
|
<if test="spell1 != null and spell1 != ''"> and spell_1 = #{spell1}</if>
|
|
<if test="spell2 != null and spell2 != ''"> and spell_2 = #{spell2}</if>
|
|
<if test="spell3 != null and spell3 != ''"> and spell_3 = #{spell3}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectWarehousingCheckById" parameterType="String" resultMap="WarehousingCheckResult">
|
|
<include refid="selectWarehousingCheckVo"/>
|
|
where warehousingCheck_id = #{warehousingcheckId}
|
|
</select>
|
|
|
|
<insert id="insertWarehousingCheck" parameterType="WarehousingCheck">
|
|
insert into warehousing_check
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="warehousingcheckId != null">warehousingCheck_id,</if>
|
|
<if test="warehousingnoticeId != null and warehousingnoticeId != ''">warehousingNotice_id,</if>
|
|
<if test="materialCode != null and materialCode != ''">material_Code,</if>
|
|
<if test="materialName != null and materialName != ''">material_name,</if>
|
|
<if test="specificationModel != null and specificationModel != ''">specificationModel,</if>
|
|
<if test="machineType != null and machineType != ''">machineType,</if>
|
|
<if test="unit != null and unit != ''">unit,</if>
|
|
<if test="orderAmt != null">order_amt,</if>
|
|
<if test="qualifiedAmt != null">qualified_amt,</if>
|
|
<if test="unqualifiedAmt != null">unqualified_amt,</if>
|
|
<if test="qualifiedRate != null">qualifiedRate,</if>
|
|
<if test="note != null">note,</if>
|
|
<if test="batchNumber != null">batchNumber,</if>
|
|
<if test="notcieTime != null">notcieTime,</if>
|
|
<if test="checkTime != null">checkTime,</if>
|
|
<if test="isQualified != null">isQualified,</if>
|
|
<if test="inspector != null">inspector,</if>
|
|
<if test="spell1 != null">spell_1,</if>
|
|
<if test="spell2 != null">spell_2,</if>
|
|
<if test="spell3 != null">spell_3,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="warehousingcheckId != null">#{warehousingcheckId},</if>
|
|
<if test="warehousingnoticeId != null and warehousingnoticeId != ''">#{warehousingnoticeId},</if>
|
|
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
|
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
|
<if test="specificationModel != null and specificationModel != ''">#{specificationModel},</if>
|
|
<if test="machineType != null and machineType != ''">#{machineType},</if>
|
|
<if test="unit != null and unit != ''">#{unit},</if>
|
|
<if test="orderAmt != null">#{orderAmt},</if>
|
|
<if test="qualifiedAmt != null">#{qualifiedAmt},</if>
|
|
<if test="unqualifiedAmt != null">#{unqualifiedAmt},</if>
|
|
<if test="qualifiedRate != null">#{qualifiedRate},</if>
|
|
<if test="note != null">#{note},</if>
|
|
<if test="batchNumber != null">#{batchNumber},</if>
|
|
<if test="notcieTime != null">#{notcieTime},</if>
|
|
<if test="checkTime != null">#{checkTime},</if>
|
|
<if test="isQualified != null">#{isQualified},</if>
|
|
<if test="inspector != null">#{inspector},</if>
|
|
<if test="spell1 != null">#{spell1},</if>
|
|
<if test="spell2 != null">#{spell2},</if>
|
|
<if test="spell3 != null">#{spell3},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateWarehousingCheck" parameterType="WarehousingCheck">
|
|
update warehousing_check
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="warehousingnoticeId != null and warehousingnoticeId != ''">warehousingNotice_id = #{warehousingnoticeId},</if>
|
|
<if test="materialCode != null and materialCode != ''">material_Code = #{materialCode},</if>
|
|
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
|
|
<if test="specificationModel != null and specificationModel != ''">specificationModel = #{specificationModel},</if>
|
|
<if test="machineType != null and machineType != ''">machineType = #{machineType},</if>
|
|
<if test="unit != null and unit != ''">unit = #{unit},</if>
|
|
<if test="orderAmt != null">order_amt = #{orderAmt},</if>
|
|
<if test="qualifiedAmt != null">qualified_amt = #{qualifiedAmt},</if>
|
|
<if test="unqualifiedAmt != null">unqualified_amt = #{unqualifiedAmt},</if>
|
|
<if test="qualifiedRate != null">qualifiedRate = #{qualifiedRate},</if>
|
|
<if test="note != null">note = #{note},</if>
|
|
<if test="batchNumber != null">batchNumber = #{batchNumber},</if>
|
|
<if test="notcieTime != null">notcieTime = #{notcieTime},</if>
|
|
<if test="checkTime != null">checkTime = #{checkTime},</if>
|
|
<if test="isQualified != null">isQualified = #{isQualified},</if>
|
|
<if test="inspector != null">inspector = #{inspector},</if>
|
|
<if test="spell1 != null and spell1 != ''">spell_1 = #{spell1},</if>
|
|
<if test="spell2 != null and spell2 != ''">spell_2 = #{spell2},</if>
|
|
<if test="spell3 != null and spell3 != ''">spell_3 = #{spell3},</if>
|
|
</trim>
|
|
where warehousingNotice_id = #{warehousingnoticeId}
|
|
</update>
|
|
|
|
<delete id="deleteWarehousingCheckById" parameterType="String">
|
|
delete from warehousing_check where warehousingCheck_id = #{warehousingcheckId}
|
|
</delete>
|
|
|
|
<delete id="deleteWarehousingCheckByIds" parameterType="String">
|
|
delete from warehousing_check where warehousingCheck_id in
|
|
<foreach item="warehousingcheckId" collection="array" open="(" separator="," close=")">
|
|
#{warehousingcheckId}
|
|
</foreach>
|
|
</delete>
|
|
<select id="selectTodayWarehousingCheckTimes" parameterType="String" resultType="String">
|
|
select COUNT(*)+1
|
|
from warehousing_check
|
|
where warehousingCheck_id like CONCAT("WCNO", date_format(now(), '%Y%m%d'), "%");
|
|
|
|
</select>
|
|
</mapper>
|