|
@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<resultMap type="GoodsType" id="GoodsTypeResult">
|
|
<resultMap type="GoodsType" id="GoodsTypeResult">
|
|
|
<result property="id" column="id" />
|
|
<result property="id" column="id" />
|
|
|
<result property="name" column="name" />
|
|
<result property="name" column="name" />
|
|
|
|
|
+ <result property="img" column="img" />
|
|
|
<result property="parentId" column="parent_id" />
|
|
<result property="parentId" column="parent_id" />
|
|
|
<result property="ancestors" column="ancestors" />
|
|
<result property="ancestors" column="ancestors" />
|
|
|
<result property="createTime" column="create_time" />
|
|
<result property="createTime" column="create_time" />
|
|
@@ -14,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="remark" column="remark" />
|
|
<result property="remark" column="remark" />
|
|
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
<collection property="goodsTypeAttributes" javaType="java.util.List" resultMap="GoodsTypeAttributeResult" />
|
|
<collection property="goodsTypeAttributes" javaType="java.util.List" resultMap="GoodsTypeAttributeResult" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
@@ -25,7 +27,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectGoodsTypeVo">
|
|
<sql id="selectGoodsTypeVo">
|
|
|
- select gt.id, gt.name, gt.parent_id, gt.ancestors, gt.create_time, gt.create_by, gt.update_time, gt.update_by, gt.remark,
|
|
|
|
|
|
|
+ select gt.id, gt.name, gt.parent_id, gt.img,gt.ancestors, gt.create_time, gt.create_by, gt.update_time,
|
|
|
|
|
+ gt.update_by, gt.remark,gt.del_flag,
|
|
|
gta.id attributeId,gta.type_id,gta.attribute_name,gta.sort
|
|
gta.id attributeId,gta.type_id,gta.attribute_name,gta.sort
|
|
|
from goods_type gt
|
|
from goods_type gt
|
|
|
left join goods_type_attribute gta on gta.type_id = gt.id
|
|
left join goods_type_attribute gta on gta.type_id = gt.id
|
|
@@ -33,7 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="selectGoodsTypeList" parameterType="GoodsType" resultMap="GoodsTypeResult">
|
|
<select id="selectGoodsTypeList" parameterType="GoodsType" resultMap="GoodsTypeResult">
|
|
|
<include refid="selectGoodsTypeVo"/>
|
|
<include refid="selectGoodsTypeVo"/>
|
|
|
- <where>
|
|
|
|
|
|
|
+ <where>
|
|
|
|
|
+ gt.del_flag= '0'
|
|
|
<if test="name != null and name != ''"> and gt.name like concat('%', #{name}, '%')</if>
|
|
<if test="name != null and name != ''"> and gt.name like concat('%', #{name}, '%')</if>
|
|
|
<if test="parentId != null "> and gt.parent_id = #{parentId}</if>
|
|
<if test="parentId != null "> and gt.parent_id = #{parentId}</if>
|
|
|
<if test="ancestors != null and ancestors != ''"> and gt.ancestors = #{ancestors}</if>
|
|
<if test="ancestors != null and ancestors != ''"> and gt.ancestors = #{ancestors}</if>
|
|
@@ -52,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
insert into goods_type
|
|
insert into goods_type
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="name != null and name != ''">name,</if>
|
|
<if test="name != null and name != ''">name,</if>
|
|
|
|
|
+ <if test="img != null and img != ''">img,</if>
|
|
|
<if test="parentId != null ">parent_id,</if>
|
|
<if test="parentId != null ">parent_id,</if>
|
|
|
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
|
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
|
|
<if test="createTime != null ">create_time,</if>
|
|
<if test="createTime != null ">create_time,</if>
|
|
@@ -62,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
|
|
|
+ <if test="img != null and img != ''">#{img},</if>
|
|
|
<if test="parentId != null ">#{parentId},</if>
|
|
<if test="parentId != null ">#{parentId},</if>
|
|
|
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
|
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
|
|
<if test="createTime != null ">#{createTime},</if>
|
|
<if test="createTime != null ">#{createTime},</if>
|
|
@@ -78,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
|
<if test="parentId != null ">parent_id = #{parentId},</if>
|
|
<if test="parentId != null ">parent_id = #{parentId},</if>
|
|
|
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
|
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
|
|
|
|
+ <if test="img != null and img != ''">img = #{img},</if>
|
|
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
@@ -88,11 +95,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteGoodsTypeById" parameterType="Long">
|
|
<delete id="deleteGoodsTypeById" parameterType="Long">
|
|
|
- delete from goods_type where id = #{id}
|
|
|
|
|
|
|
+ update goods_type set del_flag = '2' where id = #{id}
|
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteGoodsTypeByIds" parameterType="String">
|
|
<delete id="deleteGoodsTypeByIds" parameterType="String">
|
|
|
- delete from goods_type where id in
|
|
|
|
|
|
|
+ update goods_type set del_flag = '2' where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
#{id}
|
|
|
</foreach>
|
|
</foreach>
|
|
@@ -101,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectGoodsTypeCount" parameterType="GoodsType" resultType="int" >
|
|
<select id="selectGoodsTypeCount" parameterType="GoodsType" resultType="int" >
|
|
|
select count(1) from goods_type
|
|
select count(1) from goods_type
|
|
|
<where>
|
|
<where>
|
|
|
|
|
+ del_flag='0'
|
|
|
<if test="name != null and name != ''"> and name = #{name}</if>
|
|
<if test="name != null and name != ''"> and name = #{name}</if>
|
|
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
|
|
<if test="ancestors != null and ancestors != ''"> and find_in_set(#{ancestors} ,ancestors ) </if>
|
|
<if test="ancestors != null and ancestors != ''"> and find_in_set(#{ancestors} ,ancestors ) </if>
|