| | |
| | | <?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.lable.LabelClassMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.lable.LabelClass"> |
| | | <id column="lc_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="lc_createtime" property="createtime" jdbcType="TIMESTAMP"/> |
| | | |
| | | <association property="label" column="lc_label_id" |
| | | select="com.yeshi.fanli.dao.mybatis.lable.LabelMapper.selectByPrimaryKey"> |
| | | </association> |
| | | <association property="goodClass" column="lc_class_id" |
| | | select="com.yeshi.fanli.dao.mybatis.GoodsClassMapper.selectByPrimaryKey"> |
| | | </association> |
| | | |
| | | <association property="goodsSubClass" column="lc_subclass_id" |
| | | select="com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper.selectByPrimaryKey"> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">lc_id,lc_label_id,lc_class_id,lc_subclass_id,lc_createtime</sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_label_class where lc_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_label_class where lc_id = #{id,jdbcType=BIGINT}</delete> |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.lable.LabelClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_label_class (lc_id,lc_label_id,lc_class_id,lc_subclass_id,lc_createtime) values (#{id,jdbcType=BIGINT},#{label.id,jdbcType=BIGINT},#{goodClass.id,jdbcType=BIGINT},#{goodsSubClass.id,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP})</insert> |
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.lable.LabelClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_label_class |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">lc_id,</if> |
| | | <if test="label != null">lc_label_id,</if> |
| | | <if test="goodClass != null">lc_class_id,</if> |
| | | <if test="goodsSubClass != null">lc_subclass_id,</if> |
| | | <if test="createtime != null">lc_createtime,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="label != null">#{label.id,jdbcType=BIGINT},</if> |
| | | <if test="goodClass != null">#{goodClass.id,jdbcType=BIGINT},</if> |
| | | <if test="goodsSubClass != null">#{goodsSubClass.id,jdbcType=BIGINT},</if> |
| | | <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.lable.LabelClass">update yeshi_ec_label_class set lc_label_id = #{label.id,jdbcType=BIGINT},lc_class_id = #{goodClass.id,jdbcType=BIGINT},lc_subclass_id = #{goodsSubClass.id,jdbcType=BIGINT},lc_createtime = #{createtime,jdbcType=TIMESTAMP} where lc_id = #{id,jdbcType=BIGINT}</update> |
| | | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.lable.LabelClass">update yeshi_ec_label_class |
| | | <set> |
| | | <if test="label != null">lc_label_id=#{label.id,jdbcType=BIGINT},</if> |
| | | <if test="goodClass != null">lc_class_id=#{goodClass.id,jdbcType=BIGINT},</if> |
| | | <if test="goodsSubClass != null">lc_subclass_id=#{goodsSubClass.id,jdbcType=BIGINT},</if> |
| | | <if test="createtime != null">lc_createtime=#{createtime,jdbcType=TIMESTAMP},</if> |
| | | </set> where lc_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据类id 标签id查询 --> |
| | | <select id="getByClassIdAndLabelId" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_label_class |
| | | WHERE lc_class_id = ${classId} AND lc_label_id = ${labId} |
| | | </select> |
| | | |
| | | <!--查询一级类对应标签(全部) --> |
| | | <select id="getByClassId" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_label_class |
| | | WHERE lc_class_id = ${classId} |
| | | </select> |
| | | |
| | | <!--查询一级类对应标签(分页) --> |
| | | <select id="queryByClassId" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_label_class |
| | | WHERE lc_class_id = ${classId} ORDER BY lc_createtime LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="getCountQueryByClassId" resultType="java.lang.Integer"> |
| | | SELECT count(lc_id) FROM yeshi_ec_label_class WHERE lc_class_id = ${classId} |
| | | </select> |
| | | |
| | | <!--查询子类对应标签 (全部)--> |
| | | <select id="getBySubClassId" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_label_class |
| | | WHERE lc_subclass_id = ${subClassId} |
| | | </select> |
| | | |
| | | <!--查询子类对应标签(分页) --> |
| | | <select id="queryBySubClassId" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_label_class |
| | | WHERE lc_subclass_id = ${subClassId} ORDER BY lc_createtime LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="getCountQueryBySubClassId" resultType="java.lang.Integer"> |
| | | SELECT count(lc_id) FROM yeshi_ec_label_class WHERE lc_subclass_id = ${subClassId} |
| | | </select> |
| | | |
| | | <!-- 根据一级类别ID删除 --> |
| | | <delete id="deleteByClassId" parameterType="java.lang.Long"> |
| | | delete from yeshi_ec_label_class where lc_class_id = #{classId,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <!-- 根据子类别ID删除 --> |
| | | <delete id="deleteBySubClassId" parameterType="java.lang.Long"> |
| | | delete from yeshi_ec_label_class where lc_subclass_id = #{subClassId,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <!-- 根据子类别ID删除 --> |
| | | <delete id="deleteByLabId" parameterType="java.lang.Long"> |
| | | delete from yeshi_ec_label_class where lc_label_id = #{labID,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | |
| | | </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.lable.LabelClassMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.lable.LabelClass">
|
| | | <id column="lc_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="lc_createtime" property="createtime" jdbcType="TIMESTAMP"/>
|
| | | |
| | | <association property="label" column="lc_label_id" |
| | | select="com.yeshi.fanli.dao.mybatis.lable.LabelMapper.selectByPrimaryKey"> |
| | | </association>
|
| | | <association property="goodClass" column="lc_class_id" |
| | | select="com.yeshi.fanli.dao.mybatis.GoodsClassMapper.selectByPrimaryKey"> |
| | | </association>
|
| | | |
| | | <association property="goodsSubClass" column="lc_subclass_id" |
| | | select="com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper.selectByPrimaryKey"> |
| | | </association>
|
| | | |
| | | </resultMap>
|
| | | |
| | | <sql id="Base_Column_List">lc_id,lc_label_id,lc_class_id,lc_subclass_id,lc_createtime</sql>
|
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
| | | <include refid="Base_Column_List"/>from yeshi_ec_label_class where lc_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_label_class where lc_id = #{id,jdbcType=BIGINT}</delete>
|
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.lable.LabelClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_label_class (lc_id,lc_label_id,lc_class_id,lc_subclass_id,lc_createtime) values (#{id,jdbcType=BIGINT},#{label.id,jdbcType=BIGINT},#{goodClass.id,jdbcType=BIGINT},#{goodsSubClass.id,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP})</insert>
|
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.lable.LabelClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_label_class
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">lc_id,</if>
|
| | | <if test="label != null">lc_label_id,</if>
|
| | | <if test="goodClass != null">lc_class_id,</if>
|
| | | <if test="goodsSubClass != null">lc_subclass_id,</if>
|
| | | <if test="createtime != null">lc_createtime,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="label != null">#{label.id,jdbcType=BIGINT},</if>
|
| | | <if test="goodClass != null">#{goodClass.id,jdbcType=BIGINT},</if>
|
| | | <if test="goodsSubClass != null">#{goodsSubClass.id,jdbcType=BIGINT},</if>
|
| | | <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.lable.LabelClass">update yeshi_ec_label_class set lc_label_id = #{label.id,jdbcType=BIGINT},lc_class_id = #{goodClass.id,jdbcType=BIGINT},lc_subclass_id = #{goodsSubClass.id,jdbcType=BIGINT},lc_createtime = #{createtime,jdbcType=TIMESTAMP} where lc_id = #{id,jdbcType=BIGINT}</update>
|
| | | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.lable.LabelClass">update yeshi_ec_label_class
|
| | | <set>
|
| | | <if test="label != null">lc_label_id=#{label.id,jdbcType=BIGINT},</if>
|
| | | <if test="goodClass != null">lc_class_id=#{goodClass.id,jdbcType=BIGINT},</if>
|
| | | <if test="goodsSubClass != null">lc_subclass_id=#{goodsSubClass.id,jdbcType=BIGINT},</if>
|
| | | <if test="createtime != null">lc_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where lc_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | |
| | | <!--根据类id 标签id查询 -->
|
| | | <select id="getByClassIdAndLabelId" resultMap="BaseResultMap">
|
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_label_class |
| | | WHERE lc_class_id = ${classId} AND lc_label_id = ${labId}
|
| | | </select>
|
| | | |
| | | <!--查询一级类对应标签(全部) -->
|
| | | <select id="getByClassId" resultMap="BaseResultMap">
|
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_label_class |
| | | WHERE lc_class_id = ${classId}
|
| | | </select>
|
| | | |
| | | <!--查询一级类对应标签(分页) -->
|
| | | <select id="queryByClassId" resultMap="BaseResultMap">
|
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_label_class |
| | | WHERE lc_class_id = ${classId} ORDER BY lc_createtime LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="getCountQueryByClassId" resultType="java.lang.Integer">
|
| | | SELECT count(lc_id) FROM yeshi_ec_label_class WHERE lc_class_id = ${classId}
|
| | | </select>
|
| | | |
| | | <!--查询子类对应标签 (全部)-->
|
| | | <select id="getBySubClassId" resultMap="BaseResultMap">
|
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_label_class |
| | | WHERE lc_subclass_id = ${subClassId}
|
| | | </select>
|
| | | |
| | | <!--查询子类对应标签(分页) -->
|
| | | <select id="queryBySubClassId" resultMap="BaseResultMap">
|
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_label_class |
| | | WHERE lc_subclass_id = ${subClassId} ORDER BY lc_createtime LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="getCountQueryBySubClassId" resultType="java.lang.Integer">
|
| | | SELECT count(lc_id) FROM yeshi_ec_label_class WHERE lc_subclass_id = ${subClassId}
|
| | | </select>
|
| | | |
| | | <!-- 根据一级类别ID删除 -->
|
| | | <delete id="deleteByClassId" parameterType="java.lang.Long">
|
| | | delete from yeshi_ec_label_class where lc_class_id = #{classId,jdbcType=BIGINT}
|
| | | </delete>
|
| | | |
| | | <!-- 根据子类别ID删除 -->
|
| | | <delete id="deleteBySubClassId" parameterType="java.lang.Long">
|
| | | delete from yeshi_ec_label_class where lc_subclass_id = #{subClassId,jdbcType=BIGINT}
|
| | | </delete>
|
| | | |
| | | <!-- 根据子类别ID删除 -->
|
| | | <delete id="deleteByLabId" parameterType="java.lang.Long">
|
| | | delete from yeshi_ec_label_class where lc_label_id = #{labID,jdbcType=BIGINT}
|
| | | </delete>
|
| | | |
| | | |
| | | </mapper>
|