From 59bfbce44674e52aefbe883233ffaea93d750a8f Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期一, 25 十一月 2019 09:56:17 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- fanli/src/main/java/com/yeshi/fanli/mapping/lable/LabelMapper.xml | 452 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 226 insertions(+), 226 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/lable/LabelMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/lable/LabelMapper.xml index 1dbe37b..825d762 100644 --- a/fanli/src/main/java/com/yeshi/fanli/mapping/lable/LabelMapper.xml +++ b/fanli/src/main/java/com/yeshi/fanli/mapping/lable/LabelMapper.xml @@ -1,226 +1,226 @@ -<?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.LabelMapper"> - <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.lable.Label"> - <id column="lab_id" property="id" jdbcType="BIGINT"/> - <result column="lab_title" property="title" jdbcType="VARCHAR"/> - <result column="lab_picture" property="picture" jdbcType="VARCHAR"/> - <result column="lab_ios_click" property="iosClick" jdbcType="BIGINT"/> - <result column="lab_android_click" property="androidClick" jdbcType="BIGINT"/> - <result column="lab_entry_mode" property="entrymode" jdbcType="INTEGER"/> - <result column="lab_remark" property="remark" jdbcType="VARCHAR"/> - <result column="lab_createtime" property="createtime" jdbcType="TIMESTAMP"/> - <result column="lab_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> - - <association property="createUser" column="lab_entry_aid" - select="com.yeshi.fanli.dao.mybatis.AdminUserMapper.selectByPrimaryKey"> - </association> - - </resultMap> - - <resultMap id="ResultMap" type="com.yeshi.fanli.entity.bus.lable.Label"> - <id column="lab_id" property="id" jdbcType="BIGINT"/> - <result column="lab_title" property="title" jdbcType="VARCHAR"/> - <result column="lab_picture" property="picture" jdbcType="VARCHAR"/> - </resultMap> - - <sql id="Base_Column_List">lab_id,lab_title,lab_picture,lab_ios_click,lab_android_click,lab_entry_aid,lab_entry_mode,lab_remark,lab_createtime,lab_updatetime</sql> - <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select - <include refid="Base_Column_List"/>from yeshi_ec_label where lab_id = #{id,jdbcType=BIGINT} - </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_label where lab_id = #{id,jdbcType=BIGINT}</delete> - <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.lable.Label" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_label (lab_id,lab_title,lab_picture,lab_ios_click,lab_android_click,lab_entry_aid,lab_entry_mode,lab_remark,lab_createtime,lab_updatetime) values (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{iosClick,jdbcType=BIGINT},#{androidClick,jdbcType=BIGINT},#{createUser.id,jdbcType=BIGINT},#{entrymode,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> - <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.lable.Label" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_label - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null">lab_id,</if> - <if test="title != null">lab_title,</if> - <if test="picture != null">lab_picture,</if> - <if test="iosClick != null">lab_ios_click,</if> - <if test="androidClick != null">lab_android_click,</if> - <if test="createUser != null">lab_entry_aid,</if> - <if test="entrymode != null">lab_entry_mode,</if> - <if test="remark != null">lab_remark,</if> - <if test="createtime != null">lab_createtime,</if> - <if test="updatetime != null">lab_updatetime,</if> - </trim>values - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null">#{id,jdbcType=BIGINT},</if> - <if test="title != null">#{title,jdbcType=VARCHAR},</if> - <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> - <if test="iosClick != null">#{iosClick,jdbcType=BIGINT},</if> - <if test="androidClick != null">#{androidClick,jdbcType=BIGINT},</if> - <if test="createUser != null">#{createUser.id,jdbcType=BIGINT},</if> - <if test="entrymode != null">#{entrymode,jdbcType=INTEGER},</if> - <if test="remark != null">#{remark,jdbcType=VARCHAR},</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.lable.Label">update yeshi_ec_label set lab_title = #{title,jdbcType=VARCHAR},lab_picture = #{picture,jdbcType=VARCHAR},lab_ios_click = #{iosClick,jdbcType=BIGINT},lab_android_click = #{androidClick,jdbcType=BIGINT},lab_entry_aid = #{createUser.id,jdbcType=BIGINT},lab_entry_mode = #{entrymode,jdbcType=INTEGER},lab_remark = #{remark,jdbcType=VARCHAR},lab_createtime = #{createtime,jdbcType=TIMESTAMP},lab_updatetime = #{updatetime,jdbcType=TIMESTAMP} where lab_id = #{id,jdbcType=BIGINT}</update> - <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.lable.Label">update yeshi_ec_label - <set> - <if test="title != null">lab_title=#{title,jdbcType=VARCHAR},</if> - <if test="picture != null">lab_picture=#{picture,jdbcType=VARCHAR},</if> - <if test="iosClick != null">lab_ios_click=#{iosClick,jdbcType=BIGINT},</if> - <if test="androidClick != null">lab_android_click=#{androidClick,jdbcType=BIGINT},</if> - <if test="createUser != null">lab_entry_aid=#{createUser.id,jdbcType=BIGINT},</if> - <if test="entrymode != null">lab_entry_mode=#{entrymode,jdbcType=INTEGER},</if> - <if test="remark != null">lab_remark=#{remark,jdbcType=VARCHAR},</if> - <if test="createtime != null">lab_createtime=#{createtime,jdbcType=TIMESTAMP},</if> - <if test="updatetime != null">lab_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if> - </set> where lab_id = #{id,jdbcType=BIGINT} - </update> - - <select id="query" resultMap="BaseResultMap"> - <!-- 鏍规嵁鏉′欢鏌ヨ鎵�鏈夋爣绛� --> - SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_label lb - LEFT JOIN yeshi_ec_adminuser ur ON lb.lab_entry_aid=ur.id - WHERE <![CDATA[1>0]]> - <if test='key != null and key != ""'> - AND (lb.lab_title like '%${key}%' OR ur.id like '%${key}%' OR ur.name like '%${key}%' ) - </if> - <if test='startTime != null and startTime != ""'> - <![CDATA[ AND lb.lab_createtime >= '${startTime}' ]]> - </if> - <if test='endTime != null and endTime != ""'> - <![CDATA[ AND lb.lab_createtime <= '${endTime}' ]]> - </if> - ORDER BY (lb.lab_ios_click + lb.lab_android_click) - <if test='orderMode == 1'> DESC </if> - ,lb.lab_createtime DESC LIMIT ${start},${count} - </select> - - <select id="getQueryCount" resultType="java.lang.Integer"> - <!-- 鏍规嵁鏉′欢缁熻鎵�鏈夋爣绛炬暟閲� --> - SELECT count(lab_id) FROM yeshi_ec_label lb - LEFT JOIN yeshi_ec_adminuser ur ON lb.lab_entry_aid=ur.id - WHERE <![CDATA[1>0]]> - <if test='key != null and key != ""'> - AND (lb.lab_title like '%${key}%' OR ur.id like '%${key}%' OR ur.name like '%${key}%' ) - </if> - <if test='startTime != null and startTime != ""'> - <![CDATA[ AND lb.lab_createtime >= '${startTime}' ]]> - </if> - <if test='endTime != null and endTime != ""'> - <![CDATA[ AND lb.lab_createtime <= '${endTime}' ]]> - </if> - </select> - - <select id="getCount" resultType="java.lang.Long"> - <!-- 缁熻鏍囩鎬绘暟鏁伴噺 --> - SELECT count(lab_id) FROM yeshi_ec_label lb - </select> - - <select id="getCountToday" resultType="java.lang.Long"> - <!-- 缁熻浠婃棩鍚勭鏂瑰紡褰曞叆鏁伴噺 --> - SELECT count(lab_id) FROM yeshi_ec_label - WHERE lab_createtime>= CURDATE(); - </select> - - <select id="getCountByEntryMode" resultType="java.util.HashMap"> - <!-- 缁熻浠婃棩鍚勭鏂瑰紡褰曞叆鏁伴噺 --> - SELECT IFNULL(count(lab_id),0) AS total, - IFNULL(SUM(CASE WHEN lab_entry_mode = 1 THEN 1 ELSE 0 END),0) AS totalBack, - IFNULL(SUM(CASE WHEN lab_entry_mode = 2 THEN 1 ELSE 0 END),0) AS totalExcel - FROM yeshi_ec_label - </select> - - <delete id="deleteBatchByPrimaryKey" parameterType="int"> - <!-- 鎵归噺鍒犻櫎鍔ㄦ�佷俊鎭� --> - delete from yeshi_ec_label where lab_id in - <foreach item="ids" collection="array" open="(" separator="," - close=")">#{ids}</foreach> - </delete> - - <select id="selectByTitle" resultMap="ResultMap"> - select <include refid="Base_Column_List"/> from yeshi_ec_label - where lab_title = #{title} - </select> - - - <select id="listByTitles" parameterType="java.util.List" resultMap="ResultMap"> - select * from yeshi_ec_label - where lab_title in <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach> - </select> - - - <select id="getByTitle" resultMap="ResultMap"> - select * from yeshi_ec_label - WHERE lab_title = #{title} - limit 1 - </select> - - <!-- 鏌ヨ鍟嗗搧鏍� 绛惧�欓�夐」 --> - <select id="queryGoodsCandidate" resultMap="BaseResultMap"> - SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_label` - WHERE lab_id NOT IN (SELECT L.`lg_label_id` FROM `yeshi_ec_label_goods` L WHERE L.`lg_goods_id` = #{goodsId}) - <if test='key != null and key != ""'> - AND lab_title like '%#{key}%' - </if> - ORDER BY lab_createtime LIMIT #{start},#{count} - </select> - <!-- 鏌ヨ鍟嗗搧鏍� 绛惧�欓�夐」缁熻 --> - <select id="getCountQueryGoodsCandidate" resultType="java.lang.Integer"> - SELECT count(lab_id) FROM `yeshi_ec_label` - WHERE lab_id NOT IN (SELECT L.`lg_label_id` FROM `yeshi_ec_label_goods` L WHERE L.`lg_goods_id` = #{goodsId}) - <if test='key != null and key != ""'> - AND lab_title like '%#{key}%' - </if> - </select> - - - <!-- 鏌ヨ涓�绾у垎绫� 鏍囩鍊欓�夐」 --> - <select id="queryClassCandidate" resultMap="BaseResultMap"> - SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_label` - WHERE lab_id NOT IN ( SELECT lc_label_id FROM yeshi_ec_label_class WHERE lc_class_id = ${classId}) - <if test='key != null and key != ""'> - AND lab_title like '%${key}%' - </if> - ORDER BY lab_createtime LIMIT ${start},${count} - </select> - <!-- 鏌ヨ涓�绾у垎绫� 鏍囩鍊欓�夐」 --> - <select id="getCountQueryClassCandidate" resultType="java.lang.Integer"> - SELECT count(lab_id) FROM `yeshi_ec_label` - WHERE lab_id NOT IN ( SELECT lc_label_id FROM yeshi_ec_label_class WHERE lc_class_id = ${classId}) - <if test='key != null and key != ""'> - AND lab_title like '%${key}%' - </if> - </select> - - - <!-- 鏌ヨ瀛愰泦鍒嗙被 鏍囩鍊欓�夐」 --> - <select id="querySubClassCandidate" resultMap="BaseResultMap"> - SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_label` - WHERE lab_id NOT IN (SELECT lc_label_id FROM yeshi_ec_label_class WHERE lc_subclass_id = ${subClassId}) - <if test='key != null and key != ""'> - AND lab_title like '%${key}%' - </if> - ORDER BY lab_createtime LIMIT ${start},${count} - </select> - <!-- 鏌ヨ瀛愰泦鍒嗙被 鏍囩鍊欓�夐」 --> - <select id="getCountQuerySubClassCandidate" resultType="java.lang.Integer"> - SELECT count(lab_id) FROM `yeshi_ec_label` - WHERE lab_id NOT IN (SELECT lc_label_id FROM yeshi_ec_label_class WHERE lc_subclass_id = ${subClassId}) - <if test='key != null and key != ""'> - AND lab_title like '%${key}%' - </if> - </select> - - <!-- 鏌ヨ瀛愰泦鍒嗙被 鏍囩鍊欓�夐」 --> - <select id="getSecondClassLables" resultMap="BaseResultMap"> - SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_label` - WHERE lab_id NOT IN (SELECT lc_label_id FROM yeshi_ec_label_class WHERE lc_subclass_id = ${subClassId}) - ORDER BY lab_createtime - </select> - - - <select id="getByGoodsId" resultMap="ResultMap"> - SELECT * FROM `yeshi_ec_label` l - RIGHT JOIN `yeshi_ec_label_goods` g ON g.`lg_label_id` = l.`lab_id` - WHERE g.`lg_goods_id` = ${goodsId} - </select> - - - -</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.LabelMapper"> + <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.lable.Label"> + <id column="lab_id" property="id" jdbcType="BIGINT"/> + <result column="lab_title" property="title" jdbcType="VARCHAR"/> + <result column="lab_picture" property="picture" jdbcType="VARCHAR"/> + <result column="lab_ios_click" property="iosClick" jdbcType="BIGINT"/> + <result column="lab_android_click" property="androidClick" jdbcType="BIGINT"/> + <result column="lab_entry_mode" property="entrymode" jdbcType="INTEGER"/> + <result column="lab_remark" property="remark" jdbcType="VARCHAR"/> + <result column="lab_createtime" property="createtime" jdbcType="TIMESTAMP"/> + <result column="lab_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> + + <association property="createUser" column="lab_entry_aid" + select="com.yeshi.fanli.dao.mybatis.AdminUserMapper.selectByPrimaryKey"> + </association> + + </resultMap> + + <resultMap id="ResultMap" type="com.yeshi.fanli.entity.bus.lable.Label"> + <id column="lab_id" property="id" jdbcType="BIGINT"/> + <result column="lab_title" property="title" jdbcType="VARCHAR"/> + <result column="lab_picture" property="picture" jdbcType="VARCHAR"/> + </resultMap> + + <sql id="Base_Column_List">lab_id,lab_title,lab_picture,lab_ios_click,lab_android_click,lab_entry_aid,lab_entry_mode,lab_remark,lab_createtime,lab_updatetime</sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select + <include refid="Base_Column_List"/>from yeshi_ec_label where lab_id = #{id,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_label where lab_id = #{id,jdbcType=BIGINT}</delete> + <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.lable.Label" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_label (lab_id,lab_title,lab_picture,lab_ios_click,lab_android_click,lab_entry_aid,lab_entry_mode,lab_remark,lab_createtime,lab_updatetime) values (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{iosClick,jdbcType=BIGINT},#{androidClick,jdbcType=BIGINT},#{createUser.id,jdbcType=BIGINT},#{entrymode,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> + <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.lable.Label" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_label + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null">lab_id,</if> + <if test="title != null">lab_title,</if> + <if test="picture != null">lab_picture,</if> + <if test="iosClick != null">lab_ios_click,</if> + <if test="androidClick != null">lab_android_click,</if> + <if test="createUser != null">lab_entry_aid,</if> + <if test="entrymode != null">lab_entry_mode,</if> + <if test="remark != null">lab_remark,</if> + <if test="createtime != null">lab_createtime,</if> + <if test="updatetime != null">lab_updatetime,</if> + </trim>values + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null">#{id,jdbcType=BIGINT},</if> + <if test="title != null">#{title,jdbcType=VARCHAR},</if> + <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> + <if test="iosClick != null">#{iosClick,jdbcType=BIGINT},</if> + <if test="androidClick != null">#{androidClick,jdbcType=BIGINT},</if> + <if test="createUser != null">#{createUser.id,jdbcType=BIGINT},</if> + <if test="entrymode != null">#{entrymode,jdbcType=INTEGER},</if> + <if test="remark != null">#{remark,jdbcType=VARCHAR},</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.lable.Label">update yeshi_ec_label set lab_title = #{title,jdbcType=VARCHAR},lab_picture = #{picture,jdbcType=VARCHAR},lab_ios_click = #{iosClick,jdbcType=BIGINT},lab_android_click = #{androidClick,jdbcType=BIGINT},lab_entry_aid = #{createUser.id,jdbcType=BIGINT},lab_entry_mode = #{entrymode,jdbcType=INTEGER},lab_remark = #{remark,jdbcType=VARCHAR},lab_createtime = #{createtime,jdbcType=TIMESTAMP},lab_updatetime = #{updatetime,jdbcType=TIMESTAMP} where lab_id = #{id,jdbcType=BIGINT}</update> + <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.lable.Label">update yeshi_ec_label + <set> + <if test="title != null">lab_title=#{title,jdbcType=VARCHAR},</if> + <if test="picture != null">lab_picture=#{picture,jdbcType=VARCHAR},</if> + <if test="iosClick != null">lab_ios_click=#{iosClick,jdbcType=BIGINT},</if> + <if test="androidClick != null">lab_android_click=#{androidClick,jdbcType=BIGINT},</if> + <if test="createUser != null">lab_entry_aid=#{createUser.id,jdbcType=BIGINT},</if> + <if test="entrymode != null">lab_entry_mode=#{entrymode,jdbcType=INTEGER},</if> + <if test="remark != null">lab_remark=#{remark,jdbcType=VARCHAR},</if> + <if test="createtime != null">lab_createtime=#{createtime,jdbcType=TIMESTAMP},</if> + <if test="updatetime != null">lab_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if> + </set> where lab_id = #{id,jdbcType=BIGINT} + </update> + + <select id="query" resultMap="BaseResultMap"> + <!-- 鏍规嵁鏉′欢鏌ヨ鎵�鏈夋爣绛� --> + SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_label lb + LEFT JOIN yeshi_ec_adminuser ur ON lb.lab_entry_aid=ur.id + WHERE <![CDATA[1>0]]> + <if test='key != null and key != ""'> + AND (lb.lab_title like '%${key}%' OR ur.id like '%${key}%' OR ur.name like '%${key}%' ) + </if> + <if test='startTime != null and startTime != ""'> + <![CDATA[ AND lb.lab_createtime >= '${startTime}' ]]> + </if> + <if test='endTime != null and endTime != ""'> + <![CDATA[ AND lb.lab_createtime <= '${endTime}' ]]> + </if> + ORDER BY (lb.lab_ios_click + lb.lab_android_click) + <if test='orderMode == 1'> DESC </if> + ,lb.lab_createtime DESC LIMIT ${start},${count} + </select> + + <select id="getQueryCount" resultType="java.lang.Integer"> + <!-- 鏍规嵁鏉′欢缁熻鎵�鏈夋爣绛炬暟閲� --> + SELECT count(lab_id) FROM yeshi_ec_label lb + LEFT JOIN yeshi_ec_adminuser ur ON lb.lab_entry_aid=ur.id + WHERE <![CDATA[1>0]]> + <if test='key != null and key != ""'> + AND (lb.lab_title like '%${key}%' OR ur.id like '%${key}%' OR ur.name like '%${key}%' ) + </if> + <if test='startTime != null and startTime != ""'> + <![CDATA[ AND lb.lab_createtime >= '${startTime}' ]]> + </if> + <if test='endTime != null and endTime != ""'> + <![CDATA[ AND lb.lab_createtime <= '${endTime}' ]]> + </if> + </select> + + <select id="getCount" resultType="java.lang.Long"> + <!-- 缁熻鏍囩鎬绘暟鏁伴噺 --> + SELECT count(lab_id) FROM yeshi_ec_label lb + </select> + + <select id="getCountToday" resultType="java.lang.Long"> + <!-- 缁熻浠婃棩鍚勭鏂瑰紡褰曞叆鏁伴噺 --> + SELECT count(lab_id) FROM yeshi_ec_label + WHERE lab_createtime>= CURDATE(); + </select> + + <select id="getCountByEntryMode" resultType="java.util.HashMap"> + <!-- 缁熻浠婃棩鍚勭鏂瑰紡褰曞叆鏁伴噺 --> + SELECT IFNULL(count(lab_id),0) AS total, + IFNULL(SUM(CASE WHEN lab_entry_mode = 1 THEN 1 ELSE 0 END),0) AS totalBack, + IFNULL(SUM(CASE WHEN lab_entry_mode = 2 THEN 1 ELSE 0 END),0) AS totalExcel + FROM yeshi_ec_label + </select> + + <delete id="deleteBatchByPrimaryKey" parameterType="int"> + <!-- 鎵归噺鍒犻櫎鍔ㄦ�佷俊鎭� --> + delete from yeshi_ec_label where lab_id in + <foreach item="ids" collection="array" open="(" separator="," + close=")">#{ids}</foreach> + </delete> + + <select id="selectByTitle" resultMap="ResultMap"> + select <include refid="Base_Column_List"/> from yeshi_ec_label + where lab_title = #{title} + </select> + + + <select id="listByTitles" parameterType="java.util.List" resultMap="ResultMap"> + select * from yeshi_ec_label + where lab_title in <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach> + </select> + + + <select id="getByTitle" resultMap="ResultMap"> + select * from yeshi_ec_label + WHERE lab_title = #{title} + limit 1 + </select> + + <!-- 鏌ヨ鍟嗗搧鏍� 绛惧�欓�夐」 --> + <select id="queryGoodsCandidate" resultMap="BaseResultMap"> + SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_label` + WHERE lab_id NOT IN (SELECT L.`lg_label_id` FROM `yeshi_ec_label_goods` L WHERE L.`lg_goods_id` = #{goodsId}) + <if test='key != null and key != ""'> + AND lab_title like '%#{key}%' + </if> + ORDER BY lab_createtime LIMIT #{start},#{count} + </select> + <!-- 鏌ヨ鍟嗗搧鏍� 绛惧�欓�夐」缁熻 --> + <select id="getCountQueryGoodsCandidate" resultType="java.lang.Integer"> + SELECT count(lab_id) FROM `yeshi_ec_label` + WHERE lab_id NOT IN (SELECT L.`lg_label_id` FROM `yeshi_ec_label_goods` L WHERE L.`lg_goods_id` = #{goodsId}) + <if test='key != null and key != ""'> + AND lab_title like '%#{key}%' + </if> + </select> + + + <!-- 鏌ヨ涓�绾у垎绫� 鏍囩鍊欓�夐」 --> + <select id="queryClassCandidate" resultMap="BaseResultMap"> + SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_label` + WHERE lab_id NOT IN ( SELECT lc_label_id FROM yeshi_ec_label_class WHERE lc_class_id = ${classId}) + <if test='key != null and key != ""'> + AND lab_title like '%${key}%' + </if> + ORDER BY lab_createtime LIMIT ${start},${count} + </select> + <!-- 鏌ヨ涓�绾у垎绫� 鏍囩鍊欓�夐」 --> + <select id="getCountQueryClassCandidate" resultType="java.lang.Integer"> + SELECT count(lab_id) FROM `yeshi_ec_label` + WHERE lab_id NOT IN ( SELECT lc_label_id FROM yeshi_ec_label_class WHERE lc_class_id = ${classId}) + <if test='key != null and key != ""'> + AND lab_title like '%${key}%' + </if> + </select> + + + <!-- 鏌ヨ瀛愰泦鍒嗙被 鏍囩鍊欓�夐」 --> + <select id="querySubClassCandidate" resultMap="BaseResultMap"> + SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_label` + WHERE lab_id NOT IN (SELECT lc_label_id FROM yeshi_ec_label_class WHERE lc_subclass_id = ${subClassId}) + <if test='key != null and key != ""'> + AND lab_title like '%${key}%' + </if> + ORDER BY lab_createtime LIMIT ${start},${count} + </select> + <!-- 鏌ヨ瀛愰泦鍒嗙被 鏍囩鍊欓�夐」 --> + <select id="getCountQuerySubClassCandidate" resultType="java.lang.Integer"> + SELECT count(lab_id) FROM `yeshi_ec_label` + WHERE lab_id NOT IN (SELECT lc_label_id FROM yeshi_ec_label_class WHERE lc_subclass_id = ${subClassId}) + <if test='key != null and key != ""'> + AND lab_title like '%${key}%' + </if> + </select> + + <!-- 鏌ヨ瀛愰泦鍒嗙被 鏍囩鍊欓�夐」 --> + <select id="getSecondClassLables" resultMap="BaseResultMap"> + SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_label` + WHERE lab_id NOT IN (SELECT lc_label_id FROM yeshi_ec_label_class WHERE lc_subclass_id = ${subClassId}) + ORDER BY lab_createtime + </select> + + + <select id="getByGoodsId" resultMap="ResultMap"> + SELECT * FROM `yeshi_ec_label` l + RIGHT JOIN `yeshi_ec_label_goods` g ON g.`lg_label_id` = l.`lab_id` + WHERE g.`lg_goods_id` = ${goodsId} + </select> + + + +</mapper> -- Gitblit v1.8.0