|
@@ -0,0 +1,146 @@
|
|
|
+<?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.ProductionMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.zkqy.business.domain.Production" id="ProductionResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="productNo" column="product_no" />
|
|
|
+ <result property="productName" column="product_name" />
|
|
|
+ <result property="productSpecifications" column="product_specifications" />
|
|
|
+ <result property="productColor" column="product_color" />
|
|
|
+ <result property="productType" column="product_type" />
|
|
|
+ <result property="productDescribe" column="product_describe" />
|
|
|
+ <result property="productUnit" column="product_unit" />
|
|
|
+ <result property="productTypeNo" column="product_type_no" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="createById" column="create_by_id" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateById" column="update_by_id" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="taskProcessKey" column="task_process_key" />
|
|
|
+ <result property="taskNodeKey" column="task_node_key" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectProductionVo">
|
|
|
+ select id, product_no, product_name, product_specifications, product_color, product_type, product_describe, product_unit, product_type_no, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key from {DBNAME}.production
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectProductionList" parameterType="com.zkqy.business.domain.Production" resultMap="ProductionResult">
|
|
|
+ <include refid="selectProductionVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="productNo != null and productNo != ''"> and product_no = #{productNo}</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="productColor != null and productColor != ''"> and product_color = #{productColor}</if>
|
|
|
+ <if test="productType != null and productType != ''"> and product_type = #{productType}</if>
|
|
|
+ <if test="productDescribe != null and productDescribe != ''"> and product_describe = #{productDescribe}</if>
|
|
|
+ <if test="productUnit != null and productUnit != ''"> and product_unit = #{productUnit}</if>
|
|
|
+ <if test="productTypeNo != null "> and product_type_no = #{productTypeNo}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectProductionById" parameterType="Long" resultMap="ProductionResult">
|
|
|
+ <include refid="selectProductionVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertProduction" parameterType="com.zkqy.business.domain.Production" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into production
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="productNo != null">product_no,</if>
|
|
|
+ <if test="productName != null">product_name,</if>
|
|
|
+ <if test="productSpecifications != null">product_specifications,</if>
|
|
|
+ <if test="productColor != null">product_color,</if>
|
|
|
+ <if test="productType != null">product_type,</if>
|
|
|
+ <if test="productDescribe != null">product_describe,</if>
|
|
|
+ <if test="productUnit != null">product_unit,</if>
|
|
|
+ <if test="productTypeNo != null">product_type_no,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="createById != null">create_by_id,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateById != null">update_by_id,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="taskProcessKey != null">task_process_key,</if>
|
|
|
+ <if test="taskNodeKey != null">task_node_key,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="productNo != null">#{productNo},</if>
|
|
|
+ <if test="productName != null">#{productName},</if>
|
|
|
+ <if test="productSpecifications != null">#{productSpecifications},</if>
|
|
|
+ <if test="productColor != null">#{productColor},</if>
|
|
|
+ <if test="productType != null">#{productType},</if>
|
|
|
+ <if test="productDescribe != null">#{productDescribe},</if>
|
|
|
+ <if test="productUnit != null">#{productUnit},</if>
|
|
|
+ <if test="productTypeNo != null">#{productTypeNo},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="createById != null">#{createById},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateById != null">#{updateById},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="taskProcessKey != null">#{taskProcessKey},</if>
|
|
|
+ <if test="taskNodeKey != null">#{taskNodeKey},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateProduction" parameterType="com.zkqy.business.domain.Production">
|
|
|
+ update production
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="productNo != null">product_no = #{productNo},</if>
|
|
|
+ <if test="productName != null">product_name = #{productName},</if>
|
|
|
+ <if test="productSpecifications != null">product_specifications = #{productSpecifications},</if>
|
|
|
+ <if test="productColor != null">product_color = #{productColor},</if>
|
|
|
+ <if test="productType != null">product_type = #{productType},</if>
|
|
|
+ <if test="productDescribe != null">product_describe = #{productDescribe},</if>
|
|
|
+ <if test="productUnit != null">product_unit = #{productUnit},</if>
|
|
|
+ <if test="productTypeNo != null">product_type_no = #{productTypeNo},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="createById != null">create_by_id = #{createById},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateById != null">update_by_id = #{updateById},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
|
|
|
+ <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteProductionById" parameterType="Long">
|
|
|
+ delete from production where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteProductionByIds" parameterType="String">
|
|
|
+ delete from production where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="selectSaleOrderProductionList" parameterType="com.zkqy.business.domain.Production" resultMap="ProductionResult">
|
|
|
+ <include refid="selectProductionVo"/>
|
|
|
+ where del_flag = '0'
|
|
|
+ <if test="productNo != null and productNo != ''"> and product_no = #{productNo}</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="productColor != null and productColor != ''"> and product_color = #{productColor}</if>
|
|
|
+ <if test="productType != null and productType != ''"> and product_type = #{productType}</if>
|
|
|
+ <if test="productDescribe != null and productDescribe != ''"> and product_describe = #{productDescribe}</if>
|
|
|
+ <if test="productUnit != null and productUnit != ''"> and product_unit = #{productUnit}</if>
|
|
|
+ <if test="productTypeNo != null "> and product_type_no = #{productTypeNo}</if>
|
|
|
+ order by product_name asc
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|