|
@@ -0,0 +1,134 @@
|
|
|
+<?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.zkqy.business.mapper.MaterialFlowMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.zkqy.business.domain.MaterialFlow" id="MaterialFlowResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="qrCode" column="qr_code" />
|
|
|
+ <result property="qrCodeId" column="qr_code_id" />
|
|
|
+ <result property="lotNum" column="lot_num" />
|
|
|
+ <result property="productId" column="product_id" />
|
|
|
+ <result property="productName" column="product_name" />
|
|
|
+ <result property="productSpecifications" column="product_specifications" />
|
|
|
+ <result property="productColour" column="product_colour" />
|
|
|
+ <result property="productType" column="product_type" />
|
|
|
+ <result property="productWeight" column="product_weight" />
|
|
|
+ <result property="procedures" column="procedures" />
|
|
|
+ <result property="transferTime" column="transfer_time" />
|
|
|
+ <result property="transferPeople" column="transfer_people" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createById" column="create_by_id" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateById" column="update_by_id" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectMaterialFlowVo">
|
|
|
+ select id,qr_code, qr_code_id, lot_num, product_id, product_name, product_specifications, product_colour, product_type, product_weight, procedures, transfer_time, transfer_people, remark, create_by, create_by_id, create_time, update_by, update_by_id, update_time, del_flag from {DBNAME}.material_flow
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectMaterialFlowList" parameterType="com.zkqy.business.domain.MaterialFlow" resultMap="MaterialFlowResult">
|
|
|
+ <include refid="selectMaterialFlowVo"/>
|
|
|
+ where del_flag = '0'
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
|
|
|
+ <if test="qrCodeId != null and qrCodeId != ''"> and qr_code_id = #{qrCodeId}</if>
|
|
|
+ <if test="lotNum != null and lotNum != ''"> and lot_num = #{lotNum}</if>
|
|
|
+ <if test="productId != null "> and product_id = #{productId}</if>
|
|
|
+ <if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
|
|
+ <if test="productSpecifications != null and productSpecifications != ''"> and product_specifications = #{productSpecifications}</if>
|
|
|
+ <if test="productColour != null and productColour != ''"> and product_colour = #{productColour}</if>
|
|
|
+ <if test="productType != null and productType != ''"> and product_type = #{productType}</if>
|
|
|
+ <if test="productWeight != null "> and product_weight = #{productWeight}</if>
|
|
|
+ <if test="procedures != null and procedures != ''"> and procedures = #{procedures}</if>
|
|
|
+ <if test="transferTime != null "> and transfer_time = #{transferTime}</if>
|
|
|
+ <if test="transferPeople != null and transferPeople != ''"> and transfer_people = #{transferPeople}</if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMaterialFlowById" parameterType="Long" resultMap="MaterialFlowResult">
|
|
|
+ <include refid="selectMaterialFlowVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertMaterialFlow" parameterType="com.zkqy.business.domain.MaterialFlow" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into {DBNAME}.material_flow
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="qrCode != null">qr_code,</if>
|
|
|
+ <if test="qrCodeId != null">qr_code_id,</if>
|
|
|
+ <if test="lotNum != null">lot_num,</if>
|
|
|
+ <if test="productId != null">product_id,</if>
|
|
|
+ <if test="productName != null">product_name,</if>
|
|
|
+ <if test="productSpecifications != null">product_specifications,</if>
|
|
|
+ <if test="productColour != null">product_colour,</if>
|
|
|
+ <if test="productType != null">product_type,</if>
|
|
|
+ <if test="productWeight != null">product_weight,</if>
|
|
|
+ <if test="procedures != null">procedures,</if>
|
|
|
+ <if test="transferTime != null">transfer_time,</if>
|
|
|
+ <if test="transferPeople != null">transfer_people,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createById != null">create_by_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ del_flag
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="qrCode != null">#{qrCode},</if>
|
|
|
+ <if test="qrCodeId != null">#{qrCodeId},</if>
|
|
|
+ <if test="lotNum != null">#{lotNum},</if>
|
|
|
+ <if test="productId != null">#{productId},</if>
|
|
|
+ <if test="productName != null">#{productName},</if>
|
|
|
+ <if test="productSpecifications != null">#{productSpecifications},</if>
|
|
|
+ <if test="productColour != null">#{productColour},</if>
|
|
|
+ <if test="productType != null">#{productType},</if>
|
|
|
+ <if test="productWeight != null">#{productWeight},</if>
|
|
|
+ <if test="procedures != null">#{procedures},</if>
|
|
|
+ <if test="transferTime != null">#{transferTime},</if>
|
|
|
+ <if test="transferPeople != null">#{transferPeople},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createById != null">#{createById},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ '0'
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateMaterialFlow" parameterType="com.zkqy.business.domain.MaterialFlow">
|
|
|
+ update material_flow
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="lotNum != null">lot_num = #{lotNum},</if>
|
|
|
+ <if test="productId != null">product_id = #{productId},</if>
|
|
|
+ <if test="productName != null">product_name = #{productName},</if>
|
|
|
+ <if test="productSpecifications != null">product_specifications = #{productSpecifications},</if>
|
|
|
+ <if test="productColour != null">product_colour = #{productColour},</if>
|
|
|
+ <if test="productType != null">product_type = #{productType},</if>
|
|
|
+ <if test="productWeight != null">product_weight = #{productWeight},</if>
|
|
|
+ <if test="procedures != null">procedures = #{procedures},</if>
|
|
|
+ <if test="transferTime != null">transfer_time = #{transferTime},</if>
|
|
|
+ <if test="transferPeople != null">transfer_people = #{transferPeople},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createById != null">create_by_id = #{createById},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateById != null">update_by_id = #{updateById},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteMaterialFlowById" parameterType="Long">
|
|
|
+ delete from material_flow where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteMaterialFlowByIds" parameterType="String">
|
|
|
+ delete from material_flow where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|