admin
2019-05-06 973abe9ae7abf712e370f582abb4a6d381096d9f
分类修改
16个文件已修改
536 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsClassAdminCotroller.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsSubClassAdminController.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/TaoBaoClassMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/TaoBaoClassRelationMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSubClass.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/UserMsgUnReadNum.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml 174 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/TaoBaoClassMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/TaoBaoClassRelationMapper.xml 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/msg/UserMsgUnReadNumMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSubClassServiceImpl.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoClassServiceImpl.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/DeviceActiveServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/TaoBaoClassService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsClassAdminCotroller.java
@@ -38,7 +38,6 @@
    @Resource
    private SuperGoodsClassService superGoodsClassService;
    @Resource
    private GoodsSecondClassService goodsSecondClassService;
@@ -50,7 +49,6 @@
    @Resource
    private BusinessSystemService businessSystemService;
    @RequestMapping(value = "queryAll")
    public void listquery(String callback,  PrintWriter out) {
@@ -74,7 +72,6 @@
    }
    @RequestMapping(value = "getGoodsClasAll")
    public void getGoodsClassAll(String callback, PrintWriter out) {
        List<GoodsClass> goodsClassList = goodsClassService.getGoodsClassAll();
@@ -89,7 +86,6 @@
        }
    }
    /**
     * 保存信息
     * 
@@ -98,7 +94,8 @@
     * @param out
     */
    @RequestMapping(value = "save")
    public void save(String callback, GoodsClass goodsClass, String jumpType, HttpServletRequest request,PrintWriter out) {
    public void save(String callback, GoodsClass goodsClass, String jumpType, HttpServletRequest request,
            PrintWriter out) {
        try {
            // 1. 先判断httpRequest 是否含有文件类型 
            if (request instanceof MultipartHttpServletRequest) {
@@ -116,7 +113,6 @@
            e.printStackTrace();
        }
    }
    /**
     * 修改排序
@@ -180,8 +176,6 @@
    }
    /**
     * 删除图片
     * 
@@ -212,7 +206,8 @@
    }
    
    @RequestMapping(value = "setSuperSystem")
    public void setSuperSystem(String callback,String type, Long gcid, String platform, String packageName, PrintWriter out) {
    public void setSuperSystem(String callback, String type, Long gcid, String platform, String packageName,
            PrintWriter out) {
        platform = Utils.getMap().get(platform);
        if (Constant.DEL.equals(type)) {
            Integer integer = superGoodsClassService.deleteSuperGoodsClass(gcid, platform, packageName);
@@ -226,7 +221,6 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
        }
    }
    
    @RequestMapping(value = "getClassOption")
    public void getClassOption(String callback, PrintWriter out) {
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsSubClassAdminController.java
@@ -18,9 +18,12 @@
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass;
import com.yeshi.fanli.exception.FloatADException;
import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
@@ -33,7 +36,8 @@
    @Resource
    private LabelClassService labelClassService;
    @Resource
    private TaoBaoClassService taoBaoClassService;
    
    /**
     * 保存信息
@@ -43,12 +47,14 @@
     * @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, HttpServletRequest request,
            PrintWriter out) {
        try {
            // 1. 先判断httpRequest 是否含有文件类型 
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                goodsSubClassService.saveObject(fileRequest.getFile("file"),fileRequest.getFile("file2"), goodsSubClass, type, pid);
                goodsSubClassService.saveObject(fileRequest.getFile("file"), fileRequest.getFile("file2"),
                        goodsSubClass, type, pid);
            }else{
                goodsSubClassService.saveObject(null, null, goodsSubClass, type, pid);
            }
@@ -61,7 +67,6 @@
            e.printStackTrace();
        }
    }
    /**
     * 批量删除
@@ -76,7 +81,8 @@
        Gson gson = new Gson();
        try {
            List<String> recordIds = gson.fromJson(ids, new TypeToken<ArrayList<String>>() {}.getType());
            List<String> recordIds = gson.fromJson(ids, new TypeToken<ArrayList<String>>() {
            }.getType());
            if (recordIds == null || recordIds.size() == 0) {
                out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("请选择需删除数据")));
@@ -91,7 +97,6 @@
            e.printStackTrace();
        }
    }
    /**
     * 删除图片
@@ -185,9 +190,25 @@
                    goodsSubClass.setSearchParam(searchJson);
                }
                
                int countlabel = labelClassService.getCountQueryBySubClassId(goodsSubClass.getId());
                goodsSubClass.setCountlabel(countlabel);
                // 查询淘宝分类
                List<TaoBaoClass> listTB = taoBaoClassService.listBySystemSubCid(0, 10000, goodsSubClass.getId());
                if (listTB == null || listTB.size() == 0) {
                    goodsSubClass.setTaobaoCids("");
                } else {
                    String taobaoCids = "";
                    for (TaoBaoClass taoBaoClass : listTB) {
                        taobaoCids = taobaoCids + taoBaoClass.getCategoryName() + "-" + taoBaoClass.getCategoryId()
                                + ",";
                    }
                    if (!StringUtil.isNullOrEmpty(taobaoCids)) {
                        taobaoCids = taobaoCids.substring(0, taobaoCids.length() - 1);
                    }
                    goodsSubClass.setTaobaoCids(taobaoCids);
                }
            }
            GsonBuilder gsonBuilder = new GsonBuilder();
@@ -203,7 +224,6 @@
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
        }
    }
    
    /**
     * 查找二级下的其他级分类
@@ -236,7 +256,6 @@
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
        }
    }
    
    /**
     * 修改排序
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java
@@ -43,6 +43,8 @@
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.goods.RecommendUserGoods;
import com.yeshi.fanli.entity.push.DeviceActive;
import com.yeshi.fanli.entity.push.PushGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.exception.goods.CommonGoodsException;
@@ -62,6 +64,7 @@
import com.yeshi.fanli.service.inter.msg.MsgOtherDetailService;
import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
import com.yeshi.fanli.service.inter.push.DeviceActiveService;
import com.yeshi.fanli.service.inter.push.PushGoodsService;
import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
@@ -134,6 +137,9 @@
    @Resource
    private PushGoodsService pushGoodsService;
    @Resource
    private DeviceActiveService deviceActiveService;
    // 消息的类型
    final static String MSG_TYPE_ORDER = "order";
@@ -555,10 +561,22 @@
                UserCommonMsgVO.TYPE_KEFU, "", false, null, null));
        // 推荐记录
        // list = pushGoodsService.listHistoryByPushTime(0, 1, uid, createTime);
        DeviceActive deviceActive = deviceActiveService.getDeviceByDeviceAndPlatform(acceptData.getDevice(),
                acceptData.getDevice(), acceptData.getPlatform());
        if (deviceActive != null) {
            // 设备注册时间
            Date createTime = deviceActive.getCreateTime();
            List<PushGoods> list = pushGoodsService.listHistoryByPushTime(0, 1, uid, createTime);
            if (list != null && list.size() > 0) {
        commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_recommend.png", "推荐记录",
                new Date(), UserCommonMsgVO.TYPE_RECOMMEND, "防油防水防潮,污渍一抹即净,从胃到心的暖意", false,
                        list.get(0).getCreateTime(), UserCommonMsgVO.TYPE_RECOMMEND, list.get(0).getContent(), false,
                jumpDetailV2Service.getByTypeCache("recommend_list"), null));
            }
        }
        //
        // list = pushGoodsService.listHistoryByPushTime(0, 1, uid, createTime);
        // 1、活动区域
        List<Special> listSpecial = specialService.listByPlaceKey("msg_activities");
@@ -777,4 +795,29 @@
        out.print(JsonUtil.loadTrueResult(""));
    }
    /**
     * 阅读通用消息
     *
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "readCommonMsg", method = RequestMethod.POST)
    public void readCommonMsg(AcceptData acceptData, Long uid, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
        int totalNum = num.getTypeAccount() + num.getTypeInvite() + num.getTypeMoney() + num.getTypeOrder()
                + num.getTypeScore() + num.getTypeSystem() + num.getTypeOther();
        if (totalNum == 0) {
            out.print(JsonUtil.loadFalseResult(1, "没有未读消息"));
            return;
        } else
            userMsgReadStateService.setAllMsgRead(uid);
        out.print(JsonUtil.loadTrueResult(""));
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/TaoBaoClassMapper.java
@@ -13,6 +13,10 @@
    List<TaoBaoClass> listBySystemCid(@Param("start") long start, @Param("count") int count,
            @Param("systemCid") Long systemCid);
    
    List<TaoBaoClass> listBySystemSubCid(@Param("start") long start, @Param("count") int count,
            @Param("systemCid") Long systemCid);
    /**
     * 根据淘宝分类查询
     * @param categoryId
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/TaoBaoClassRelationMapper.java
@@ -23,4 +23,12 @@
     * @param classId
     */
    void deleteRelationByLocalCid(Long localCid);
    /**
     * 根据子分类ID做删除
     * @param subId
     * @return
     */
    int deleteBySubId(Long subId);
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSubClass.java
@@ -64,12 +64,15 @@
    @Column(name = "sub_android_click")
    private Long androidClick = 0l;  
    
    private String taobaoCids;
    @Column(name = "sub_createtime")
    private Date createtime; // 创建时间
    
    @Column(name = "sub_updatetime")
    private Date updatetime; // 创建时间
    
    private Long countClick = 0l;  
    // 关联标签数量
@@ -77,12 +80,12 @@
    
    private String searchParam;
    
    public GoodsSubClass(){}
    public GoodsSubClass() {
    }
    
    public GoodsSubClass(Long id) {
        this.id = id;
    }
    public Long getId() {
        return id;
@@ -123,7 +126,6 @@
    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }
    public GoodsSubClass getParent() {
        return parent;
@@ -228,4 +230,12 @@
    public void setPictureSecond(String pictureSecond) {
        this.pictureSecond = pictureSecond;
    }
    public String getTaobaoCids() {
        return taobaoCids;
    }
    public void setTaobaoCids(String taobaoCids) {
        this.taobaoCids = taobaoCids;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/UserMsgUnReadNum.java
@@ -38,7 +38,8 @@
    @Expose
    @Column(name = "mrs_type_other")
    private Integer typeOther;// 其他消息
    @Column(name = "mrs_type_guanxuan_read_time")
    private Date guanXuanReadTime;// 官宣任务阅读时间
    @Column(name = "mrs_create_time")
    private Date createTime;
    @Column(name = "mrs_update_time")
@@ -88,6 +89,8 @@
        return typeInvite;
    }
    public void setTypeInvite(Integer typeInvite) {
        this.typeInvite = typeInvite;
    }
@@ -132,4 +135,13 @@
        this.updateTime = updateTime;
    }
    public Date getGuanXuanReadTime() {
        return guanXuanReadTime;
    }
    public void setGuanXuanReadTime(Date guanXuanReadTime) {
        this.guanXuanReadTime = guanXuanReadTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml
@@ -2,64 +2,75 @@
<!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.GoodsSubClassMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
    <id column="sub_id" property="id" jdbcType="BIGINT"/>
    <result column="sub_name" property="name" jdbcType="VARCHAR"/>
    <result column="sub_picture" property="picture" jdbcType="VARCHAR"/>
    <result column="sub_picture_second" property="pictureSecond" jdbcType="VARCHAR"/>
        <result column="sub_picture_second" property="pictureSecond"
            jdbcType="VARCHAR" />
    <result column="sub_weight" property="weight" jdbcType="INTEGER"/>
    <result column="sub_level" property="level" jdbcType="INTEGER"/>
    <result column="sub_state" property="state" jdbcType="INTEGER"/>
    <result column="sub_key" property="key" jdbcType="VARCHAR"/>
    <result column="sub_search_json" property="searchJson" jdbcType="VARCHAR"/>
        <result column="sub_search_json" property="searchJson"
            jdbcType="VARCHAR" />
    <result column="sub_ios_click" property="iosClick" jdbcType="BIGINT"/>
    <result column="sub_android_click" property="androidClick" jdbcType="BIGINT"/>
        <result column="sub_android_click" property="androidClick"
            jdbcType="BIGINT" />
    <result column="sub_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="sub_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
    <association property="rootClass" column="sub_root_id" 
        select="com.yeshi.fanli.dao.mybatis.GoodsClassMapper.selectByPrimaryKey">
    </association>
            select="com.yeshi.fanli.dao.mybatis.GoodsClassMapper.selectByPrimaryKey" />
    <association property="parent" column="sub_pid" 
        select="com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper.selectByPrimaryKey">
    </association>
            select="com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper.selectByPrimaryKey" />
  </resultMap>
  <resultMap id="SimpleResultMap" type="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
    <resultMap id="SimpleResultMap"
        type="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
    <id column="sub_id" property="id" jdbcType="BIGINT"/>
    <result column="sub_name" property="name" jdbcType="VARCHAR"/>
    <result column="sub_picture" property="picture" jdbcType="VARCHAR"/>
    <result column="sub_picture_second" property="pictureSecond" jdbcType="VARCHAR"/>
        <result column="sub_picture_second" property="pictureSecond"
            jdbcType="VARCHAR" />
    <result column="sub_weight" property="weight" jdbcType="INTEGER"/>
    <result column="sub_level" property="level" jdbcType="INTEGER"/>
    <result column="sub_state" property="state" jdbcType="INTEGER"/>
    <result column="sub_key" property="key" jdbcType="VARCHAR"/>
    <result column="sub_search_json" property="searchJson" jdbcType="VARCHAR"/>
        <result column="sub_search_json" property="searchJson"
            jdbcType="VARCHAR" />
    <result column="sub_ios_click" property="iosClick" jdbcType="BIGINT"/>
    <result column="sub_android_click" property="androidClick" jdbcType="BIGINT"/>
        <result column="sub_android_click" property="androidClick"
            jdbcType="BIGINT" />
    <result column="sub_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="sub_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
    <association property="rootClass" column="sub_root_id" javaType="com.yeshi.fanli.entity.bus.clazz.GoodsClass">
        <association property="rootClass" column="sub_root_id"
            javaType="com.yeshi.fanli.entity.bus.clazz.GoodsClass">
        <id column="sub_root_id" property="id" jdbcType="BIGINT" />    
    </association>
    <association property="parent" column="sub_pid" javaType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
        <association property="parent" column="sub_pid"
            javaType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
        <id column="sub_pid" property="id" jdbcType="BIGINT" />    
    </association>
  </resultMap>
  <sql id="Base_Column_List">sub_id,sub_name,sub_picture,sub_picture_second,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_sub_class where sub_id = #{id,jdbcType=BIGINT}
    <sql id="Base_Column_List">sub_id,sub_name,sub_picture,sub_picture_second,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_sub_class where sub_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_sub_class where sub_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_sub_class (sub_id,sub_name,sub_picture,sub_picture_second,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{pictureSecond,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{rootClass.id,jdbcType=BIGINT},#{parent.id,jdbcType=BIGINT},#{level,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{key,jdbcType=VARCHAR},#{searchJson,jdbcType=VARCHAR},#{iosClick,jdbcType=BIGINT},#{androidClick,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_sub_class
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_sub_class where sub_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_sub_class
        (sub_id,sub_name,sub_picture,sub_picture_second,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime,sub_id)
        values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{pictureSecond,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{rootClass.id,jdbcType=BIGINT},#{parent.id,jdbcType=BIGINT},#{level,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{key,jdbcType=VARCHAR},#{searchJson,jdbcType=VARCHAR},#{iosClick,jdbcType=BIGINT},#{androidClick,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP},#{id,jdbcType=BIGINT})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_sub_class
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">sub_id,</if>
      <if test="name != null">sub_name,</if>
@@ -76,7 +87,8 @@
      <if test="androidClick != null">sub_android_click,</if>
      <if test="createtime != null">sub_createtime,</if>
      <if test="updatetime != null">sub_updatetime,</if>
    </trim>values
        </trim>
        values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
@@ -95,12 +107,28 @@
      <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">update yeshi_ec_sub_class set sub_name = #{name,jdbcType=VARCHAR},sub_picture = #{picture,jdbcType=VARCHAR},sub_picture_second = #{pictureSecond,jdbcType=VARCHAR},sub_weight = #{weight,jdbcType=INTEGER},sub_root_id = #{rootClass.id,jdbcType=BIGINT},sub_pid = #{parent.id,jdbcType=BIGINT},sub_level = #{level,jdbcType=INTEGER},sub_state = #{state,jdbcType=INTEGER}, sub_key = #{key,jdbcType=VARCHAR},sub_search_json = #{searchJson,jdbcType=VARCHAR},sub_ios_click = #{iosClick,jdbcType=BIGINT},sub_android_click = #{androidClick,jdbcType=BIGINT},sub_createtime = #{createtime,jdbcType=TIMESTAMP},sub_updatetime = #{updatetime,jdbcType=TIMESTAMP} where sub_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">update yeshi_ec_sub_class
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">update
        yeshi_ec_sub_class set sub_name = #{name,jdbcType=VARCHAR},sub_picture
        = #{picture,jdbcType=VARCHAR},sub_picture_second =
        #{pictureSecond,jdbcType=VARCHAR},sub_weight =
        #{weight,jdbcType=INTEGER},sub_root_id =
        #{rootClass.id,jdbcType=BIGINT},sub_pid =
        #{parent.id,jdbcType=BIGINT},sub_level =
        #{level,jdbcType=INTEGER},sub_state = #{state,jdbcType=INTEGER},
        sub_key = #{key,jdbcType=VARCHAR},sub_search_json =
        #{searchJson,jdbcType=VARCHAR},sub_ios_click =
        #{iosClick,jdbcType=BIGINT},sub_android_click =
        #{androidClick,jdbcType=BIGINT},sub_createtime =
        #{createtime,jdbcType=TIMESTAMP},sub_updatetime =
        #{updatetime,jdbcType=TIMESTAMP}  where sub_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">
        update yeshi_ec_sub_class
    <set>
      <if test="name != null">sub_name=#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">sub_picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="pictureSecond != null">sub_picture_second=#{pictureSecond,jdbcType=VARCHAR},</if>
            <if test="pictureSecond != null">sub_picture_second=#{pictureSecond,jdbcType=VARCHAR},
            </if>
      <if test="weight != null">sub_weight=#{weight,jdbcType=INTEGER},</if>
      <if test="rootClass != null">sub_root_id=#{rootClass.id,jdbcType=BIGINT},</if>
      <if test="parent != null">sub_pid=#{parent.id,jdbcType=BIGINT},</if>
@@ -112,89 +140,71 @@
      <if test="androidClick != null">sub_android_click=#{androidClick,jdbcType=BIGINT},</if>
      <if test="createtime != null">sub_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">sub_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where sub_id = #{id,jdbcType=BIGINT}
        </set>
        where sub_id = #{id,jdbcType=BIGINT}
  </update>
   <select id="queryByRootId" resultMap="BaseResultMap">
      <!-- 条件二级类别 -->
    SELECT  <include refid="Base_Column_List" />  FROM yeshi_ec_sub_class
        WHERE sub_root_id = #{rootId}
        <if test="state != null">
            AND sub_state = #{state}
        </if>
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_sub_class WHERE sub_root_id = #{rootId}
        <if test="state != null">AND sub_state = #{state}</if>
        ORDER BY sub_weight,sub_updatetime
   </select>
   <select id="queryByPid" resultMap="BaseResultMap">
      <!-- 条件二级类别 -->
    SELECT  <include refid="Base_Column_List" />  FROM yeshi_ec_sub_class
        WHERE sub_pid = #{pid}
        <if test="state != null">
            and sub_state = #{state}
        </if>
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_sub_class WHERE sub_pid = #{pid}
        <if test="state != null">and sub_state = #{state}</if>
        ORDER BY sub_weight,sub_updatetime
   </select>
    <select id="queryByRootIdAndWeight" resultMap="BaseResultMap">
        SELECT  <include refid="Base_Column_List" />  FROM yeshi_ec_sub_class
        WHERE  sub_root_id = ${rootId}
        <if test="type == -1">
            <![CDATA[and sub_weight < #{weight} ]]>
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_sub_class WHERE sub_root_id = ${rootId}
        <if test="type == -1"> <![CDATA[and sub_weight < #{weight} ]]>
            order by sub_weight desc
        </if>
        <if test="type == 1">
            <![CDATA[and sub_weight > #{weight} ]]>
        <if test="type == 1"> <![CDATA[and sub_weight > #{weight} ]]>
            order by sub_weight 
        </if>
   </select>
    <select id="queryByPidAndWeight" resultMap="BaseResultMap">
          SELECT  <include refid="Base_Column_List" />  FROM yeshi_ec_sub_class
        WHERE sub_pid = ${pid}
        <if test="type == -1">
            <![CDATA[and sub_weight < #{weight} ]]>
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_sub_class WHERE sub_pid = ${pid}
        <if test="type == -1"> <![CDATA[and sub_weight < #{weight} ]]>
            order by sub_weight desc
        </if>
        <if test="type == 1">
            <![CDATA[and sub_weight > #{weight} ]]>
        <if test="type == 1"> <![CDATA[and sub_weight > #{weight} ]]>
            order by sub_weight 
        </if>
   </select>
   <select id="countByRootId" resultType="java.lang.Integer">
      <!-- 条件二级类别 -->
    SELECT  count(sub_id)  FROM yeshi_ec_sub_class
        WHERE sub_root_id = ${rootId}
        SELECT count(sub_id) FROM yeshi_ec_sub_class WHERE sub_root_id =
        ${rootId}
   </select>
   <select id="countByPid" resultType="java.lang.Integer">
      <!-- 条件二级类别 -->
    SELECT  count(sub_id)  FROM yeshi_ec_sub_class
        WHERE sub_pid = ${pid}
        SELECT count(sub_id) FROM yeshi_ec_sub_class WHERE sub_pid = ${pid}
   </select>
    <select id="getMaxWeightByRootId" resultType="java.lang.Integer">
      <!-- 条件二级类别 -->
        SELECT IFNULL(MAX(c.`sub_weight`),0) FROM `yeshi_ec_sub_class` c WHERE c.`sub_root_id` = ${rootId}
        SELECT IFNULL(MAX(c.`sub_weight`),0) FROM `yeshi_ec_sub_class` c WHERE
        c.`sub_root_id` = ${rootId}
   </select>
   <select id="getMaxWeightByPid" resultType="java.lang.Integer">
      <!-- 条件二级类别 -->
        SELECT IFNULL(MAX(c.`sub_weight`),0) FROM `yeshi_ec_sub_class` c WHERE c.`sub_root_id` = ${rootId}
        SELECT IFNULL(MAX(c.`sub_weight`),0) FROM `yeshi_ec_sub_class` c WHERE
        c.`sub_root_id` = ${rootId}
   </select>
   <select id="queryByListCid" resultMap="SimpleResultMap">
       SELECT * FROM yeshi_ec_sub_class
       WHERE sub_state = 1 AND sub_root_id in
            <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
                ${item}
            </foreach>
        SELECT * FROM yeshi_ec_sub_class WHERE sub_state = 1 AND sub_root_id
        in
        <foreach collection="list" index="index" item="item"
            separator="," open="(" close=")">${item}</foreach>
      ORDER BY sub_weight
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/TaoBaoClassMapper.xml
@@ -53,6 +53,14 @@
         LIMIT  ${start},${count}
  </select>
  
   <select id="listBySystemSubCid" resultMap="BaseResultMap">
         SELECT <include refid="Base_Column_List"/> FROM `yeshi_ec_taobao_class` tc
         LEFT JOIN `yeshi_ec_taobao_class_mapper` tm ON tc.`tc_id` = tm.`tm_taobao_cid`
         WHERE tm.`tm_system_sub_cid`= #{systemCid}
         ORDER BY tm.`tm_weight` DESC
         LIMIT  ${start},${count}
  </select>
   <select id="getByCategoryId" resultMap="BaseResultMap">
         SELECT * FROM `yeshi_ec_taobao_class` 
         WHERE tc_category_id = #{categoryId}
fanli/src/main/java/com/yeshi/fanli/mapping/TaoBaoClassRelationMapper.xml
@@ -2,7 +2,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">
    <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"/>
@@ -11,13 +12,35 @@
    <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}
    <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>
  <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
    <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>
    <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>
@@ -26,7 +49,8 @@
      <if test="weight != null">tm_weight,</if>
      <if test="createtime != null">tm_createtime,</if>
      <if test="updatetime != null">tm_updatetime,</if>
    </trim>values
        </trim>
        values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="cid != null">#{cid,jdbcType=BIGINT},</if>
@@ -37,8 +61,18 @@
      <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
    <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>
@@ -46,17 +80,25 @@
      <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}
        </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
    <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
        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`
    <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>
@@ -66,4 +108,5 @@
      where tm_taobao_cid = #{localCid,jdbcType=BIGINT}
  </delete>
  
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/msg/UserMsgUnReadNumMapper.xml
@@ -19,12 +19,15 @@
            jdbcType="TIMESTAMP" />
        <result column="mrs_update_time" property="updateTime"
            jdbcType="TIMESTAMP" />
        <result column="mrs_type_guanxuan_read_time" property="guanXuanReadTime"
            jdbcType="TIMESTAMP" />
        <association property="user" column="mrs_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="mrs_uid" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">mrs_id,mrs_uid,mrs_type_order,mrs_type_money,mrs_type_account,mrs_type_invite,mrs_type_score,mrs_type_system,mrs_type_other,mrs_create_time,mrs_update_time
    <sql id="Base_Column_List">mrs_id,mrs_uid,mrs_type_order,mrs_type_money,mrs_type_account,mrs_type_invite,mrs_type_score,mrs_type_system,mrs_type_other,mrs_create_time,mrs_update_time,mrs_type_guanxuan_read_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -32,25 +35,21 @@
        <include refid="Base_Column_List" />
        from yeshi_ec_msg_read_state where mrs_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByUid" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_msg_read_state where mrs_uid = #{uid,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_msg_read_state where mrs_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_msg_read_state
        (mrs_id,mrs_uid,mrs_type_order,mrs_type_money,mrs_type_account,mrs_type_invite,mrs_type_score,mrs_type_system,mrs_type_other,mrs_create_time,mrs_update_time)
        (mrs_id,mrs_uid,mrs_type_order,mrs_type_money,mrs_type_account,mrs_type_invite,mrs_type_score,mrs_type_system,mrs_type_other,mrs_create_time,mrs_update_time,mrs_type_zhushou_read_time,mrs_type_guanxuan_read_time,mrs_type_recommend_read_time)
        values
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{typeOrder,jdbcType=INTEGER},#{typeMoney,jdbcType=INTEGER},#{typeAccount,jdbcType=INTEGER},#{typeInvite,jdbcType=INTEGER},#{typeScore,jdbcType=INTEGER},#{typeSystem,jdbcType=INTEGER},#{typeOther,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{typeOrder,jdbcType=INTEGER},#{typeMoney,jdbcType=INTEGER},#{typeAccount,jdbcType=INTEGER},#{typeInvite,jdbcType=INTEGER},#{typeScore,jdbcType=INTEGER},#{typeSystem,jdbcType=INTEGER},#{typeOther,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{guanXuanReadTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum"
        useGeneratedKeys="true" keyProperty="id">
@@ -67,6 +66,7 @@
            <if test="typeOther != null">mrs_type_other,</if>
            <if test="createTime != null">mrs_create_time,</if>
            <if test="updateTime != null">mrs_update_time,</if>
            <if test="guanXuanReadTime != null">mrs_type_guanxuan_read_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -81,6 +81,7 @@
            <if test="typeOther != null">#{typeOther,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="guanXuanReadTime != null">#{guanXuanReadTime,jdbcType=TIMESTAMP}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum">update
@@ -94,7 +95,9 @@
        #{typeSystem,jdbcType=INTEGER},mrs_type_other =
        #{typeOther,jdbcType=INTEGER},mrs_create_time =
        #{createTime,jdbcType=TIMESTAMP},mrs_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where mrs_id = #{id,jdbcType=BIGINT}
        #{updateTime,jdbcType=TIMESTAMP} ,mrs_type_guanxuan_read_time
        =#{guanXuanReadTime,jdbcType=TIMESTAMP} where mrs_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum">
        update yeshi_ec_msg_read_state
@@ -109,6 +112,11 @@
            <if test="typeOther != null">mrs_type_other=#{typeOther,jdbcType=INTEGER},</if>
            <if test="createTime != null">mrs_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">mrs_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="id !=null">mrs_id =#{id,jdbcType=BIGINT},</if>
            <if test="guanXuanReadTime !=null">mrs_type_guanxuan_read_time
                =#{guanXuanReadTime,jdbcType=TIMESTAMP},
            </if>
        </set>
        where mrs_id = #{id,jdbcType=BIGINT}
    </update>
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java
@@ -27,6 +27,7 @@
import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Service
@@ -43,7 +44,6 @@
    
    @Resource
    private TaoBaoClassService taoBaoClassService;
    public GoodsClass getGoodsClass(long id) {
        return goodsClassMapper.selectByPrimaryKey(id);
@@ -69,19 +69,16 @@
        return goodsClassMapper.updateByPrimaryKeySelective(record);
    }
    
    @Cacheable(value="classCache",key="'getGoodsClass-'+#gcid")
    @Override
    public GoodsClass getGoodsClassCache(long gcid) {
        return getGoodsClass(gcid);
    }
    @Override
    public void deleteGoodsClass(long id) {
        goodsClassMapper.deleteByPrimaryKey(id);
    }
    @Override
    public List<GoodsClass> listquery() throws Exception{
@@ -118,7 +115,6 @@
            int countlabel = labelClassService.getCountQueryByClassId(gclass.getId());
            gclass.setCountlabel(countlabel);
            
            List<TaoBaoClass> listTB = taoBaoClassService.listBySystemCid(0, Integer.MAX_VALUE, gclass.getId());
            if (listTB == null || listTB.size() == 0) {
                gclass.setTaobaoCids("");
@@ -142,7 +138,6 @@
        return goodsClassMapper.getGoodsClassAll();
    }
    @Override
    @Transactional
    public void saveObject(MultipartFile file, GoodsClass record) throws GoodsClassException, Exception{
@@ -165,8 +160,6 @@
            throw new GoodsClassException(1, "筛选条件非JSON格式");
        }
        
        Long id = record.getId();
        if (id == null) {
            record.setPicture(picture);
@@ -179,10 +172,10 @@
                record.setState(0);
            }
            
            if (params== null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
                // 搜索条件:有券、在售价20-200、牛皮癣轻微
                record.setSearchParam("{\"quan\":1,\"endPrice\":220,\"includeGoodRate\":true,\"baoYou\":true,\"ip\":\"218.72.111.105\"}");
                record.setSearchParam(
                        "{\"quan\":1,\"endPrice\":220,\"includeGoodRate\":true,\"baoYou\":true,\"ip\":\"218.72.111.105\"}");
            }
            
            // 排序
@@ -221,9 +214,9 @@
        }
    }
    
    /**
     * 上传图片
     *
     * @param file
     * @return
     * @throws Exception
@@ -245,15 +238,16 @@
    /**
     * 删除图片-不更新数据库
     *
     * @param record
     * @throws Exception
     */
    public void removePicture(String picture) throws Exception {
        if (!Constant.IS_TEST)
        if (picture != null && picture.trim().length() > 0) {
            COSManager.getInstance().deleteFile(picture);
        }
    }
    
    @Override
    public void uploadPicture(GoodsClass record, MultipartFile file) throws Exception {
@@ -312,7 +306,6 @@
        return goodsClassMapper.getEffectiveClass();
    }
    
    @Override
    @Cacheable(value="classCache",key="'getClassListAllCache'+#changePicture")
    public List<Map<String, Object>> getClassListAllCache(boolean changePicture) throws Exception {
@@ -356,7 +349,6 @@
                        iterator.remove();
                    }
                    
                }
            }
@@ -369,7 +361,6 @@
        return list;
    }
    
    @Override
    @Transactional
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSubClassServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.goods;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@@ -19,6 +20,7 @@
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.exception.GoodsSubClassException;
import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.util.StringUtil;
@@ -32,6 +34,8 @@
    @Resource
    private LabelClassService labelClassService;
    
    @Resource
    private TaoBaoClassService taoBaoClassService;
    @Override
    public int deleteByPrimaryKey(Long id) {
@@ -58,7 +62,6 @@
        return goodsSubClassMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    @Transactional
    public void deleteByRootId(Long id) throws Exception {
@@ -80,7 +83,6 @@
            }
        }
    }
    
    @Override
    @Transactional
@@ -119,10 +121,9 @@
        goodsSubClassMapper.deleteByPrimaryKey(recordId);
    }
    @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)
            throws GoodsSubClassException, Exception {
        
        String name = record.getName();
        if (name == null || name.trim().length() == 0) {
@@ -140,7 +141,6 @@
        if (file2 != null) {
            pictureSecond = uploadPicture(file2);
        }
        
        String params = record.getSearchParam();
        if (params== null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
@@ -164,7 +164,6 @@
            if (pid == null) {
                throw new GoodsSubClassException(1, "上级id为空");
            }
            
            if (type == 2) {
                record.setRootClass(new GoodsClass(pid));
@@ -213,7 +212,6 @@
                record.setPicture(resultObj.getPicture());
            }
            
            if (pictureSecond != null && pictureSecond.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPictureSecond());
@@ -232,10 +230,23 @@
            record.setUpdatetime(new Date());
            goodsSubClassMapper.updateByPrimaryKey(record);
        }
        // 保存淘宝商品分类id
        String taobaoCids = record.getTaobaoCids();
        if (!StringUtil.isNullOrEmpty(taobaoCids) && !"null".equalsIgnoreCase(taobaoCids)) {
            List<Long> tbCidList = new ArrayList<>();
            String[] sts = taobaoCids.split(",");
            for (String st : sts) {
                String cid = st.split("-")[st.split("-").length - 1];
                tbCidList.add(Long.parseLong(cid));
            }
            taoBaoClassService.saveSub(record.getId(), tbCidList);
        }
    }
    /**
     * 上传图片
     *
     * @param file
     * @return
     * @throws Exception
@@ -257,6 +268,7 @@
    /**
     * 删除图片
     *
     * @param record
     * @throws Exception
     */
@@ -265,9 +277,6 @@
            COSManager.getInstance().deleteFile(picture);
        }
    }
    /**
     * 删除图片
@@ -305,7 +314,6 @@
        return goodsSubClassMapper.queryByPid(pid, state);
    }
    @Override
    public List<GoodsSubClass> queryByRootIdAndWeight(Long rootId,int type, int weight) throws Exception {
        return goodsSubClassMapper.queryByRootIdAndWeight(rootId, type, weight);
@@ -316,12 +324,10 @@
        return goodsSubClassMapper.queryByPidAndWeight(pid, type, weight);
    }
    @Override
    public List<GoodsSubClass> getGoodsSecondClass(Long rootId, Integer state) throws Exception {
        return goodsSubClassMapper.queryByRootId(rootId, state);
    }
    
    @Override
    @Cacheable(value="classCache",key="'getSubClassCache-'+#rootId +'-'+#state")
@@ -329,18 +335,17 @@
        return getGoodsSecondClass(rootId, state);
    }
    
    @Override
    @Cacheable(value="classCache",key="'getSubClassByPrimaryKeyCache-'+#id")
    public GoodsSubClass getSubClassByPrimaryKeyCache(Long id) throws Exception {
        return selectByPrimaryKey(id);
    }
    
    /**
     *  统计一级之下的所有二级分类
     * @param rootId  一级id
     *
     * @param rootId
     *            一级id
     * @returnL
     */
    @Override
@@ -350,14 +355,15 @@
    
    /**
     *  统计二级分类之下其他分类
     * @param rootId  一级id
     *
     * @param rootId
     *            一级id
     * @return
     */
    @Override
    public int countByPid(Long pid){
        return goodsSubClassMapper.countByPid(pid);
    }
    
    @Override
    public void countClick(AcceptData acceptData, GoodsSubClass record) {
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoClassServiceImpl.java
@@ -25,7 +25,6 @@
    @Resource
    private TaoBaoClassRelationMapper taoBaoClassRelationMapper;
    @Override
    public List<TaoBaoClass> listBySystemCid(long start, int count, Long systemCid) {
        return taoBaoClassMapper.listBySystemCid(start, count, systemCid);
@@ -54,12 +53,10 @@
        return taobaoCatIds;
    }
    
    @Override
    public TaoBaoClass getByCategoryId(Integer categoryId) {
        return taoBaoClassMapper.getByCategoryId(categoryId);
    }
    
    @Override
    @Transactional
@@ -75,7 +72,6 @@
                listId.add(taoBaoClass.getId());
            }
        }
        
        String[] array = taobaoCids.split(",");
        for (String info: array) {
@@ -144,4 +140,33 @@
        }
    }
    
    @Transactional
    @Override
    public void saveSub(Long subClassId, List<Long> taobaoCids) {
        if (taobaoCids == null || taobaoCids.size() == 0) {
            return;
        }
        // 删除之前的,插入现在的
        taoBaoClassRelationMapper.deleteBySubId(subClassId);
        for (Long categoryId : taobaoCids) {
            TaoBaoClass taoBaoClass = taoBaoClassMapper.getByCategoryId(Integer.parseInt(categoryId + ""));
            if (taoBaoClass == null)
                continue;
            TaoBaoClassRelation relation = new TaoBaoClassRelation();
            relation.setSubId(subClassId);
            relation.setTaobaoCid(taoBaoClass.getId());
            relation.setCreatetime(new Date());
            relation.setUpdatetime(new Date());
            relation.setWeight(0.0);
            taoBaoClassRelationMapper.insertSelective(relation);
        }
    }
    @Override
    public List<TaoBaoClass> listBySystemSubCid(long start, int count, Long systemSubCid) {
        return taoBaoClassMapper.listBySystemSubCid(start, count, systemSubCid);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/push/DeviceActiveServiceImpl.java
@@ -76,8 +76,7 @@
        } else if ("ios".equalsIgnoreCase(platform)) {
            deviceActive = deviceActiveMapper.selectByDeviceToeknMd5AndPlatform(StringUtil.Md5(deviceToken),
                    DeviceActive.PLATFORM_IOS);
            deviceActive = deviceActiveMapper.selectByDeviceAndPlatform(device, DeviceActive.PLATFORM_IOS);
        }
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/TaoBaoClassService.java
@@ -11,6 +11,9 @@
    
    public List<TaoBaoClass> listBySystemCid(long start, int count, Long systemCid);
    public List<TaoBaoClass> listBySystemSubCid(long start, int count, Long systemSubCid);
    /**
     * 根据系统主类查询淘宝类目id
     * @param classId
@@ -27,4 +30,11 @@
     */
    public void save(Long classId, String taobaoCids);
    /**
     * 保存二级分类
     * @param classId
     * @param taobaoCids
     */
    public void saveSub(Long subId, List<Long> taobaoCids);
}