<?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.TaoBaoClassRelationMapper">
|
<resultMap id="BaseResultMap"
|
type="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation">
|
<id column="tm_id" property="id" jdbcType="BIGINT" />
|
<result column="tm_system_cid" property="cid" jdbcType="BIGINT" />
|
<result column="tm_system_sub_cid" property="subId" jdbcType="BIGINT" />
|
<result column="tm_taobao_cid" property="taobaoCid" jdbcType="TIMESTAMP" />
|
<result column="tm_weight" property="weight" jdbcType="DOUBLE" />
|
<result column="tm_createtime" property="createtime" jdbcType="TIMESTAMP" />
|
<result column="tm_updatetime" property="updatetime" jdbcType="TIMESTAMP" />
|
</resultMap>
|
<sql id="Base_Column_List">tm_id,tm_system_cid,tm_system_sub_cid,tm_taobao_cid,tm_weight,tm_createtime,tm_updatetime
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_taobao_class_mapper where tm_id = #{id,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_taobao_class_mapper where tm_id = #{id,jdbcType=BIGINT}
|
</delete>
|
|
<delete id="deleteBySubId" parameterType="java.lang.Long">delete from
|
yeshi_ec_taobao_class_mapper where tm_system_sub_cid = #{0}
|
</delete>
|
|
<delete id="deleteByCid" parameterType="java.lang.Long">delete from
|
yeshi_ec_taobao_class_mapper where tm_system_cid = #{0}
|
</delete>
|
|
|
<insert id="insert"
|
parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation"
|
useGeneratedKeys="true" keyProperty="id">insert into
|
yeshi_ec_taobao_class_mapper
|
(tm_id,tm_system_cid,tm_system_sub_cid,tm_taobao_cid,tm_weight,tm_createtime,tm_updatetime)
|
values
|
(#{id,jdbcType=BIGINT},#{cid,jdbcType=BIGINT},#{subId,jdbcType=BIGINT},#{taobaoCid,jdbcType=BIGINT},#{weight,jdbcType=DOUBLE},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})
|
</insert>
|
<insert id="insertSelective"
|
parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_taobao_class_mapper
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">tm_id,</if>
|
<if test="cid != null">tm_system_cid,</if>
|
<if test="subId != null">tm_system_sub_cid,</if>
|
<if test="taobaoCid != null">tm_taobao_cid,</if>
|
<if test="weight != null">tm_weight,</if>
|
<if test="createtime != null">tm_createtime,</if>
|
<if test="updatetime != null">tm_updatetime,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="cid != null">#{cid,jdbcType=BIGINT},</if>
|
<if test="subId != null">#{subId,jdbcType=BIGINT},</if>
|
<if test="taobaoCid != null">#{taobaoCid,jdbcType=BIGINT},</if>
|
<if test="weight != null">#{weight,jdbcType=DOUBLE},</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.TaoBaoClassRelation">update yeshi_ec_taobao_class_mapper set tm_system_cid =
|
#{cid,jdbcType=BIGINT},tm_system_sub_cid =
|
#{subId,jdbcType=BIGINT},tm_taobao_cid =
|
#{taobaoCid,jdbcType=BIGINT},tm_weight =
|
#{weight,jdbcType=DOUBLE},tm_createtime =
|
#{createtime,jdbcType=TIMESTAMP},tm_updatetime =
|
#{updatetime,jdbcType=TIMESTAMP} where tm_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective"
|
parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation">
|
update yeshi_ec_taobao_class_mapper
|
<set>
|
<if test="cid != null">tm_system_cid=#{cid,jdbcType=BIGINT},</if>
|
<if test="subId != null">tm_system_sub_cid=#{subId,jdbcType=BIGINT},</if>
|
<if test="taobaoCid != null">tm_taobao_cid=#{taobaoCid,jdbcType=BIGINT},</if>
|
<if test="weight != null">tm_weight=#{weight,jdbcType=DOUBLE},</if>
|
<if test="createtime != null">tm_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
|
<if test="updatetime != null">tm_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
|
</set>
|
where tm_id = #{id,jdbcType=BIGINT}
|
</update>
|
|
<select id="listByTaoBaoCid" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
SELECT
|
<include refid="Base_Column_List" />
|
FROM `yeshi_ec_taobao_class_mapper` tm
|
LEFT JOIN `yeshi_ec_taobao_class` tc ON tc.`tc_id` = tm.`tm_taobao_cid`
|
WHERE tc.`tc_category_id`= #{taobaoCid,jdbcType=BIGINT} ORDER BY
|
tm.`tm_weight` DESC LIMIT 0,10
|
</select>
|
|
<select id="getByLocalCid" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
SELECT
|
<include refid="Base_Column_List" />
|
FROM `yeshi_ec_taobao_class_mapper`
|
WHERE tm_taobao_cid = #{localCid,jdbcType=BIGINT}
|
LIMIT 1
|
</select>
|
|
<delete id="deleteRelationByLocalCid" parameterType="java.lang.Long">
|
delete from yeshi_ec_taobao_class_mapper
|
where tm_taobao_cid = #{localCid,jdbcType=BIGINT}
|
</delete>
|
|
|
<select id="getClassIdByTaoBaoCid" parameterType="java.lang.Long" resultType="java.lang.Long">
|
SELECT tm.tm_system_cid FROM `yeshi_ec_taobao_class_mapper` tm
|
LEFT JOIN `yeshi_ec_taobao_class` tc ON tc.`tc_id` = tm.`tm_taobao_cid`
|
WHERE tc.`tc_category_id`= #{taobaoCid,jdbcType=BIGINT}
|
LIMIT 1
|
</select>
|
|
</mapper>
|