| | |
| | | <?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.yeshi.fanli.dao.mybatis.clazz.GoodsSubClassLabelMapper"> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel"> |
| | | <id column="scl_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="scl_name" property="name" jdbcType="VARCHAR" /> |
| | | <result column="scl_order_by" property="orderBy" jdbcType="INTEGER" /> |
| | | <result column="scl_create_time" property="createTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="scl_update_time" property="updateTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <association property="goodsClass" column="scl_class_id" |
| | | select="com.yeshi.fanli.dao.mybatis.GoodsClassMapper.selectByPrimaryKey"></association> |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | <resultMap id="SubMapResultVO" type="com.yeshi.fanli.vo.goods.GoodsSubClassLabelVO"> |
| | | <id column="scl_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="scl_name" property="name" jdbcType="VARCHAR" /> |
| | | <result column="scl_order_by" property="orderBy" jdbcType="INTEGER" /> |
| | | <result column="scl_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="scl_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | |
| | | <association property="goodsClass" column="scl_class_id" javaType="com.yeshi.fanli.entity.bus.clazz.GoodsClass"> |
| | | <id column="scl_class_id" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | <collection property="listSub" column="sub_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper.SimpleResultMap"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">scl_id,scl_name,scl_order_by,scl_class_id,scl_create_time,scl_update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_sub_class_label where scl_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByClassIdAndName" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_sub_class_label where scl_name = #{name} and |
| | | scl_class_id=#{classId} |
| | | </select> |
| | | |
| | | |
| | | <select id="listByClassId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_sub_class_label |
| | | <if test="classId!=null"> |
| | | where |
| | | scl_class_id=#{classId} |
| | | </if> |
| | | order by scl_order_by |
| | | </select> |
| | | |
| | | <select id="listSubMapByClassId" resultMap="SubMapResultVO"> |
| | | SELECT t.*,b.* FROM yeshi_ec_sub_class_label t |
| | | LEFT JOIN yeshi_ec_sub_class_label_map p ON t.`scl_id` = p.`sclm_label_id` |
| | | LEFT JOIN yeshi_ec_sub_class b ON b.`sub_id` = p.`sclm_sub_class_id` |
| | | WHERE t.`scl_class_id` = #{classId} AND b.`sub_state` = 1 |
| | | <if test="month != null"> |
| | | AND ( |
| | | (sub_month is null) |
| | | or |
| | | FIND_IN_SET(#{month},sub_month) |
| | | ) |
| | | </if> |
| | | |
| | | |
| | | ORDER BY t.`scl_order_by`,p.`sclm_order_by` |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_sub_class_label where scl_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_sub_class_label |
| | | (scl_id,scl_name,scl_order_by,scl_class_id,scl_create_time,scl_update_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{orderBy,jdbcType=INTEGER},#{goodsClass.id,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_sub_class_label |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">scl_id,</if> |
| | | <if test="name != null">scl_name,</if> |
| | | <if test="orderBy != null">scl_order_by,</if> |
| | | <if test="goodsClass != null">scl_class_id,</if> |
| | | <if test="createTime != null">scl_create_time,</if> |
| | | <if test="updateTime != null">scl_update_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="goodsClass != null">#{goodsClass.id,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel">update |
| | | yeshi_ec_sub_class_label set scl_name = |
| | | #{name,jdbcType=VARCHAR},scl_order_by = |
| | | #{orderBy,jdbcType=INTEGER},scl_class_id = |
| | | #{goodsClass.id,jdbcType=BIGINT},scl_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},scl_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where scl_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel"> |
| | | update yeshi_ec_sub_class_label |
| | | <set> |
| | | <if test="name != null">scl_name=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="orderBy != null">scl_order_by=#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="goodsClass != null">scl_class_id=#{goodsClass.id,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">scl_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">scl_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where scl_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | | <?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.yeshi.fanli.dao.mybatis.clazz.GoodsSubClassLabelMapper">
|
| | | <resultMap id="BaseResultMap"
|
| | | type="com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel">
|
| | | <id column="scl_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="scl_name" property="name" jdbcType="VARCHAR" />
|
| | | <result column="scl_order_by" property="orderBy" jdbcType="INTEGER" />
|
| | | <result column="scl_create_time" property="createTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="scl_update_time" property="updateTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <association property="goodsClass" column="scl_class_id"
|
| | | select="com.yeshi.fanli.dao.mybatis.GoodsClassMapper.selectByPrimaryKey"></association>
|
| | |
|
| | | </resultMap>
|
| | | |
| | | |
| | | <resultMap id="SubMapResultVO" type="com.yeshi.fanli.vo.goods.GoodsSubClassLabelVO">
|
| | | <id column="scl_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="scl_name" property="name" jdbcType="VARCHAR" />
|
| | | <result column="scl_order_by" property="orderBy" jdbcType="INTEGER" />
|
| | | <result column="scl_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
| | | <result column="scl_update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
| | | |
| | | <association property="goodsClass" column="scl_class_id" javaType="com.yeshi.fanli.entity.bus.clazz.GoodsClass">
|
| | | <id column="scl_class_id" property="id" jdbcType="BIGINT" /> |
| | | </association>
|
| | | |
| | | <collection property="listSub" column="sub_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper.SimpleResultMap"/>
|
| | | </resultMap>
|
| | | |
| | | |
| | | <sql id="Base_Column_List">scl_id,scl_name,scl_order_by,scl_class_id,scl_create_time,scl_update_time
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_sub_class_label where scl_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="selectByClassIdAndName" resultMap="BaseResultMap">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_sub_class_label where scl_name = #{name} and
|
| | | scl_class_id=#{classId}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listByClassId" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_sub_class_label
|
| | | <if test="classId!=null">
|
| | | where
|
| | | scl_class_id=#{classId}
|
| | | </if>
|
| | | order by scl_order_by
|
| | | </select>
|
| | |
|
| | | <select id="listSubMapByClassId" resultMap="SubMapResultVO">
|
| | | SELECT t.*,b.* FROM yeshi_ec_sub_class_label t
|
| | | LEFT JOIN yeshi_ec_sub_class_label_map p ON t.`scl_id` = p.`sclm_label_id`
|
| | | LEFT JOIN yeshi_ec_sub_class b ON b.`sub_id` = p.`sclm_sub_class_id`
|
| | | WHERE t.`scl_class_id` = #{classId} AND b.`sub_state` = 1
|
| | | <if test="month != null">
|
| | | AND (
|
| | | (sub_month is null)
|
| | | or
|
| | | FIND_IN_SET(#{month},sub_month)
|
| | | )
|
| | | </if>
|
| | | |
| | | |
| | | ORDER BY t.`scl_order_by`,p.`sclm_order_by`
|
| | | </select>
|
| | |
|
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_sub_class_label where scl_id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into
|
| | | yeshi_ec_sub_class_label
|
| | | (scl_id,scl_name,scl_order_by,scl_class_id,scl_create_time,scl_update_time)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{orderBy,jdbcType=INTEGER},#{goodsClass.id,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_sub_class_label
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">scl_id,</if>
|
| | | <if test="name != null">scl_name,</if>
|
| | | <if test="orderBy != null">scl_order_by,</if>
|
| | | <if test="goodsClass != null">scl_class_id,</if>
|
| | | <if test="createTime != null">scl_create_time,</if>
|
| | | <if test="updateTime != null">scl_update_time,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if>
|
| | | <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if>
|
| | | <if test="goodsClass != null">#{goodsClass.id,jdbcType=BIGINT},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel">update
|
| | | yeshi_ec_sub_class_label set scl_name =
|
| | | #{name,jdbcType=VARCHAR},scl_order_by =
|
| | | #{orderBy,jdbcType=INTEGER},scl_class_id =
|
| | | #{goodsClass.id,jdbcType=BIGINT},scl_create_time =
|
| | | #{createTime,jdbcType=TIMESTAMP},scl_update_time =
|
| | | #{updateTime,jdbcType=TIMESTAMP} where scl_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel">
|
| | | update yeshi_ec_sub_class_label
|
| | | <set>
|
| | | <if test="name != null">scl_name=#{name,jdbcType=VARCHAR},</if>
|
| | | <if test="orderBy != null">scl_order_by=#{orderBy,jdbcType=INTEGER},</if>
|
| | | <if test="goodsClass != null">scl_class_id=#{goodsClass.id,jdbcType=BIGINT},</if>
|
| | | <if test="createTime != null">scl_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">scl_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </set>
|
| | | where scl_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | </mapper>
|