|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?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.iformall.mapper.TtGoodsCategoryMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.TtGoodsCategory">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="level" jdbcType="INTEGER" property="level" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="parent_id" jdbcType="INTEGER" property="parentId" />
- <result column="enable" jdbcType="INTEGER" property="enable" />
- <result column="is_leaf" jdbcType="INTEGER" property="isLeaf" />
- <result column="service_fee" jdbcType="INTEGER" property="serviceFee" />
- </resultMap>
-
- <sql id="allColumns">
- `id`,`level`,`name`,`parent_id`,`enable`,`is_leaf`,`service_fee`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1=1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != isDel ">
- and `is_del` = #{isDel}
- </if>
-
- <if test=" null != level ">
- and `level` = #{level}
- </if>
-
- <if test=" null != name ">
- and `name` like concat('%', #{name},'%')
- </if>
-
- <if test=" null != parentId ">
- and `parent_id` = #{parentId}
- </if>
-
- <if test=" null != enable ">
- and `enable` = #{enable}
- </if>
-
- <if test=" null != isLeaf ">
- and `is_leaf` = #{isLeaf}
- </if>
-
- <if test=" null != parentIds ">
- and parent_id in
- <foreach collection="parentIds" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
-
- <if test=" null != categoryIds ">
- and id in
- <foreach collection="categoryIds" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns"> order by ${sortColumns} </if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.TtGoodsCategory" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from tt_goods_category
- <include refid="dynamicWhereConditions" />
- </select>
-
- <select id="findIdAll" parameterType="com.iformall.domain.po.TtGoodsCategory" resultType="Integer">
- select id from tt_goods_category
- <include refid="dynamicWhereConditions" />
- </select>
-
- <update id="updDelByIds" parameterType="com.iformall.domain.po.TtGoodsCategory">
- update tt_goods_category set is_del = #{isDel}, update_date = #{updateDate}
- where id in
- <foreach collection="categoryIds" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </update>
-
- </mapper>
|