|
@@ -0,0 +1,126 @@
|
|
|
|
+<?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.gqy.document.mapper.DcProductMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="DcProduct" id="DcProductResult">
|
|
|
|
+ <id property="dcp_id" column="dcp_id" />
|
|
|
|
+ <result property="dcp_name" column="dcp_name" />
|
|
|
|
+ <result property="dcp_model" column="dcp_model" />
|
|
|
|
+ <result property="dcp_diff" column="dcp_diff" />
|
|
|
|
+ <result property="dcp_p_no" column="dcp_p_no" />
|
|
|
|
+ <result property="dcp_status" column="dcp_status" />
|
|
|
|
+ <result property="dcp_price1" column="dcp_price1" />
|
|
|
|
+ <result property="dcp_price2" column="dcp_price2" />
|
|
|
|
+ <result property="dcp_price3" column="dcp_price3" />
|
|
|
|
+ <result property="dcp_price4" column="dcp_price4" />
|
|
|
|
+ <result property="dcp_cost_price" column="dcp_cost_price" />
|
|
|
|
+ <result property="dcm_id" column="dcm_id" />
|
|
|
|
+ <result property="dcp_oa_code" column="dcp_oa_code" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectDcProductVo">
|
|
|
|
+ select dcp_id, dcp_name, dcp_model, dcp_diff, dcp_p_no, dcp_status,
|
|
|
|
+ dcp_price1, dcp_price2, dcp_price3, dcp_price4, dcp_cost_price, dcm_id,
|
|
|
|
+ dcp_oa_code, create_by, create_time, update_by, update_time
|
|
|
|
+ from dc_product
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectDcProductList" parameterType="DcProduct" resultMap="DcProductResult">
|
|
|
|
+ <include refid="selectDcProductVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="dcp_name != null and dcp_name != ''">
|
|
|
|
+ AND dcp_name like concat('%', #{dcp_name}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dcp_model != null and dcp_model != ''">
|
|
|
|
+ AND dcp_model = #{dcp_model}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dcp_diff != null and dcp_diff != ''">
|
|
|
|
+ AND dcp_diff = #{dcp_diff}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dcp_p_no != null and dcp_p_no != ''">
|
|
|
|
+ AND dcp_p_no = #{dcp_p_no}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dcp_status != null ">
|
|
|
|
+ AND dcp_status = #{dcp_status}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dcp_oa_code != null and dcp_oa_code != ''">
|
|
|
|
+ AND dcp_oa_code = #{dcp_oa_code}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectDcProductById" parameterType="Integer" resultMap="DcProductResult">
|
|
|
|
+ <include refid="selectDcProductVo"/>
|
|
|
|
+ where dcp_id = #{dcp_id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertDcProduct" parameterType="DcProduct" useGeneratedKeys="true" keyProperty="dcp_id">
|
|
|
|
+ insert into dc_product
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="dcp_name != null">dcp_name,</if>
|
|
|
|
+ <if test="dcp_model != null">dcp_model,</if>
|
|
|
|
+ <if test="dcp_diff != null">dcp_diff,</if>
|
|
|
|
+ <if test="dcp_p_no != null">dcp_p_no,</if>
|
|
|
|
+ <if test="dcp_status != null">dcp_status,</if>
|
|
|
|
+ <if test="dcp_price1 != null">dcp_price1,</if>
|
|
|
|
+ <if test="dcp_price2 != null">dcp_price2,</if>
|
|
|
|
+ <if test="dcp_price3 != null">dcp_price3,</if>
|
|
|
|
+ <if test="dcp_price4 != null">dcp_price4,</if>
|
|
|
|
+ <if test="dcp_cost_price != null">dcp_cost_price,</if>
|
|
|
|
+ <if test="dcm_id != null">dcm_id,</if>
|
|
|
|
+ <if test="dcp_oa_code != null">dcp_oa_code,</if>
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="dcp_name != null">#{dcp_name},</if>
|
|
|
|
+ <if test="dcp_model != null">#{dcp_model},</if>
|
|
|
|
+ <if test="dcp_diff != null">#{dcp_diff},</if>
|
|
|
|
+ <if test="dcp_p_no != null">#{dcp_p_no},</if>
|
|
|
|
+ <if test="dcp_status != null">#{dcp_status},</if>
|
|
|
|
+ <if test="dcp_price1 != null">#{dcp_price1},</if>
|
|
|
|
+ <if test="dcp_price2 != null">#{dcp_price2},</if>
|
|
|
|
+ <if test="dcp_price3 != null">#{dcp_price3},</if>
|
|
|
|
+ <if test="dcp_price4 != null">#{dcp_price4},</if>
|
|
|
|
+ <if test="dcp_cost_price != null">#{dcp_cost_price},</if>
|
|
|
|
+ <if test="dcm_id != null">#{dcm_id},</if>
|
|
|
|
+ <if test="dcp_oa_code != null">#{dcp_oa_code},</if>
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateDcProduct" parameterType="DcProduct">
|
|
|
|
+ update dc_product
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="dcp_name != null">dcp_name = #{dcp_name},</if>
|
|
|
|
+ <if test="dcp_model != null">dcp_model = #{dcp_model},</if>
|
|
|
|
+ <if test="dcp_diff != null">dcp_diff = #{dcp_diff},</if>
|
|
|
|
+ <if test="dcp_p_no != null">dcp_p_no = #{dcp_p_no},</if>
|
|
|
|
+ <if test="dcp_status != null">dcp_status = #{dcp_status},</if>
|
|
|
|
+ <if test="dcp_price1 != null">dcp_price1 = #{dcp_price1},</if>
|
|
|
|
+ <if test="dcp_price2 != null">dcp_price2 = #{dcp_price2},</if>
|
|
|
|
+ <if test="dcp_price3 != null">dcp_price3 = #{dcp_price3},</if>
|
|
|
|
+ <if test="dcp_price4 != null">dcp_price4 = #{dcp_price4},</if>
|
|
|
|
+ <if test="dcp_cost_price != null">dcp_cost_price = #{dcp_cost_price},</if>
|
|
|
|
+ <if test="dcm_id != null">dcm_id = #{dcm_id},</if>
|
|
|
|
+ <if test="dcp_oa_code != null">dcp_oa_code = #{dcp_oa_code},</if>
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where dcp_id = #{dcp_id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteDcProductById" parameterType="Integer">
|
|
|
|
+ delete from dc_product where dcp_id = #{dcp_id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteDcProductByIds" parameterType="String">
|
|
|
|
+ delete from dc_product where dcp_id in
|
|
|
|
+ <foreach item="dcp_id" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{dcp_id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|