admin
2019-06-25 19a814b7ce5feb584458368c303bb1e3a0c2c8ce
二级分类标签修改,修复若干bug
8个文件已修改
857 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsSubClassAdminController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/UpdateDaTaoKeJob.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml 566 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSubClassServiceImpl.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/ShareHotGoodsServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsSubClassService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/ehcache.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsSubClassAdminController.java
@@ -52,8 +52,8 @@
     * @param out
     */
    @RequestMapping(value = "save")
    public void save(String callback, GoodsSubClass goodsSubClass, Long pid, Integer type, HttpServletRequest request,
            PrintWriter out) {
    public void save(String callback, GoodsSubClass goodsSubClass, Long pid, Integer type, Long labelId,
            HttpServletRequest request, PrintWriter out) {
        if (goodsSubClass.getTaobaoCids() != null)
            goodsSubClass.setTaobaoCids(goodsSubClass.getTaobaoCids().replace(",", ","));
@@ -62,9 +62,9 @@
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                goodsSubClassService.saveObject(fileRequest.getFile("file"), fileRequest.getFile("file2"),
                        goodsSubClass, type, pid);
                        goodsSubClass, type, pid, labelId);
            } else {
                goodsSubClassService.saveObject(null, null, goodsSubClass, type, pid);
                goodsSubClassService.saveObject(null, null, goodsSubClass, type, pid, labelId);
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
fanli/src/main/java/com/yeshi/fanli/job/UpdateDaTaoKeJob.java
@@ -18,6 +18,7 @@
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
@@ -34,6 +35,9 @@
    @Resource
    private DaTaoKeGoodsDetailService daTaoKeGoodsService;
    @Resource
    private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
    /**
     * 限时秒杀 数据更新
@@ -113,7 +117,7 @@
                @Override
                public void run() {
                    daTaoKeGoodsService.startSyncGoods();
                    daTaoKeGoodsDetailV2Service.startSyncGoods();
                }
            }).start();
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml
@@ -2,258 +2,332 @@
<!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.homemodule.SpecialMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.Special">
    <id column="b_id" property="id" jdbcType="BIGINT"/>
    <result column="b_name" property="name" jdbcType="VARCHAR"/>
    <result column="b_card" property="card" jdbcType="VARCHAR"/>
    <result column="b_card_id" property="cardId" jdbcType="BIGINT"/>
    <result column="b_main_picture" property="picture" jdbcType="VARCHAR"/>
    <result column="b_icon" property="icon" jdbcType="VARCHAR"/>
    <result column="b_sub_picture" property="subPicture" jdbcType="VARCHAR"/>
    <result column="b_params" property="params" jdbcType="VARCHAR"/>
    <result column="b_jump_login" property="jumpLogin" jdbcType="VARCHAR"/>
    <result column="b_orderby" property="orderby" jdbcType="INTEGER"/>
    <result column="b_order_man" property="orderMan" jdbcType="INTEGER"/>
    <result column="b_order_woman" property="orderWoman" jdbcType="INTEGER"/>
    <result column="b_state" property="state" jdbcType="BIGINT"/>
    <result column="b_sex" property="sex" jdbcType="INTEGER"/>
    <result column="b_show_type" property="showType" jdbcType="VARCHAR"/>
    <result column="b_remark" property="remark" jdbcType="VARCHAR"/>
    <result column="b_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="b_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
     <!-- 背景图片 -->
    <result column="cd_bottom_picture" property="bottomPicture" jdbcType="VARCHAR"/>
    <association property="jumpDetail" column="b_jumpid"
         select="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.selectByPrimaryKey">
    </association>
  </resultMap>
  <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{sex,jdbcType=INTEGER},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">b_id,</if>
      <if test="name != null">b_name,</if>
      <if test="card != null">b_card,</if>
      <if test="cardId != null">b_card_id,</if>
      <if test="picture != null">b_main_picture,</if>
      <if test="icon != null">b_icon,</if>
      <if test="subPicture != null">b_sub_picture,</if>
      <if test="jumpDetail != null">b_jumpid,</if>
      <if test="params != null">b_params,</if>
      <if test="jumpLogin != null">b_jump_login,</if>
      <if test="orderby != null">b_orderby,</if>
      <if test="orderMan != null">b_order_man,</if>
      <if test="orderWoman != null">b_order_woman,</if>
      <if test="state != null">b_state,</if>
      <if test="sex != null">b_sex,</if>
      <if test="showType != null">b_show_type,</if>
      <if test="remark != null">b_remark,</if>
      <if test="createtime != null">b_createtime,</if>
      <if test="updatetime != null">b_updatetime,</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="card != null">#{card,jdbcType=VARCHAR},</if>
      <if test="cardId != null">#{cardId,jdbcType=BIGINT},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="icon != null">#{icon,jdbcType=VARCHAR},</if>
      <if test="subPicture != null">#{subPicture,jdbcType=VARCHAR},</if>
      <if test="jumpDetail != null">#{jumpDetail.id,jdbcType=BIGINT},</if>
      <if test="params != null">#{params,jdbcType=VARCHAR},</if>
      <if test="jumpLogin != null">#{jumpLogin,jdbcType=VARCHAR},</if>
      <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if>
      <if test="orderMan != null">#{orderMan,jdbcType=INTEGER},</if>
      <if test="orderWoman != null">#{orderWoman,jdbcType=INTEGER},</if>
      <if test="state != null">#{state,jdbcType=BIGINT},</if>
      <if test="sex != null">#{sex,jdbcType=INTEGER},</if>
      <if test="showType != null">#{showType,jdbcType=VARCHAR},</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.homemodule.Special">update yeshi_ec_special set b_name = #{name,jdbcType=VARCHAR},b_card = #{card,jdbcType=VARCHAR},b_card_id = #{cardId,jdbcType=BIGINT},b_main_picture = #{picture,jdbcType=VARCHAR},b_icon = #{icon,jdbcType=VARCHAR},b_sub_picture = #{subPicture,jdbcType=VARCHAR},b_jumpid = #{jumpDetail.id,jdbcType=BIGINT},b_params = #{params,jdbcType=VARCHAR},b_jump_login = #{jumpLogin,jdbcType=VARCHAR},b_orderby = #{orderby,jdbcType=INTEGER},b_order_man = #{orderMan,jdbcType=INTEGER},b_order_woman = #{orderWoman,jdbcType=INTEGER},b_state = #{state,jdbcType=BIGINT},b_show_type = #{showType,jdbcType=VARCHAR},b_remark = #{remark,jdbcType=VARCHAR},b_createtime = #{createtime,jdbcType=TIMESTAMP},b_updatetime = #{updatetime,jdbcType=TIMESTAMP} where b_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">update yeshi_ec_special
    <set>
      <if test="name != null">b_name=#{name,jdbcType=VARCHAR},</if>
      <if test="card != null">b_card=#{card,jdbcType=VARCHAR},</if>
      <if test="cardId != null">b_card_id=#{cardId,jdbcType=BIGINT},</if>
      <if test="picture != null">b_main_picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="icon != null">b_icon=#{icon,jdbcType=VARCHAR},</if>
      <if test="subPicture != null">b_sub_picture=#{subPicture,jdbcType=VARCHAR},</if>
      <if test="jumpDetail != null">b_jumpid=#{jumpDetail.id,jdbcType=BIGINT},</if>
      <if test="params != null">b_params=#{params,jdbcType=VARCHAR},</if>
      <if test="jumpLogin != null">b_jump_login=#{jumpLogin,jdbcType=VARCHAR},</if>
      <if test="orderby != null">b_orderby=#{orderby,jdbcType=INTEGER},</if>
      <if test="orderMan != null">b_order_man=#{orderMan,jdbcType=INTEGER},</if>
      <if test="orderWoman != null">b_order_woman=#{orderWoman,jdbcType=INTEGER},</if>
      <if test="state != null">b_state=#{state,jdbcType=BIGINT},</if>
      <if test="sex != null">b_sex=#{orderby,jdbcType=INTEGER},</if>
      <if test="showType != null">b_show_type=#{showType,jdbcType=VARCHAR},</if>
      <if test="remark != null">b_remark=#{remark,jdbcType=VARCHAR},</if>
      <if test="createtime != null">b_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">b_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where b_id = #{id,jdbcType=BIGINT}
  </update>
  <sql id="Sex_Screen">
    <!-- 通用版 -->
    <if test="sex == 0">
        AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10 OR sp.`b_sex` = 20)
        ORDER BY sp.`b_orderby`
    </if>
    <!-- 女版 -->
    <if test="sex == 1">
        AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10 OR sp.`b_sex` = 12)
        ORDER BY sp.`b_order_woman`
    </if>
    <!-- 男版 -->
    <if test="sex == 2">
        AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20 OR sp.`b_sex` = 12)
        ORDER BY sp.`b_order_man`
    </if>
  </sql>
  <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_special WHERE b_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
    <delete id="deleteBatchByCardID" parameterType="java.util.List">
        delete from yeshi_ec_special WHERE b_card_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
  <select id="queryByListPrimaryKey" parameterType="java.util.List" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_special
        WHERE b_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
   </select>
   <select id="queryByListCardID" parameterType="java.util.List" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_special
        WHERE b_card_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
   </select>
   <select id="listQueryByCard" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM  `yeshi_ec_special` sp
        WHERE sp.`b_card_id` = #{cardId}
           <if test='key != null and key != ""'>
                  AND sp.b_name like '%${key}%'
           </if>
           <include refid="Sex_Screen"/>
        LIMIT ${start},${count}
   </select>
   <select id="countlistQueryByCard" resultType="java.lang.Long">
        SELECT IFNULL(count(b_id),0) FROM  `yeshi_ec_special` sp
        WHERE sp.`b_card_id` = #{cardId}
           <if test='key != null and key != ""'>
                  AND sp.b_name like '%${key}%'
           </if>
           <include refid="Sex_Screen"/>
   </select>
   <select id="getDefaultMaxOrder" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(pp.b_orderby),0) FROM yeshi_ec_special pp
        WHERE pp.`b_card_id` = #{cardId}
   </select>
  <select id="getManMaxOrder" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(pp.b_order_man),0) FROM yeshi_ec_special pp
        WHERE pp.`b_card_id` = #{cardId}
   </select>
  <select id="getWomanMaxOrder" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(pp.b_order_woman),0) FROM yeshi_ec_special pp
        WHERE pp.`b_card_id` = #{cardId}
   </select>
   <select id="getOrderByCardID" resultMap="BaseResultMap">
        SELECT  <include refid="Base_Column_List" /> FROM yeshi_ec_special sp
        WHERE sp.b_card_id = #{cardId}
        <!-- 通用版 -->
        <if test="sex == 0 or sex == 120">
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10 OR sp.`b_sex` = 20)
            <if test="type == -1">
                <![CDATA[and sp.b_orderby < #{order}]]>
                order by sp.b_orderby desc
            </if>
            <if test="type == 1">
                <![CDATA[and sp.b_orderby > #{order} ]]>
                order by sp.b_orderby
            </if>
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.Special">
        <id column="b_id" property="id" jdbcType="BIGINT" />
        <result column="b_name" property="name" jdbcType="VARCHAR" />
        <result column="b_card" property="card" jdbcType="VARCHAR" />
        <result column="b_card_id" property="cardId" jdbcType="BIGINT" />
        <result column="b_main_picture" property="picture" jdbcType="VARCHAR" />
        <result column="b_icon" property="icon" jdbcType="VARCHAR" />
        <result column="b_sub_picture" property="subPicture" jdbcType="VARCHAR" />
        <result column="b_params" property="params" jdbcType="VARCHAR" />
        <result column="b_jump_login" property="jumpLogin" jdbcType="VARCHAR" />
        <result column="b_orderby" property="orderby" jdbcType="INTEGER" />
        <result column="b_order_man" property="orderMan" jdbcType="INTEGER" />
        <result column="b_order_woman" property="orderWoman" jdbcType="INTEGER" />
        <result column="b_state" property="state" jdbcType="BIGINT" />
        <result column="b_sex" property="sex" jdbcType="INTEGER" />
        <result column="b_show_type" property="showType" jdbcType="VARCHAR" />
        <result column="b_remark" property="remark" jdbcType="VARCHAR" />
        <result column="b_createtime" property="createtime" jdbcType="TIMESTAMP" />
        <result column="b_updatetime" property="updatetime" jdbcType="TIMESTAMP" />
        <!-- 背景图片 -->
        <result column="cd_bottom_picture" property="bottomPicture"
            jdbcType="VARCHAR" />
        <association property="jumpDetail" column="b_jumpid"
            select="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.selectByPrimaryKey">
        </association>
    </resultMap>
    <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime</sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special
        (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime)
        values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{sex,jdbcType=INTEGER},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_special
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">b_id,</if>
            <if test="name != null">b_name,</if>
            <if test="card != null">b_card,</if>
            <if test="cardId != null">b_card_id,</if>
            <if test="picture != null">b_main_picture,</if>
            <if test="icon != null">b_icon,</if>
            <if test="subPicture != null">b_sub_picture,</if>
            <if test="jumpDetail != null">b_jumpid,</if>
            <if test="params != null">b_params,</if>
            <if test="jumpLogin != null">b_jump_login,</if>
            <if test="orderby != null">b_orderby,</if>
            <if test="orderMan != null">b_order_man,</if>
            <if test="orderWoman != null">b_order_woman,</if>
            <if test="state != null">b_state,</if>
            <if test="sex != null">b_sex,</if>
            <if test="showType != null">b_show_type,</if>
            <if test="remark != null">b_remark,</if>
            <if test="createtime != null">b_createtime,</if>
            <if test="updatetime != null">b_updatetime,</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="card != null">#{card,jdbcType=VARCHAR},</if>
            <if test="cardId != null">#{cardId,jdbcType=BIGINT},</if>
            <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
            <if test="icon != null">#{icon,jdbcType=VARCHAR},</if>
            <if test="subPicture != null">#{subPicture,jdbcType=VARCHAR},</if>
            <if test="jumpDetail != null">#{jumpDetail.id,jdbcType=BIGINT},</if>
            <if test="params != null">#{params,jdbcType=VARCHAR},</if>
            <if test="jumpLogin != null">#{jumpLogin,jdbcType=VARCHAR},</if>
            <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if>
            <if test="orderMan != null">#{orderMan,jdbcType=INTEGER},</if>
            <if test="orderWoman != null">#{orderWoman,jdbcType=INTEGER},</if>
            <if test="state != null">#{state,jdbcType=BIGINT},</if>
            <if test="sex != null">#{sex,jdbcType=INTEGER},</if>
            <if test="showType != null">#{showType,jdbcType=VARCHAR},</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.homemodule.Special">update
        yeshi_ec_special set b_name = #{name,jdbcType=VARCHAR},b_card =
        #{card,jdbcType=VARCHAR},b_card_id =
        #{cardId,jdbcType=BIGINT},b_main_picture =
        #{picture,jdbcType=VARCHAR},b_icon =
        #{icon,jdbcType=VARCHAR},b_sub_picture =
        #{subPicture,jdbcType=VARCHAR},b_jumpid =
        #{jumpDetail.id,jdbcType=BIGINT},b_params =
        #{params,jdbcType=VARCHAR},b_jump_login =
        #{jumpLogin,jdbcType=VARCHAR},b_orderby =
        #{orderby,jdbcType=INTEGER},b_order_man =
        #{orderMan,jdbcType=INTEGER},b_order_woman =
        #{orderWoman,jdbcType=INTEGER},b_state =
        #{state,jdbcType=BIGINT},b_show_type =
        #{showType,jdbcType=VARCHAR},b_remark =
        #{remark,jdbcType=VARCHAR},b_createtime =
        #{createtime,jdbcType=TIMESTAMP},b_updatetime =
        #{updatetime,jdbcType=TIMESTAMP},b_sex=#{sex,jdbcType=INTEGER} where
        b_id = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">
        update yeshi_ec_special
        <set>
            <if test="name != null">b_name=#{name,jdbcType=VARCHAR},</if>
            <if test="card != null">b_card=#{card,jdbcType=VARCHAR},</if>
            <if test="cardId != null">b_card_id=#{cardId,jdbcType=BIGINT},</if>
            <if test="picture != null">b_main_picture=#{picture,jdbcType=VARCHAR},</if>
            <if test="icon != null">b_icon=#{icon,jdbcType=VARCHAR},</if>
            <if test="subPicture != null">b_sub_picture=#{subPicture,jdbcType=VARCHAR},</if>
            <if test="jumpDetail != null">b_jumpid=#{jumpDetail.id,jdbcType=BIGINT},</if>
            <if test="params != null">b_params=#{params,jdbcType=VARCHAR},</if>
            <if test="jumpLogin != null">b_jump_login=#{jumpLogin,jdbcType=VARCHAR},</if>
            <if test="orderby != null">b_orderby=#{orderby,jdbcType=INTEGER},</if>
            <if test="orderMan != null">b_order_man=#{orderMan,jdbcType=INTEGER},</if>
            <if test="orderWoman != null">b_order_woman=#{orderWoman,jdbcType=INTEGER},</if>
            <if test="state != null">b_state=#{state,jdbcType=BIGINT},</if>
            <if test="sex != null">b_sex=#{sex,jdbcType=INTEGER},</if>
            <if test="showType != null">b_show_type=#{showType,jdbcType=VARCHAR},</if>
            <if test="remark != null">b_remark=#{remark,jdbcType=VARCHAR},</if>
            <if test="createtime != null">b_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
            <if test="updatetime != null">b_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
        </set>
        where b_id = #{id,jdbcType=BIGINT}
    </update>
    <sql id="Sex_Screen">
        <!-- 通用版 -->
        <if test="sex == 0">
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10
            OR sp.`b_sex` =
            20)
            ORDER BY sp.`b_orderby`
        </if>
        <!-- 女版 -->
        <if test="sex == 1">
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10 OR sp.`b_sex` = 12)
            <if test="type == -1">
                <![CDATA[and sp.b_order_woman < #{order}]]>
                order by sp.b_order_woman desc
            </if>
            <if test="type == 1">
                <![CDATA[and sp.b_order_woman > #{order} ]]>
                order by sp.b_order_woman
            </if>
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10
            OR sp.`b_sex` =
            12)
            ORDER BY sp.`b_order_woman`
        </if>
        <!-- 男版 -->
        <if test="sex == 2">
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20 OR sp.`b_sex` = 12)
            <if test="type == -1">
                <![CDATA[and sp.b_order_man < #{order}]]>
                order by sp.b_order_man desc
            </if>
            <if test="type == 1">
                <![CDATA[and sp.b_order_man > #{order} ]]>
                order by sp.b_order_man
            </if>
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20
            OR sp.`b_sex` =
            12)
            ORDER BY sp.`b_order_man`
        </if>
        limit 1
   </select>
   <select id="listBySystemAndCard" resultMap="BaseResultMap">
        SELECT p.* FROM `yeshi_ec_special` p LEFT JOIN `yeshi_ec_special_card` c ON  p.`b_card_id` = c.`cd_id`
        LEFT JOIN `yeshi_ec_super_special_card` s ON  s.`sp_special_cid` = c.`cd_id`
        WHERE p.`b_state` = 0 AND c.`cd_state` = 0
              AND c.`cd_card` = #{card} AND s.`sp_system_id` = #{systemId}
        ORDER BY p.`b_orderby`
   </select>
    <select id="listPageBySystemAndCard" resultMap="BaseResultMap">
        SELECT p.* FROM `yeshi_ec_special` p LEFT JOIN `yeshi_ec_special_card` c ON  p.`b_card_id` = c.`cd_id`
        LEFT JOIN `yeshi_ec_super_special_card` s ON  s.`sp_special_cid` = c.`cd_id`
        WHERE p.`b_state` = 0 AND c.`cd_state` = 0 AND s.sp_id is not null
              AND c.`cd_card` = #{card} AND s.`sp_system_id` = #{systemId}
        ORDER BY p.`b_orderby`
    </sql>
    <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_special WHERE b_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
    <delete id="deleteBatchByCardID" parameterType="java.util.List">
        delete from yeshi_ec_special WHERE b_card_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
    <select id="queryByListPrimaryKey" parameterType="java.util.List"
        resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_special
        WHERE b_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </select>
    <select id="queryByListCardID" parameterType="java.util.List"
        resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_special
        WHERE b_card_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </select>
    <select id="listQueryByCard" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM `yeshi_ec_special` sp
        WHERE sp.`b_card_id` = #{cardId}
        <if test='key != null and key != ""'>
            AND sp.b_name like '%${key}%'
        </if>
        <include refid="Sex_Screen" />
        LIMIT ${start},${count}
   </select>
    <select id="listByPlaceKey" resultMap="BaseResultMap">
        SELECT sp.*,c.`cd_bottom_picture` FROM `yeshi_ec_special` sp
        RIGHT JOIN (SELECT c.* FROM yeshi_ec_special_card c
            LEFT JOIN `yeshi_ec_special_place` pc ON pc.`sp_id` = c.`cd_place_id`
            WHERE c.`cd_state` = 0
            AND IF(c.`cd_start_time` IS NULL,TRUE, c.`cd_start_time`<![CDATA[<=]]>NOW())
            AND IF(c.`cd_end_time` IS NULL,TRUE,c.`cd_end_time`<![CDATA[>=]]>NOW())
            AND pc.`sp_key` = #{placeKey}
            LIMIT 1)c ON  sp.`b_card_id` = c.`cd_id`
        WHERE sp.`b_state` = 0
            <include refid="Sex_Screen"/>
   </select>
    </select>
    <select id="countlistQueryByCard" resultType="java.lang.Long">
        SELECT IFNULL(count(b_id),0) FROM `yeshi_ec_special` sp
        WHERE
        sp.`b_card_id` = #{cardId}
        <if test='key != null and key != ""'>
            AND sp.b_name like '%${key}%'
        </if>
        <include refid="Sex_Screen" />
    </select>
    <select id="getDefaultMaxOrder" resultType="java.lang.Integer">
        SELECT
        IFNULL(MAX(pp.b_orderby),0) FROM yeshi_ec_special pp
        WHERE
        pp.`b_card_id` = #{cardId}
    </select>
    <select id="getManMaxOrder" resultType="java.lang.Integer">
        SELECT
        IFNULL(MAX(pp.b_order_man),0) FROM yeshi_ec_special pp
        WHERE
        pp.`b_card_id` = #{cardId}
    </select>
    <select id="getWomanMaxOrder" resultType="java.lang.Integer">
        SELECT
        IFNULL(MAX(pp.b_order_woman),0) FROM yeshi_ec_special pp
        WHERE
        pp.`b_card_id` = #{cardId}
    </select>
    <select id="getOrderByCardID" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_special sp
        WHERE sp.b_card_id = #{cardId}
        <!-- 通用版 -->
        <if test="sex == 0 or sex == 120">
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10 OR
            sp.`b_sex` = 20)
            <if test="type == -1">
                <![CDATA[and sp.b_orderby < #{order}]]>
                order by sp.b_orderby desc
            </if>
            <if test="type == 1">
                <![CDATA[and sp.b_orderby > #{order} ]]>
                order by sp.b_orderby
            </if>
        </if>
        <!-- 女版 -->
        <if test="sex == 1">
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10 OR
            sp.`b_sex` = 12)
            <if test="type == -1">
                <![CDATA[and sp.b_order_woman < #{order}]]>
                order by sp.b_order_woman desc
            </if>
            <if test="type == 1">
                <![CDATA[and sp.b_order_woman > #{order} ]]>
                order by sp.b_order_woman
            </if>
        </if>
        <!-- 男版 -->
        <if test="sex == 2">
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20 OR
            sp.`b_sex` = 12)
            <if test="type == -1">
                <![CDATA[and sp.b_order_man < #{order}]]>
                order by sp.b_order_man desc
            </if>
            <if test="type == 1">
                <![CDATA[and sp.b_order_man > #{order} ]]>
                order by sp.b_order_man
            </if>
        </if>
        limit 1
    </select>
    <select id="listBySystemAndCard" resultMap="BaseResultMap">
        SELECT p.* FROM
        `yeshi_ec_special` p LEFT JOIN `yeshi_ec_special_card` c ON
        p.`b_card_id` = c.`cd_id`
        LEFT JOIN `yeshi_ec_super_special_card` s ON
        s.`sp_special_cid` = c.`cd_id`
        WHERE p.`b_state` = 0 AND c.`cd_state` =
        0
        AND c.`cd_card` = #{card} AND s.`sp_system_id` = #{systemId}
        ORDER BY
        p.`b_orderby`
    </select>
    <select id="listPageBySystemAndCard" resultMap="BaseResultMap">
        SELECT p.* FROM
        `yeshi_ec_special` p LEFT JOIN `yeshi_ec_special_card` c ON
        p.`b_card_id` = c.`cd_id`
        LEFT JOIN `yeshi_ec_super_special_card` s ON
        s.`sp_special_cid` = c.`cd_id`
        WHERE p.`b_state` = 0 AND c.`cd_state` =
        0 AND s.sp_id is not null
        AND c.`cd_card` = #{card} AND
        s.`sp_system_id` = #{systemId}
        ORDER BY
        p.`b_orderby`
        LIMIT
        ${start},${count}
    </select>
    <select id="listByPlaceKey" resultMap="BaseResultMap">
        SELECT sp.*,c.`cd_bottom_picture` FROM `yeshi_ec_special` sp
        RIGHT JOIN
        (SELECT c.* FROM yeshi_ec_special_card c
        LEFT JOIN
        `yeshi_ec_special_place` pc ON pc.`sp_id` = c.`cd_place_id`
        WHERE
        c.`cd_state` = 0
        AND IF(c.`cd_start_time` IS NULL,TRUE,
        c.`cd_start_time`<![CDATA[<=]]>NOW())
        AND IF(c.`cd_end_time` IS NULL,TRUE,c.`cd_end_time`<![CDATA[>=]]>NOW())
        AND pc.`sp_key` = #{placeKey}
        LIMIT 1)c ON sp.`b_card_id` = c.`cd_id`
        WHERE sp.`b_state` = 0
        <include refid="Sex_Screen" />
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml
@@ -65,7 +65,8 @@
        </association>
    </resultMap>
    <resultMap id="GoodsResultMap"    type="com.yeshi.fanli.entity.bus.lable.QualityFactory">
    <resultMap id="GoodsResultMap"
        type="com.yeshi.fanli.entity.bus.lable.QualityFactory">
        <id column="sg_id" property="id" jdbcType="BIGINT" />
        <result column="sg_class_id" property="systemCid" jdbcType="BIGINT" />
        <result column="sg_entry_mode" property="entryMode" jdbcType="INTEGER" />
@@ -177,15 +178,15 @@
        </set>
        where sg_id = #{id,jdbcType=BIGINT}
    </update>
    <!-- 查询超过4个小时未更新商品,进行更新 -->
    <update id="updateWeight">
        UPDATE yeshi_ec_quality_factory SET sg_weight = #{weight}
        WHERE <![CDATA[TO_DAYS(`sg_updatetime`) < TO_DAYS(NOW()) OR (HOUR(NOW()) -HOUR(`sg_updatetime`)) >= #{time} ]]>
    </update>
    <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        DELETE FROM yeshi_ec_quality_factory WHERE sg_id in
@@ -296,8 +297,9 @@
    <!-- 查询精选商品信息 -->
    <select id="query" parameterType="com.yeshi.fanli.vo.quality.QualityFactoryVO" resultMap="ResultMap">
    <select id="query" parameterType="com.yeshi.fanli.vo.quality.QualityFactoryVO"
        resultMap="ResultMap">
        SELECT ts.* FROM (
        SELECT DISTINCT( tt.`sg_id`) AS id FROM
        yeshi_ec_quality_factory tt
@@ -458,7 +460,8 @@
    </select>
    <select id="queryCount" parameterType="com.yeshi.fanli.vo.quality.QualityFactoryVO"  resultType="java.lang.Long">
    <select id="queryCount" parameterType="com.yeshi.fanli.vo.quality.QualityFactoryVO"
        resultType="java.lang.Long">
        <!-- 根据条件统计所有标签数量 -->
        SELECT count(ts.sg_id) FROM (
        SELECT DISTINCT( tt.`sg_id`) AS id FROM
@@ -591,16 +594,17 @@
        <include refid="Base_Column_List" />
        FROM yeshi_ec_quality_factory WHERE sg_goods_id = ${goodsId}
    </select>
    <!--查询精选商品信息 -->
    <select id="getByAuctionId" resultMap="BaseResultMap">
        SELECT * FROM yeshi_ec_quality_factory
        SELECT * FROM
        yeshi_ec_quality_factory
        WHERE sg_goods_id = ${auctionId}
        limit 1
    </select>
    <select id="queryCountByGoodsId" resultType="java.lang.Long">
        SELECT COUNT(sg_id)
@@ -630,7 +634,8 @@
    </select>
    <delete id="deleteByGoodsId" parameterType="java.lang.Long">
        delete from  yeshi_ec_quality_factory where sg_goods_id =
        delete from
        yeshi_ec_quality_factory where sg_goods_id =
        #{goodsId,jdbcType=BIGINT}
    </delete>
@@ -713,7 +718,7 @@
    </select>
    <delete id="removeStorageGoods" parameterType="java.lang.Long">
@@ -879,9 +884,13 @@
    </select>
    <select id="listQueryByFlashSale" resultMap="BaseResultMap">
        SELECT     <include refid="Base_Column_List" /> FROM yeshi_ec_quality_flash_sale s
        LEFT JOIN yeshi_ec_quality_factory h ON  h.`sg_goods_id` = s.`fs_qfgoods_id`
        LEFT JOIN yeshi_ec_taobao_goods tb     ON h.`sg_goods_id`= tb.`id`
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_quality_flash_sale s
        LEFT JOIN yeshi_ec_quality_factory h ON h.`sg_goods_id` =
        s.`fs_qfgoods_id`
        LEFT JOIN yeshi_ec_taobao_goods tb ON
        h.`sg_goods_id`= tb.`id`
        WHERE <![CDATA[ tb.`couponTotalCount` > 0 AND tb.couponLeftCount<tb.couponTotalCount ]]>
@@ -892,9 +901,11 @@
    <select id="countQueryByFlashSale" resultType="java.lang.Long">
        SELECT IFNULL(COUNT( h.`sg_id`),0) FROM yeshi_ec_quality_factory h
        RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_goods_id` =    s.`fs_qfgoods_id`
        RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_goods_id` =
        s.`fs_qfgoods_id`
        LEFT JOIN yeshi_ec_taobao_goods tb ON    h.`sg_goods_id`= tb.`id`
        LEFT JOIN yeshi_ec_taobao_goods tb ON
        h.`sg_goods_id`= tb.`id`
        WHERE <![CDATA[ tb.`couponTotalCount` > 0  AND tb.couponLeftCount<tb.couponTotalCount]]>
    </select>
@@ -902,12 +913,15 @@
    <select id="listFlashSaleRandGoods" resultMap="GoodsResultMap">
        SELECT h.*, tb.* FROM yeshi_ec_quality_factory h
        RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_goods_id` = s.`fs_qfgoods_id`
        RIGHT JOIN
        yeshi_ec_quality_flash_sale s ON h.`sg_goods_id` = s.`fs_qfgoods_id`
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE  s.`fs_id` IS NOT NULL AND tb.`biz30day` <![CDATA[>=]]> 10000
             AND tb.`couponTotalCount` <![CDATA[>]]>10
             AND tb.couponLeftCount <![CDATA[<]]> tb.couponTotalCount
        WHERE s.`fs_id` IS NOT NULL AND tb.`biz30day` <![CDATA[>=]]>
        10000
        AND tb.`couponTotalCount` <![CDATA[>]]>10
        AND tb.couponLeftCount <![CDATA[<]]>
        tb.couponTotalCount
        ORDER BY RAND()
        LIMIT 3
    </select>
@@ -1088,10 +1102,11 @@
    <select id="getAuctionIdbyClassId" resultType="java.lang.Long">
        SELECT h.`sg_goods_id` FROM `yeshi_ec_quality_factory` h
        WHERE  h.`sg_goods_source` = #{goodsSource}
            AND h.`sg_updatetime` <![CDATA[<]]> #{beforeTime}
            <if test="systemCid != null">AND h.`sg_class_id` = #{systemCid}</if>
        SELECT h.`sg_goods_id` FROM `yeshi_ec_quality_factory` h
        WHERE h.`sg_goods_source` = #{goodsSource}
        AND h.`sg_updatetime` <![CDATA[<]]>
        #{beforeTime}
        <if test="systemCid != null">AND h.`sg_class_id` = #{systemCid}</if>
    </select>
@@ -1266,35 +1281,47 @@
        #{start},#{count}
    </select>
    <select id="listByShopId" resultMap="GoodsResultMap">
        SELECT * FROM  yeshi_ec_quality_factory q
        LEFT JOIN `yeshi_ec_taobao_goods` t ON q.`sg_goods_id` = t.`id`
        SELECT * FROM
        yeshi_ec_quality_factory q
        LEFT JOIN `yeshi_ec_taobao_goods` t ON
        q.`sg_goods_id` = t.`id`
        WHERE t.`sellerId` = #{shopId}
        ORDER BY q.`sg_weight` DESC
        ORDER BY
        q.`sg_weight` DESC
        LIMIT #{start},#{count}
    </select>
    <select id="countByShopId" resultType="java.lang.Long">
        SELECT  ifnull(count(sg_id),0) FROM  yeshi_ec_quality_factory q
        LEFT JOIN `yeshi_ec_taobao_goods` t ON q.`sg_goods_id` = t.`id`
        WHERE t.`sellerId` = #{shopId}
     </select>
    <select id="countByShopId" resultType="java.lang.Long">
        SELECT
        ifnull(count(sg_id),0) FROM yeshi_ec_quality_factory q
        LEFT JOIN
        `yeshi_ec_taobao_goods` t ON q.`sg_goods_id` = t.`id`
        WHERE
        t.`sellerId` = #{shopId}
    </select>
    <select id="get9k9ClassGoods" resultMap="GoodsResultMap">
        SELECT * FROM `yeshi_ec_quality_factory` h
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0
             AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
             AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice}
             AND tb.`biz30day` <![CDATA[>=]]> #{biz30day}
             <!--  券后价范围 -->
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice}
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> #{maxQuanPrice}
             <!-- 多个分类id -->
            <if test='cids != null and cids != ""'>
                AND h.`sg_class_id` in (${cids})
            </if>
        LEFT JOIN
        yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE
        tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0
        AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
        AND tb.`zkPrice` <![CDATA[<=]]>
        #{zkPrice}
        AND tb.`biz30day` <![CDATA[>=]]>
        #{biz30day}
        <!-- 券后价范围 -->
        AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]>
        #{minQuanPrice}
        AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]>
        #{maxQuanPrice}
        <!-- 多个分类id -->
        <if test='cids != null and cids != ""'>
            AND h.`sg_class_id` in (${cids})
        </if>
        ORDER BY h.sg_weight desc,tb.`biz30day`desc
        LIMIT ${start},${count}
    </select>
@@ -1302,29 +1329,41 @@
    <select id="count9k9ClassGoods" resultType="java.lang.Long">
        SELECT IFNULL(COUNT(h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0
             AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
             AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice}
             AND tb.`biz30day` <![CDATA[>=]]> #{biz30day}
             <!--  券后价范围 -->
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice}
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> #{maxQuanPrice}
             <!-- 多个分类id -->
            <if test='cids != null and cids != ""'>
                AND h.`sg_class_id` in (${cids})
            </if>
        WHERE
        tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0
        AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
        AND tb.`zkPrice` <![CDATA[<=]]>
        #{zkPrice}
        AND tb.`biz30day` <![CDATA[>=]]>
        #{biz30day}
        <!-- 券后价范围 -->
        AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]>
        #{minQuanPrice}
        AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]>
        #{maxQuanPrice}
        <!-- 多个分类id -->
        <if test='cids != null and cids != ""'>
            AND h.`sg_class_id` in (${cids})
        </if>
    </select>
    <!-- 每日必抢 -->
    <select id="listQueryEverydayRob" resultMap="GoodsResultMap">
        SELECT * FROM `yeshi_ec_quality_factory` h
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE tb.`couponTotalCount` > 0  AND tb.couponAmount <![CDATA[>]]> 1 AND tb.couponAmount <![CDATA[<=]]> 50
             AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
             AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice}
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice}
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<=]]> #{maxQuanPrice}
        LEFT JOIN
        yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE
        tb.`couponTotalCount` > 0 AND tb.couponAmount <![CDATA[>]]>
        1 AND tb.couponAmount <![CDATA[<=]]>
        50
        AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
        AND tb.`zkPrice` <![CDATA[<=]]>
        #{zkPrice}
        AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]>
        #{minQuanPrice}
        AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<=]]>
        #{maxQuanPrice}
        ORDER BY h.sg_createtime desc
        LIMIT ${start},${count}
    </select>
@@ -1332,28 +1371,21 @@
    <select id="countQueryEverydayRob" resultType="java.lang.Long">
        SELECT IFNULL(COUNT(h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE tb.`couponTotalCount` > 0  AND tb.couponAmount <![CDATA[>]]> 1 AND tb.couponAmount <![CDATA[<=]]> 50
             AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
             AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice}
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice}
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<=]]> #{maxQuanPrice}
        WHERE
        tb.`couponTotalCount` > 0 AND tb.couponAmount <![CDATA[>]]>
        1 AND tb.couponAmount <![CDATA[<=]]>
        50
        AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
        AND tb.`zkPrice` <![CDATA[<=]]>
        #{zkPrice}
        AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]>
        #{minQuanPrice}
        AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<=]]>
        #{maxQuanPrice}
    </select>
     <select id="listFreeGoods" resultMap="GoodsResultMap">
        SELECT * FROM `yeshi_ec_quality_factory` h
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` <![CDATA[>]]> 0
      AND IF(tb.`zkPrice` - tb.`couponStartFee`<![CDATA[>=]]>0, TRUE, FALSE)
      AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> 0
      AND  tb.`tkRate` * (tb.`zkPrice` - tb.`couponAmount`) *0.05*0.01 <![CDATA[>]]> 1
      ORDER BY h.sg_weight desc
        LIMIT ${start},${count}
    </select>
   <select id="countFreeGoods" resultType="java.lang.Long">
        SELECT IFNULL(COUNT(h.`sg_id`),0)  FROM `yeshi_ec_quality_factory` h
    <select id="listFreeGoods" resultMap="GoodsResultMap">
         SELECT * FROM `yeshi_ec_quality_factory` h
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0 
             AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
@@ -1364,6 +1396,30 @@
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> 9.9
             <!-- 比例  20 -->
             AND  tb.`tkRate` <![CDATA[>=]]> 20
        ORDER BY h.sg_weight desc
        LIMIT ${start},${count}
    </select>
    <select id="countFreeGoods" resultType="java.lang.Long">
        SELECT IFNULL(COUNT(h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE
        tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0
        AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
        <!-- 在售价 209.9 -->
        AND tb.`zkPrice` <![CDATA[<=]]>
        209.9
        <!-- 券后价范围 0~9.9 -->
        AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]>
        0
        AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]>
        9.9
        <!-- 比例 20 -->
        AND tb.`tkRate` <![CDATA[>=]]>
        20
    </select>
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSubClassServiceImpl.java
@@ -18,7 +18,10 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabelMap;
import com.yeshi.fanli.exception.GoodsSubClassException;
import com.yeshi.fanli.service.inter.clazz.GoodsSubClassLabelService;
import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
@@ -37,6 +40,9 @@
    @Resource
    private TaoBaoClassService taoBaoClassService;
    @Resource
    private GoodsSubClassLabelService goodsSubClassLabelService;
    @Override
    public int deleteByPrimaryKey(Long id) {
@@ -123,8 +129,8 @@
    }
    @Override
    public void saveObject(MultipartFile file, MultipartFile file2, GoodsSubClass record, Integer type, Long pid)
            throws GoodsSubClassException, Exception {
    public void saveObject(MultipartFile file, MultipartFile file2, GoodsSubClass record, Integer type, Long pid,
            Long labelId) throws GoodsSubClassException, Exception {
        String name = record.getName();
        if (name == null || name.trim().length() == 0) {
@@ -189,6 +195,8 @@
            record.setIosClick(0L);
            record.setCreatetime(new Date());
            record.setUpdatetime(new Date());
            if (labelId != null)
                record.setClassLabel(new GoodsSubClassLabel(labelId));
            if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
                // 搜索条件:有券、在售价20-200、牛皮癣轻微
@@ -196,6 +204,13 @@
            }
            goodsSubClassMapper.insert(record);
            if (labelId != null) {
                GoodsSubClassLabelMap map = new GoodsSubClassLabelMap();
                map.setGoodsSubClass(record);
                map.setLabel(new GoodsSubClassLabel(labelId));
                goodsSubClassLabelService.addSubClassLabelMap(map);
            }
        } else {
            // 修改
@@ -231,6 +246,13 @@
            record.setAndroidClick(resultObj.getAndroidClick());
            record.setCreatetime(resultObj.getCreatetime());
            record.setUpdatetime(new Date());
            if (labelId != null) {
                GoodsSubClassLabelMap map = new GoodsSubClassLabelMap();
                map.setGoodsSubClass(record);
                map.setLabel(new GoodsSubClassLabel(labelId));
                goodsSubClassLabelService.addSubClassLabelMap(map);
            }
            goodsSubClassMapper.updateByPrimaryKey(record);
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/ShareHotGoodsServiceImpl.java
@@ -22,7 +22,8 @@
        if (goods == null || StringUtil.isNullOrEmpty(goods.getDay()) || goods.getGoods() == null)
            return;
        goods.setId(StringUtil.Md5(goods.getDay() + "#" + goods.getGoods().getAuctionId()));
        goods.setUpdateTime(new Date());
        if (goods.getUpdateTime() == null)
            goods.setUpdateTime(new Date());
        shareHotGoodsDao.save(goods);
    }
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsSubClassService.java
@@ -123,7 +123,7 @@
     * @throws GoodsSubClassException
     * @throws Exception
     */
    public void saveObject(MultipartFile file,MultipartFile file2,  GoodsSubClass record, Integer type, Long pid)
    public void saveObject(MultipartFile file,MultipartFile file2,  GoodsSubClass record, Integer type, Long pid,Long labelId)
            throws GoodsSubClassException, Exception;
}
fanli/src/main/resource/ehcache.xml
@@ -189,11 +189,17 @@
    <cache name="brandCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
        
    <!--动态缓存 -->
    <cache name="dynamicCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
    <!-- 通用模板缓存 -->
    <cache name="commonContentCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
</ehcache>