|
@@ -0,0 +1,141 @@
|
|
|
+<?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.dgtly.goods.mapper.GoodsInfoMapper">
|
|
|
+
|
|
|
+ <resultMap type="GoodsInfo" id="GoodsInfoResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
+ <result property="typeId" column="type_id" />
|
|
|
+ <result property="price" column="price" />
|
|
|
+ <result property="cover" column="cover" />
|
|
|
+ <result property="slideshow" column="slideshow" />
|
|
|
+ <result property="describe" column="describe" />
|
|
|
+ <result property="delivery" column="delivery" />
|
|
|
+ <result property="producedTime" column="produced_time" />
|
|
|
+ <result property="producedAddress" column="produced_address" />
|
|
|
+ <result property="warehouseAddress" column="warehouse_address" />
|
|
|
+ <result property="weight" column="weight" />
|
|
|
+ <result property="putawayFlag" column="putaway_flag" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectGoodsInfoVo">
|
|
|
+ select id, name, company_id, type_id, price, cover, slideshow, describe, delivery, produced_time, produced_address, warehouse_address, weight, putaway_flag, del_flag, create_time, create_by, update_time, update_by, remark from goods_info
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectGoodsInfoList" parameterType="GoodsInfo" resultMap="GoodsInfoResult">
|
|
|
+ <include refid="selectGoodsInfoVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
+ <if test="typeId != null "> and type_id = #{typeId}</if>
|
|
|
+ <if test="price != null "> and price = #{price}</if>
|
|
|
+ <if test="cover != null and cover != ''"> and cover = #{cover}</if>
|
|
|
+ <if test="slideshow != null and slideshow != ''"> and slideshow = #{slideshow}</if>
|
|
|
+ <if test="describe != null and describe != ''"> and describe = #{describe}</if>
|
|
|
+ <if test="delivery != null and delivery != ''"> and delivery = #{delivery}</if>
|
|
|
+ <if test="producedTime != null "> and produced_time = #{producedTime}</if>
|
|
|
+ <if test="producedAddress != null and producedAddress != ''"> and produced_address = #{producedAddress}</if>
|
|
|
+ <if test="warehouseAddress != null and warehouseAddress != ''"> and warehouse_address = #{warehouseAddress}</if>
|
|
|
+ <if test="weight != null and weight != ''"> and weight = #{weight}</if>
|
|
|
+ <if test="putawayFlag != null and putawayFlag != ''"> and putaway_flag = #{putawayFlag}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectGoodsInfoById" parameterType="Long" resultMap="GoodsInfoResult">
|
|
|
+ <include refid="selectGoodsInfoVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertGoodsInfo" parameterType="GoodsInfo" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into goods_info
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
+ <if test="companyId != null ">company_id,</if>
|
|
|
+ <if test="typeId != null ">type_id,</if>
|
|
|
+ <if test="price != null ">price,</if>
|
|
|
+ <if test="cover != null and cover != ''">cover,</if>
|
|
|
+ <if test="slideshow != null and slideshow != ''">slideshow,</if>
|
|
|
+ <if test="describe != null and describe != ''">describe,</if>
|
|
|
+ <if test="delivery != null and delivery != ''">delivery,</if>
|
|
|
+ <if test="producedTime != null ">produced_time,</if>
|
|
|
+ <if test="producedAddress != null and producedAddress != ''">produced_address,</if>
|
|
|
+ <if test="warehouseAddress != null and warehouseAddress != ''">warehouse_address,</if>
|
|
|
+ <if test="weight != null and weight != ''">weight,</if>
|
|
|
+ <if test="putawayFlag != null and putawayFlag != ''">putaway_flag,</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
|
+ <if test="createTime != null ">create_time,</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
+ <if test="updateTime != null ">update_time,</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
|
+ <if test="remark != null and remark != ''">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
+ <if test="companyId != null ">#{companyId},</if>
|
|
|
+ <if test="typeId != null ">#{typeId},</if>
|
|
|
+ <if test="price != null ">#{price},</if>
|
|
|
+ <if test="cover != null and cover != ''">#{cover},</if>
|
|
|
+ <if test="slideshow != null and slideshow != ''">#{slideshow},</if>
|
|
|
+ <if test="describe != null and describe != ''">#{describe},</if>
|
|
|
+ <if test="delivery != null and delivery != ''">#{delivery},</if>
|
|
|
+ <if test="producedTime != null ">#{producedTime},</if>
|
|
|
+ <if test="producedAddress != null and producedAddress != ''">#{producedAddress},</if>
|
|
|
+ <if test="warehouseAddress != null and warehouseAddress != ''">#{warehouseAddress},</if>
|
|
|
+ <if test="weight != null and weight != ''">#{weight},</if>
|
|
|
+ <if test="putawayFlag != null and putawayFlag != ''">#{putawayFlag},</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
|
+ <if test="createTime != null ">#{createTime},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
+ <if test="updateTime != null ">#{updateTime},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
|
+ <if test="remark != null and remark != ''">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateGoodsInfo" parameterType="GoodsInfo">
|
|
|
+ update goods_info
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
+ <if test="companyId != null ">company_id = #{companyId},</if>
|
|
|
+ <if test="typeId != null ">type_id = #{typeId},</if>
|
|
|
+ <if test="price != null ">price = #{price},</if>
|
|
|
+ <if test="cover != null and cover != ''">cover = #{cover},</if>
|
|
|
+ <if test="slideshow != null and slideshow != ''">slideshow = #{slideshow},</if>
|
|
|
+ <if test="describe != null and describe != ''">describe = #{describe},</if>
|
|
|
+ <if test="delivery != null and delivery != ''">delivery = #{delivery},</if>
|
|
|
+ <if test="producedTime != null ">produced_time = #{producedTime},</if>
|
|
|
+ <if test="producedAddress != null and producedAddress != ''">produced_address = #{producedAddress},</if>
|
|
|
+ <if test="warehouseAddress != null and warehouseAddress != ''">warehouse_address = #{warehouseAddress},</if>
|
|
|
+ <if test="weight != null and weight != ''">weight = #{weight},</if>
|
|
|
+ <if test="putawayFlag != null and putawayFlag != ''">putaway_flag = #{putawayFlag},</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
|
+ <if test="createTime != null ">create_time = #{createTime},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
|
+ <if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
+ <if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteGoodsInfoById" parameterType="Long">
|
|
|
+ delete from goods_info where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteGoodsInfoByIds" parameterType="String">
|
|
|
+ delete from goods_info where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|