admin
2019-05-06 973abe9ae7abf712e370f582abb4a6d381096d9f
分类修改
16个文件已修改
1320 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsClassAdminCotroller.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsSubClassAdminController.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java 49 ●●●●● 补丁 | 查看 | 原始文档 | 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 72 ●●●●● 补丁 | 查看 | 原始文档 | 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 400 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/TaoBaoClassMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/TaoBaoClassRelationMapper.xml 171 ●●●●● 补丁 | 查看 | 原始文档 | 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 185 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSubClassServiceImpl.java 138 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoClassServiceImpl.java 93 ●●●●● 补丁 | 查看 | 原始文档 | 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,22 +38,20 @@
    @Resource
    private SuperGoodsClassService superGoodsClassService;
    @Resource
    private GoodsSecondClassService goodsSecondClassService;
    @Resource
    private GoodsSubClassService goodsSubClassService;
    @Resource
    private LabelClassService labelClassService;
    @Resource
    private BusinessSystemService businessSystemService;
    @RequestMapping(value = "queryAll")
    public void listquery(String callback,  PrintWriter out) {
    public void listquery(String callback, PrintWriter out) {
        try {
            List<GoodsClass> goodsClassList = goodsClassService.listquery();
@@ -74,7 +72,6 @@
    }
    @RequestMapping(value = "getGoodsClasAll")
    public void getGoodsClassAll(String callback, PrintWriter out) {
        List<GoodsClass> goodsClassList = goodsClassService.getGoodsClassAll();
@@ -89,7 +86,6 @@
        }
    }
    /**
     * 保存信息
     * 
@@ -98,16 +94,17 @@
     * @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 是否含有文件类型
            // 1. 先判断httpRequest 是否含有文件类型
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                goodsClassService.saveObject(fileRequest.getFile("file"), goodsClass);
            }else{
                goodsClassService.saveObject(null, goodsClass);
            }
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                goodsClassService.saveObject(fileRequest.getFile("file"), goodsClass);
            } else {
                goodsClassService.saveObject(null, goodsClass);
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (FloatADException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -116,7 +113,6 @@
            e.printStackTrace();
        }
    }
    /**
     * 修改排序
@@ -137,7 +133,7 @@
            e.printStackTrace();
        }
    }
    /**
     * 批量删除
     * 
@@ -162,12 +158,12 @@
                    Long recordId = Long.parseLong(id);
                    superGoodsClassService.deleteSuperGoodsClass(recordId);
                    // 删除子类分类
                    goodsSubClassService.deleteByRootId(recordId);
                    // 删除类别关联标签
                    labelClassService.deleteByClassId(recordId);
                    goodsClassService.deleteGoodsClass(recordId);
                }
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("删除成功"));
@@ -179,8 +175,6 @@
        }
    }
    /**
     * 删除图片
@@ -210,9 +204,10 @@
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
        }
    }
    @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,8 +221,7 @@
            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,8 +36,9 @@
    @Resource
    private LabelClassService labelClassService;
    @Resource
    private TaoBaoClassService taoBaoClassService;
    /**
     * 保存信息
     * 
@@ -43,16 +47,18 @@
     * @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 是否含有文件类型
            // 1. 先判断httpRequest 是否含有文件类型
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                goodsSubClassService.saveObject(fileRequest.getFile("file"),fileRequest.getFile("file2"), goodsSubClass, type, pid);
            }else{
                goodsSubClassService.saveObject(null, null, goodsSubClass, type, pid);
            }
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                goodsSubClassService.saveObject(fileRequest.getFile("file"), fileRequest.getFile("file2"),
                        goodsSubClass, type, pid);
            } else {
                goodsSubClassService.saveObject(null, null, goodsSubClass, type, pid);
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (FloatADException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -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();
        }
    }
    /**
     * 删除图片
@@ -137,20 +142,20 @@
     * @param out
     */
    @RequestMapping(value = "querySub")
    public void querySub(String callback, Long pid, Integer type,PrintWriter out) {
    public void querySub(String callback, Long pid, Integer type, PrintWriter out) {
        try {
            if (pid == null) {
                out.print(JsonUtil.loadFalseResult("上级id为空"));
                return;
            }
            if (type == null) {
                out.print(JsonUtil.loadFalseResult("等级不能为空"));
                return;
            }
            Integer state = null;
            List<GoodsSubClass> goodsSubClassList = new ArrayList<GoodsSubClass>();
            if (type == 2) {
@@ -158,36 +163,52 @@
            } else {
                goodsSubClassList = goodsSubClassService.queryByPid(pid, state);
            }
            if (goodsSubClassList == null || goodsSubClassList.size() == 0) {
                out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("暂无数据")));
                return;
            }
            for (GoodsSubClass goodsSubClass:goodsSubClassList) {
            }
            for (GoodsSubClass goodsSubClass : goodsSubClassList) {
                Long iosClick = goodsSubClass.getIosClick();
                Long androidClick = goodsSubClass.getAndroidClick();
                if (iosClick != null && androidClick != null) {
                    goodsSubClass.setCountClick(iosClick+androidClick);
                } else if(androidClick != null) {
                    goodsSubClass.setCountClick(iosClick + androidClick);
                } else if (androidClick != null) {
                    goodsSubClass.setCountClick(androidClick);
                } else if(iosClick != null) {
                } else if (iosClick != null) {
                    goodsSubClass.setCountClick(iosClick);
                } else{
                } else {
                    goodsSubClass.setCountClick(0l);
                }
                String searchJson = goodsSubClass.getSearchJson();
                if (searchJson == null) {
                    goodsSubClass.setSearchParam("");
                } else {
                    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();
@@ -204,7 +225,6 @@
        }
    }
    /**
     * 查找二级下的其他级分类
     * 
@@ -236,8 +256,7 @@
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
        }
    }
    /**
     * 修改排序
     * 
@@ -248,36 +267,36 @@
    @RequestMapping(value = "saveOrder")
    public void saveOrder(String callback, Long id, Integer type, Integer moveType, PrintWriter out) {
        try {
            if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递的类型不正确"));
                return;
            }
            GoodsSubClass resultObj = goodsSubClassService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("不存在该类别"));
                return;
            }
            }
            int resultWeight = resultObj.getWeight();
            List<GoodsSubClass> list = null;
            if (type == 2) {
                GoodsClass rootClass = resultObj.getRootClass();
                list= goodsSubClassService.queryByRootIdAndWeight(rootClass.getId(), moveType, resultWeight);
                list = goodsSubClassService.queryByRootIdAndWeight(rootClass.getId(), moveType, resultWeight);
            } else {
                GoodsSubClass parent = resultObj.getParent();
                list = goodsSubClassService.queryByPidAndWeight(parent.getId(), moveType, resultWeight);
            }
            if (list != null && list.size() > 0) {
                GoodsSubClass changeObj = list.get(0);
                // 交换排序序号
                resultObj.setWeight(changeObj.getWeight());
                changeObj.setWeight(resultWeight);
                changeObj.setUpdatetime(new Date());
                goodsSubClassService.updateByPrimaryKeySelective(changeObj);
            }
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));
        // 推荐记录
        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", "推荐记录",
                        list.get(0).getCreateTime(), UserCommonMsgVO.TYPE_RECOMMEND, list.get(0).getContent(), false,
                        jumpDetailV2Service.getByTypeCache("recommend_list"), null));
            }
        }
        //
        // list = pushGoodsService.listHistoryByPushTime(0, 1, uid, createTime);
        commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_recommend.png", "推荐记录",
                new Date(), UserCommonMsgVO.TYPE_RECOMMEND, "防油防水防潮,污渍一抹即净,从胃到心的暖意", false,
                jumpDetailV2Service.getByTypeCache("recommend_list"), null));
        // 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
@@ -25,64 +25,67 @@
    @Expose
    @Column(name = "sub_id")
    private Long id;
    @Expose
    @Column(name = "sub_name")
    private String name;  // 名称
    private String name; // 名称
    @Expose
    @Column(name = "sub_picture")
    private String picture; // 图片路径
    @Column(name = "sub_picture_second")
    private String pictureSecond; // 新版图片1.5.3
    @Column(name = "sub_weight")
    private Integer weight; // 权重-排序
    @Column(name = "sub_state")
    private Integer state;  // 状态 1启用  0停用
    private Integer state; // 状态 1启用 0停用
    @Column(name = "sub_root_id")
    private GoodsClass rootClass; // 一级类别
    @Column(name = "sub_pid")
    private GoodsSubClass parent ; // 上级:对应的二级以下分类  用于3级、4级、5级
    private GoodsSubClass parent; // 上级:对应的二级以下分类 用于3级、4级、5级
    @Column(name = "sub_level")
    private Integer level;  // 具体等级
    private Integer level; // 具体等级
    @Column(name = "sub_key")
    private String key;  // 搜索关键词
    private String key; // 搜索关键词
    @Column(name = "sub_search_json")
    private String searchJson;  // 搜索条件
    private String searchJson; // 搜索条件
    @Column(name = "sub_ios_click")
    private Long iosClick = 0l;
    private Long iosClick = 0l;
    @Column(name = "sub_android_click")
    private Long androidClick = 0l;
    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;
    private Long countClick = 0l;
    // 关联标签数量
    private int countlabel = 0;
    private int countlabel = 0;
    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,199 +2,209 @@
<!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">
    <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_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_ios_click" property="iosClick" 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>
    <association property="parent" column="sub_pid"
        select="com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper.selectByPrimaryKey">
    </association>
  </resultMap>
  <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_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_ios_click" property="iosClick" 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">
        <id column="sub_root_id" property="id" jdbcType="BIGINT" />
    </association>
    <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}
  </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
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">sub_id,</if>
      <if test="name != null">sub_name,</if>
      <if test="picture != null">sub_picture,</if>
      <if test="pictureSecond != null">sub_picture_second,</if>
      <if test="weight != null">sub_weight,</if>
      <if test="rootClass != null">sub_root_id,</if>
      <if test="parent != null">sub_pid,</if>
      <if test="level != null">sub_level,</if>
      <if test="state != null">sub_state,</if>
      <if test="key != null">sub_key,</if>
      <if test="searchJson != null">sub_search_json,</if>
      <if test="iosClick != null">sub_ios_click,</if>
      <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 prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="pictureSecond != null">#{pictureSecond,jdbcType=VARCHAR},</if>
      <if test="weight != null">#{weight,jdbcType=INTEGER},</if>
      <if test="rootClass != null">#{rootClass.id,jdbcType=BIGINT},</if>
      <if test="parent != null">#{parent.id,jdbcType=BIGINT},</if>
      <if test="level != null">#{level,jdbcType=INTEGER},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
      <if test="key != null">#{key,jdbcType=VARCHAR},</if>
      <if test="searchJson != null">#{searchJson,jdbcType=VARCHAR},</if>
      <if test="iosClick != null">#{iosClick,jdbcType=BIGINT},</if>
      <if test="androidClick != null">#{androidClick,jdbcType=BIGINT},</if>
      <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.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="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>
      <if test="level != null">sub_level=#{level,jdbcType=INTEGER},</if>
      <if test="level != null">sub_state=#{state,jdbcType=INTEGER},</if>
      <if test="key != null">sub_key=#{key,jdbcType=VARCHAR},</if>
      <if test="searchJson != null">sub_search_json=#{searchJson,jdbcType=VARCHAR},</if>
      <if test="iosClick != null">sub_ios_click=#{iosClick,jdbcType=BIGINT},</if>
      <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}
  </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>
        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>
        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} ]]>
            order by sub_weight desc
        </if>
        <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} ]]>
            order by sub_weight desc
        </if>
        <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>
   <select id="countByPid" resultType="java.lang.Integer">
      <!-- 条件二级类别 -->
    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>
   <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>
   <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>
      ORDER BY sub_weight
   </select>
    <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_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_ios_click" property="iosClick" 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 property="parent" column="sub_pid"
            select="com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper.selectByPrimaryKey" />
    </resultMap>
    <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_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_ios_click" property="iosClick" 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">
            <id column="sub_root_id" property="id" jdbcType="BIGINT" />
        </association>
        <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}
    </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,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>
            <if test="picture != null">sub_picture,</if>
            <if test="pictureSecond != null">sub_picture_second,</if>
            <if test="weight != null">sub_weight,</if>
            <if test="rootClass != null">sub_root_id,</if>
            <if test="parent != null">sub_pid,</if>
            <if test="level != null">sub_level,</if>
            <if test="state != null">sub_state,</if>
            <if test="key != null">sub_key,</if>
            <if test="searchJson != null">sub_search_json,</if>
            <if test="iosClick != null">sub_ios_click,</if>
            <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 prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="name != null">#{name,jdbcType=VARCHAR},</if>
            <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
            <if test="pictureSecond != null">#{pictureSecond,jdbcType=VARCHAR},</if>
            <if test="weight != null">#{weight,jdbcType=INTEGER},</if>
            <if test="rootClass != null">#{rootClass.id,jdbcType=BIGINT},</if>
            <if test="parent != null">#{parent.id,jdbcType=BIGINT},</if>
            <if test="level != null">#{level,jdbcType=INTEGER},</if>
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="key != null">#{key,jdbcType=VARCHAR},</if>
            <if test="searchJson != null">#{searchJson,jdbcType=VARCHAR},</if>
            <if test="iosClick != null">#{iosClick,jdbcType=BIGINT},</if>
            <if test="androidClick != null">#{androidClick,jdbcType=BIGINT},</if>
            <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
            <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.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="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>
            <if test="level != null">sub_level=#{level,jdbcType=INTEGER},</if>
            <if test="level != null">sub_state=#{state,jdbcType=INTEGER},</if>
            <if test="key != null">sub_key=#{key,jdbcType=VARCHAR},</if>
            <if test="searchJson != null">sub_search_json=#{searchJson,jdbcType=VARCHAR},</if>
            <if test="iosClick != null">sub_ios_click=#{iosClick,jdbcType=BIGINT},</if>
            <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}
    </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>
        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>
        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} ]]>
            order by sub_weight desc
        </if>
        <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} ]]>
            order by sub_weight desc
        </if>
        <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>
    <select id="countByPid" resultType="java.lang.Integer">
        <!-- 条件二级类别 -->
        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>
    <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>
    <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>
        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,68 +2,111 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.TaoBaoClassRelationMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation">
    <id column="tm_id" property="id" jdbcType="BIGINT"/>
    <result column="tm_system_cid" property="cid" jdbcType="BIGINT"/>
    <result column="tm_system_sub_cid" property="subId" jdbcType="BIGINT"/>
    <result column="tm_taobao_cid" property="taobaoCid" jdbcType="TIMESTAMP"/>
    <result column="tm_weight" property="weight" jdbcType="DOUBLE"/>
    <result column="tm_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="tm_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">tm_id,tm_system_cid,tm_system_sub_cid,tm_taobao_cid,tm_weight,tm_createtime,tm_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_taobao_class_mapper where tm_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_taobao_class_mapper where tm_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_class_mapper (tm_id,tm_system_cid,tm_system_sub_cid,tm_taobao_cid,tm_weight,tm_createtime,tm_updatetime) values (#{id,jdbcType=BIGINT},#{cid,jdbcType=BIGINT},#{subId,jdbcType=BIGINT},#{taobaoCid,jdbcType=BIGINT},#{weight,jdbcType=DOUBLE},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_class_mapper
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">tm_id,</if>
      <if test="cid != null">tm_system_cid,</if>
      <if test="subId != null">tm_system_sub_cid,</if>
      <if test="taobaoCid != null">tm_taobao_cid,</if>
      <if test="weight != null">tm_weight,</if>
      <if test="createtime != null">tm_createtime,</if>
      <if test="updatetime != null">tm_updatetime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="cid != null">#{cid,jdbcType=BIGINT},</if>
      <if test="subId != null">#{subId,jdbcType=BIGINT},</if>
      <if test="taobaoCid != null">#{taobaoCid,jdbcType=BIGINT},</if>
      <if test="weight != null">#{weight,jdbcType=DOUBLE},</if>
      <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation">update yeshi_ec_taobao_class_mapper set tm_system_cid = #{cid,jdbcType=BIGINT},tm_system_sub_cid = #{subId,jdbcType=BIGINT},tm_taobao_cid = #{taobaoCid,jdbcType=BIGINT},tm_weight = #{weight,jdbcType=DOUBLE},tm_createtime = #{createtime,jdbcType=TIMESTAMP},tm_updatetime = #{updatetime,jdbcType=TIMESTAMP} where tm_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation">update yeshi_ec_taobao_class_mapper
    <set>
      <if test="cid != null">tm_system_cid=#{cid,jdbcType=BIGINT},</if>
      <if test="subId != null">tm_system_sub_cid=#{subId,jdbcType=BIGINT},</if>
      <if test="taobaoCid != null">tm_taobao_cid=#{taobaoCid,jdbcType=BIGINT},</if>
      <if test="weight != null">tm_weight=#{weight,jdbcType=DOUBLE},</if>
      <if test="createtime != null">tm_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">tm_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where tm_id = #{id,jdbcType=BIGINT}
  </update>
   <select id="listByTaoBaoCid" resultMap="BaseResultMap" parameterType="java.lang.Long">
         SELECT <include refid="Base_Column_List"/> FROM `yeshi_ec_taobao_class_mapper` tm
         LEFT JOIN `yeshi_ec_taobao_class` tc ON tc.`tc_id` = tm.`tm_taobao_cid`
         WHERE tc.`tc_category_id`= #{taobaoCid,jdbcType=BIGINT}  ORDER BY tm.`tm_weight` DESC LIMIT 0,10
  </select>
  <select id="getByLocalCid" resultMap="BaseResultMap" parameterType="java.lang.Long">
         SELECT <include refid="Base_Column_List"/> FROM `yeshi_ec_taobao_class_mapper`
         WHERE tm_taobao_cid = #{localCid,jdbcType=BIGINT}
         LIMIT 1
  </select>
  <delete id="deleteRelationByLocalCid" parameterType="java.lang.Long">
      delete from yeshi_ec_taobao_class_mapper
      where tm_taobao_cid = #{localCid,jdbcType=BIGINT}
  </delete>
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation">
        <id column="tm_id" property="id" jdbcType="BIGINT" />
        <result column="tm_system_cid" property="cid" jdbcType="BIGINT" />
        <result column="tm_system_sub_cid" property="subId" jdbcType="BIGINT" />
        <result column="tm_taobao_cid" property="taobaoCid" jdbcType="TIMESTAMP" />
        <result column="tm_weight" property="weight" jdbcType="DOUBLE" />
        <result column="tm_createtime" property="createtime" jdbcType="TIMESTAMP" />
        <result column="tm_updatetime" property="updatetime" jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">tm_id,tm_system_cid,tm_system_sub_cid,tm_taobao_cid,tm_weight,tm_createtime,tm_updatetime
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_taobao_class_mapper where tm_id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_taobao_class_mapper where tm_id = #{id,jdbcType=BIGINT}
    </delete>
    <delete id="deleteBySubId" parameterType="java.lang.Long">delete from
        yeshi_ec_taobao_class_mapper where tm_system_sub_cid = #{0}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_taobao_class_mapper
        (tm_id,tm_system_cid,tm_system_sub_cid,tm_taobao_cid,tm_weight,tm_createtime,tm_updatetime)
        values
        (#{id,jdbcType=BIGINT},#{cid,jdbcType=BIGINT},#{subId,jdbcType=BIGINT},#{taobaoCid,jdbcType=BIGINT},#{weight,jdbcType=DOUBLE},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_taobao_class_mapper
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">tm_id,</if>
            <if test="cid != null">tm_system_cid,</if>
            <if test="subId != null">tm_system_sub_cid,</if>
            <if test="taobaoCid != null">tm_taobao_cid,</if>
            <if test="weight != null">tm_weight,</if>
            <if test="createtime != null">tm_createtime,</if>
            <if test="updatetime != null">tm_updatetime,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="cid != null">#{cid,jdbcType=BIGINT},</if>
            <if test="subId != null">#{subId,jdbcType=BIGINT},</if>
            <if test="taobaoCid != null">#{taobaoCid,jdbcType=BIGINT},</if>
            <if test="weight != null">#{weight,jdbcType=DOUBLE},</if>
            <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
            <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation">update yeshi_ec_taobao_class_mapper set tm_system_cid =
        #{cid,jdbcType=BIGINT},tm_system_sub_cid =
        #{subId,jdbcType=BIGINT},tm_taobao_cid =
        #{taobaoCid,jdbcType=BIGINT},tm_weight =
        #{weight,jdbcType=DOUBLE},tm_createtime =
        #{createtime,jdbcType=TIMESTAMP},tm_updatetime =
        #{updatetime,jdbcType=TIMESTAMP} where tm_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation">
        update yeshi_ec_taobao_class_mapper
        <set>
            <if test="cid != null">tm_system_cid=#{cid,jdbcType=BIGINT},</if>
            <if test="subId != null">tm_system_sub_cid=#{subId,jdbcType=BIGINT},</if>
            <if test="taobaoCid != null">tm_taobao_cid=#{taobaoCid,jdbcType=BIGINT},</if>
            <if test="weight != null">tm_weight=#{weight,jdbcType=DOUBLE},</if>
            <if test="createtime != null">tm_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
            <if test="updatetime != null">tm_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
        </set>
        where tm_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="listByTaoBaoCid" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        SELECT
        <include refid="Base_Column_List" />
        FROM `yeshi_ec_taobao_class_mapper` tm
        LEFT JOIN `yeshi_ec_taobao_class` tc ON tc.`tc_id` = tm.`tm_taobao_cid`
        WHERE tc.`tc_category_id`= #{taobaoCid,jdbcType=BIGINT} ORDER BY
        tm.`tm_weight` DESC LIMIT 0,10
    </select>
    <select id="getByLocalCid" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        SELECT
        <include refid="Base_Column_List" />
        FROM `yeshi_ec_taobao_class_mapper`
        WHERE tm_taobao_cid = #{localCid,jdbcType=BIGINT}
        LIMIT 1
    </select>
    <delete id="deleteRelationByLocalCid" parameterType="java.lang.Long">
        delete from yeshi_ec_taobao_class_mapper
        where tm_taobao_cid = #{localCid,jdbcType=BIGINT}
    </delete>
</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
@@ -34,16 +35,15 @@
    @Resource
    private GoodsClassMapper goodsClassMapper;
    @Resource
    private GoodsSubClassService goodsSubClassService;
    @Resource
    private LabelClassService labelClassService;
    @Resource
    private TaoBaoClassService taoBaoClassService;
    public GoodsClass getGoodsClass(long id) {
        return goodsClassMapper.selectByPrimaryKey(id);
@@ -53,44 +53,41 @@
    public int updateByPrimaryKey(GoodsClass record) {
        return goodsClassMapper.updateByPrimaryKey(record);
    }
    @Override
    public String getKeysById(Long id) {
        return goodsClassMapper.getKeysById(id);
    }
    @Override
    public GoodsClass selectByPrimaryKey(Long gcid) {
        return goodsClassMapper.selectByPrimaryKey(gcid);
    }
    @Override
    public int updateByPrimaryKeySelective(GoodsClass record) {
        return goodsClassMapper.updateByPrimaryKeySelective(record);
    }
    @Cacheable(value="classCache",key="'getGoodsClass-'+#gcid")
    @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{
         List<GoodsClass> list = goodsClassMapper.getGoodsClassAll();
         if (list != null && list.size() == 0) {
             return list;
         }
    public List<GoodsClass> listquery() throws Exception {
        List<GoodsClass> list = goodsClassMapper.getGoodsClassAll();
        if (list != null && list.size() == 0) {
            return list;
        }
        for (GoodsClass gclass : list) {
            Long iosClick = gclass.getIosClick();
@@ -105,7 +102,7 @@
            } else {
                gclass.setCountClick(0l);
            }
            // 参数处理
            String searchParam = gclass.getSearchParam();
            if (searchParam == null) {
@@ -113,91 +110,87 @@
            } else {
                gclass.setSearchParam(searchParam);
            }
            // 标签
            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("");
            } else {
                String taobaoCids = "";
                for (TaoBaoClass taoBaoClass: listTB) {
                String taobaoCids = "";
                for (TaoBaoClass taoBaoClass : listTB) {
                    taobaoCids = taobaoCids + taoBaoClass.getCategoryName() + "-" + taoBaoClass.getCategoryId() + ",";
                }
                if (!StringUtil.isNullOrEmpty(taobaoCids)){
                    taobaoCids = taobaoCids.substring(0, taobaoCids.length()-1);
                }
                if (!StringUtil.isNullOrEmpty(taobaoCids)) {
                    taobaoCids = taobaoCids.substring(0, taobaoCids.length() - 1);
                }
                gclass.setTaobaoCids(taobaoCids);
            }
        }
        return list;
    }
    public List<GoodsClass> getGoodsClassAll() {
        return goodsClassMapper.getGoodsClassAll();
    }
    @Override
    @Transactional
    public void saveObject(MultipartFile file, GoodsClass record) throws GoodsClassException, Exception{
    public void saveObject(MultipartFile file, GoodsClass record) throws GoodsClassException, Exception {
        String name = record.getName();
        if (name == null || name.trim().length() == 0) {
            throw new GoodsClassException(1, "分类名称不能为空");
        }
        // 图片上传
        String picture = null;
        if (file != null) {
            picture = uploadPicture(file);
        }
        String params = record.getSearchParam();
        if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
            record.setSearchParam(null);
        } else if (!StringUtil.isJson(params)) {
            throw new GoodsClassException(1, "筛选条件非JSON格式");
        }
        Long id = record.getId();
        if (id == null) {
            record.setPicture(picture);
            record.setIosClick(0L);
            record.setAndroidClick(0L);
            record.setCreatetime(java.lang.System.currentTimeMillis());
            Integer state = record.getState();
            if (state == null) {
                record.setState(0);
            }
            if (params== null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
            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\"}");
            }
            // 排序
            int maxOrder = goodsClassMapper.getMaxOrder();
            record.setOrderby(maxOrder + 1);
            goodsClassMapper.insert(record);
        } else {
            // 修改
            GoodsClass resultObj = goodsClassMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
                throw new GoodsClassException(1, "修改内容已不存在");
            }
            if (picture != null && picture.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPicture());
@@ -206,83 +199,84 @@
            } else {
                record.setPicture(resultObj.getPicture());
            }
            record.setIosClick(resultObj.getIosClick());
            record.setOrderby(resultObj.getOrderby());
            record.setAndroidClick(resultObj.getAndroidClick());
            record.setCreatetime(resultObj.getCreatetime());
            goodsClassMapper.updateByPrimaryKey(record);
        }
        // 保存淘宝商品分类id
        String taobaoCids = record.getTaobaoCids();
        if (!StringUtil.isNullOrEmpty(taobaoCids) && !"null".equalsIgnoreCase(taobaoCids)) {
            taoBaoClassService.save(record.getId(), taobaoCids);
        }
    }
    /**
     * 上传图片
     *
     * @param file
     * @return
     * @throws Exception
     */
    public String uploadPicture(MultipartFile file) throws Exception {
        // 文件解析
        // 文件解析
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 文件路径
        String filePath="/img/GoodsClass/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        String filePath = "/img/GoodsClass/" + UUID.randomUUID().toString().replace("-", "") + "." + type;
        // 执行上传
        String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        String fileLink = COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        return fileLink;
    }
    /**
     * 删除图片-不更新数据库
     *
     * @param record
     * @throws Exception
     */
    public void removePicture(String picture) throws Exception {
        if (picture != null && picture.trim().length() > 0) {
            COSManager.getInstance().deleteFile(picture);
        }
        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 {
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 上传文件相对位置
        String fileUrl="ClassImg/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        boolean deleteFile =true;
        /*  修改图片时,先删除已存在图片  */
        String fileUrl = "ClassImg/" + UUID.randomUUID().toString().replace("-", "") + "." + type;
        boolean deleteFile = true;
        /* 修改图片时,先删除已存在图片 */
        String picture = record.getPicture();
        if (!StringUtil.isNullOrEmpty(picture))
        if (!StringUtil.isNullOrEmpty(picture))
            deleteFile = COSManager.getInstance().deleteFile(picture);
        String uploadFilePath = null;
        /*  上传新图片  */
        /* 上传新图片 */
        if (deleteFile) {
            uploadFilePath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
        }
        /*  更新数据库信息  */
        /* 更新数据库信息 */
        if (!StringUtil.isNullOrEmpty(uploadFilePath)) {
            record.setPicture(uploadFilePath);
            goodsClassMapper.updateByPrimaryKey(record);
        }
    }
    /**
@@ -290,31 +284,30 @@
     */
    @Override
    public void removePicture(GoodsClass record) throws Exception {
        String fileUrl = record.getPicture();
        boolean deleteFile = true;
        if (StringUtil.isNullOrEmpty(fileUrl)) {
            return;
        }
        deleteFile = COSManager.getInstance().deleteFile(fileUrl);
        if (deleteFile) {
            record.setPicture(null);
            // 更新数据库
            goodsClassMapper.updateByPrimaryKey(record);
        }
        }
    }
    @Override
    @Cacheable(value="classCache",key="'getEffectiveClassCache'")
    @Cacheable(value = "classCache", key = "'getEffectiveClassCache'")
    public List<GoodsClass> getEffectiveClassCache() throws Exception {
        return goodsClassMapper.getEffectiveClass();
    }
    @Override
    @Cacheable(value="classCache",key="'getClassListAllCache'+#changePicture")
    @Cacheable(value = "classCache", key = "'getClassListAllCache'+#changePicture")
    public List<Map<String, Object>> getClassListAllCache(boolean changePicture) throws Exception {
        List<GoodsClass> goodsClassList = goodsClassMapper.getEffectiveClass();
@@ -326,23 +319,23 @@
        for (GoodsClass coodsClass : goodsClassList) {
            listID.add(coodsClass.getId());
        }
        List<GoodsSubClass> listSub = goodsSubClassService.queryByListCid(listID);
        Gson gson = new GsonBuilder().create();
        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
        for (GoodsClass goodsClass : goodsClassList) {
            List<GoodsSubClass> subClassList = new ArrayList<GoodsSubClass>();
            if (listSub != null && listSub.size() > 0) {
                Iterator<GoodsSubClass> iterator = listSub.iterator();
                while (iterator.hasNext()) {
                    GoodsSubClass goodsSubClass = iterator.next();
                    GoodsClass goodsClassInner = goodsSubClass.getRootClass();
                    if (goodsClass.getId() == goodsClassInner.getId()) {
                        // 1.5.3新版图片替换
                        if (changePicture) {
                            String pictureSecond = goodsSubClass.getPictureSecond();
@@ -350,13 +343,12 @@
                                goodsSubClass.setPicture(pictureSecond);
                            }
                        }
                        // 对应下子分类
                        subClassList.add(goodsSubClass);
                        iterator.remove();
                    }
                }
            }
@@ -370,23 +362,22 @@
        return list;
    }
    @Override
    @Transactional
    public void updateOrder(Long id, Integer moveType) throws GoodsClassException {
        if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
            throw new GoodsClassException(1, "请传递正确参数");
        }
        GoodsClass resultObj = goodsClassMapper.selectByPrimaryKey(id);
        if (resultObj == null) {
            throw new GoodsClassException(1, "此内容已不存在");
        }
        Integer order = resultObj.getOrderby();
        // 获取交换对象
        GoodsClass exchangeObject = goodsClassMapper.getByAdjoinOrder( order, moveType);
        GoodsClass exchangeObject = goodsClassMapper.getByAdjoinOrder(order, moveType);
        if (exchangeObject == null) {
            if (moveType == 1) {
                throw new GoodsClassException(1, "在相同使用地方中优先级已经最低了");
@@ -394,12 +385,12 @@
                throw new GoodsClassException(1, "在相同使用地方中优先级已经最高了");
            }
        }
        resultObj.setOrderby(exchangeObject.getOrderby());
        exchangeObject.setOrderby(order);
        goodsClassMapper.updateByPrimaryKey(resultObj);
        goodsClassMapper.updateByPrimaryKey(exchangeObject);
    }
}
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;
@@ -31,7 +33,9 @@
    private GoodsSubClassService goodsSubClassService;
    @Resource
    private LabelClassService labelClassService;
    @Resource
    private TaoBaoClassService taoBaoClassService;
    @Override
    public int deleteByPrimaryKey(Long id) {
@@ -58,19 +62,18 @@
        return goodsSubClassMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    @Transactional
    public void deleteByRootId(Long id) throws Exception {
        List<GoodsSubClass> subClassList = goodsSubClassMapper.queryByRootId(id, null);
        if (subClassList != null && subClassList.size() > 0) {
            for (GoodsSubClass goodsSubClass : subClassList) {
                    deleteSub(goodsSubClass.getId());
                deleteSub(goodsSubClass.getId());
            }
        }
    }
    @Override
    @Transactional
    public void deleteByPrimaryKeyBatch(List<String> recordIds) throws Exception {
@@ -80,8 +83,7 @@
            }
        }
    }
    @Override
    @Transactional
    public void deleteSub(Long recordId) throws Exception {
@@ -101,7 +103,7 @@
        if (!StringUtil.isNullOrEmpty(pictureSecond)) {
            COSManager.getInstance().deleteFile(pictureSecond);
        }
        /* 删除所有关联子类 */
        List<GoodsSubClass> subList = goodsSubClassMapper.queryByPid(recordId, null);
        if (subList != null && subList.size() > 0) {
@@ -111,61 +113,58 @@
                deleteSub(id);
            }
        }
        /* 删除关联标签 */
        labelClassService.deleteBySubClassId(recordId);
        /* 删除数据 */
        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) {
            throw new GoodsSubClassException(1, "分类名称不能为空");
        }
        // 图片上传
        String picture = null;
        if (file != null) {
            picture = uploadPicture(file);
        }
        // 图片上传
        String pictureSecond = null;
        if (file2 != null) {
            pictureSecond = uploadPicture(file2);
        }
        String params = record.getSearchParam();
        if (params== null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
        if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
            record.setSearchJson(null);
        } else if (!StringUtil.isJson(params)) {
            throw new GoodsSubClassException(1, "筛选条件非JSON格式");
        } else {
            record.setSearchJson(params);
        }
        Long id = record.getId();
        if (id == null) {
            if (type == null) {
                throw new GoodsSubClassException(1, "等级不能为空");
            }
            if (type > 5) {
                throw new GoodsSubClassException(1, "等级不能超过五级");
            }
            if (pid == null) {
                throw new GoodsSubClassException(1, "上级id为空");
            }
            if (type == 2) {
                record.setRootClass(new GoodsClass(pid));
                int weight = goodsSubClassMapper.getMaxWeightByRootId(pid);
@@ -175,12 +174,12 @@
                int weight = goodsSubClassMapper.getMaxWeightByPid(pid);
                record.setWeight(weight + 1);
            }
            String key = record.getKey();
            if (StringUtil.isNullOrEmpty(key)) {
                record.setKey(name.trim());
            }
            record.setLevel(type);
            record.setPicture(picture);
            record.setPictureSecond(pictureSecond);
@@ -189,21 +188,21 @@
            record.setIosClick(0L);
            record.setCreatetime(new Date());
            record.setUpdatetime(new Date());
            if (params== null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
            if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
                // 搜索条件:有券、在售价20-200、牛皮癣轻微
                record.setSearchJson("{\"quan\":1,\"endPrice\":220,\"includeGoodRate\":true}");
            }
            goodsSubClassMapper.insert(record);
        } else {
            // 修改
            GoodsSubClass resultObj = goodsSubClassMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
                throw new GoodsSubClassException(1, "修改内容已不存在");
            }
            if (picture != null && picture.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPicture());
@@ -212,8 +211,7 @@
            } else {
                record.setPicture(resultObj.getPicture());
            }
            if (pictureSecond != null && pictureSecond.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPictureSecond());
@@ -222,7 +220,7 @@
            } else {
                record.setPictureSecond(resultObj.getPictureSecond());
            }
            record.setLevel(resultObj.getLevel());
            record.setRootClass(resultObj.getRootClass());
            record.setWeight(resultObj.getWeight());
@@ -232,31 +230,45 @@
            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
     */
    public String uploadPicture(MultipartFile file) throws Exception {
        // 文件解析
        // 文件解析
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 文件路径
        String filePath="/img/GoodsSubClass/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        String filePath = "/img/GoodsSubClass/" + UUID.randomUUID().toString().replace("-", "") + "." + type;
        // 执行上传
        String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        String fileLink = COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        return fileLink;
    }
    /**
     * 删除图片
     *
     * @param record
     * @throws Exception
     */
@@ -265,9 +277,6 @@
            COSManager.getInstance().deleteFile(picture);
        }
    }
    /**
     * 删除图片
@@ -305,60 +314,57 @@
        return goodsSubClassMapper.queryByPid(pid, state);
    }
    @Override
    public List<GoodsSubClass> queryByRootIdAndWeight(Long rootId,int type, int weight) throws Exception {
    public List<GoodsSubClass> queryByRootIdAndWeight(Long rootId, int type, int weight) throws Exception {
        return goodsSubClassMapper.queryByRootIdAndWeight(rootId, type, weight);
    }
    @Override
    public List<GoodsSubClass> queryByPidAndWeight(Long pid,int type, int weight) throws Exception {
    public List<GoodsSubClass> queryByPidAndWeight(Long pid, int type, int weight) throws Exception {
        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")
    @Cacheable(value = "classCache", key = "'getSubClassCache-'+#rootId +'-'+#state")
    public List<GoodsSubClass> getSubClassCache(Long rootId, Integer state) throws Exception {
        return getGoodsSecondClass(rootId, state);
    }
    @Override
    @Cacheable(value="classCache",key="'getSubClassByPrimaryKeyCache-'+#id")
    @Cacheable(value = "classCache", key = "'getSubClassByPrimaryKeyCache-'+#id")
    public GoodsSubClass getSubClassByPrimaryKeyCache(Long id) throws Exception {
        return selectByPrimaryKey(id);
    }
    /**
     *  统计一级之下的所有二级分类
     * @param rootId  一级id
     * 统计一级之下的所有二级分类
     *
     * @param rootId
     *            一级id
     * @returnL
     */
    @Override
    public int countByRootId(Long rootId) {
        return goodsSubClassMapper.countByRootId(rootId);
    }
    /**
     *  统计二级分类之下其他分类
     * @param rootId  一级id
     * 统计二级分类之下其他分类
     *
     * @param rootId
     *            一级id
     * @return
     */
    @Override
    public int countByPid(Long pid){
    public int countByPid(Long pid) {
        return goodsSubClassMapper.countByPid(pid);
    }
    @Override
    public void countClick(AcceptData acceptData, GoodsSubClass record) {
        if ("android".equalsIgnoreCase(acceptData.getPlatform())) {
@@ -378,9 +384,9 @@
        }
        goodsSubClassService.updateByPrimaryKeySelective(record);
    }
    @Override
    public List<GoodsSubClass> queryByListCid(List<Long> list){
    public List<GoodsSubClass> queryByListCid(List<Long> list) {
        return goodsSubClassMapper.queryByListCid(list);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoClassServiceImpl.java
@@ -21,74 +21,70 @@
    @Resource
    private TaoBaoClassMapper taoBaoClassMapper;
    @Resource
    private TaoBaoClassRelationMapper taoBaoClassRelationMapper;
    @Override
    public List<TaoBaoClass> listBySystemCid(long start, int count, Long systemCid) {
        return taoBaoClassMapper.listBySystemCid(start, count, systemCid);
    }
    @Override
    public String getTaoBaoCatIds(Long classId) {
        List<TaoBaoClass> listCatIds = listBySystemCid(0, 10, classId);
        if (listCatIds == null || listCatIds.size() == 0) {
            return null;
        }
        String taobaoCatIds = "";
        for (TaoBaoClass taoBaoClass: listCatIds) {
               Integer categoryId = taoBaoClass.getCategoryId();
              if (categoryId == null ) {
                  continue;
              }
              taobaoCatIds += categoryId + ",";
        for (TaoBaoClass taoBaoClass : listCatIds) {
            Integer categoryId = taoBaoClass.getCategoryId();
            if (categoryId == null) {
                continue;
            }
            taobaoCatIds += categoryId + ",";
        }
        if (!StringUtil.isNullOrEmpty(taobaoCatIds)){
            taobaoCatIds = taobaoCatIds.substring(0, taobaoCatIds.length()-1);
        }
        if (!StringUtil.isNullOrEmpty(taobaoCatIds)) {
            taobaoCatIds = taobaoCatIds.substring(0, taobaoCatIds.length() - 1);
        }
        return taobaoCatIds;
    }
    @Override
    public TaoBaoClass getByCategoryId(Integer categoryId) {
        return taoBaoClassMapper.getByCategoryId(categoryId);
    }
    @Override
    @Transactional
    public void save(Long classId, String taobaoCids) {
        if (StringUtil.isNullOrEmpty(taobaoCids) || "null".equalsIgnoreCase(taobaoCids)) {
            return;
        }
        List<Long> listId = new ArrayList<Long>();
        List<TaoBaoClass> listExist = taoBaoClassMapper.listBySystemCid(0, Integer.MAX_VALUE, classId);
        if (listExist != null && listExist.size() > 0) {
            for (TaoBaoClass taoBaoClass: listExist) {
            for (TaoBaoClass taoBaoClass : listExist) {
                listId.add(taoBaoClass.getId());
            }
        }
        String[] array = taobaoCids.split(",");
        for (String info: array) {
            if(StringUtil.isNullOrEmpty(info)) {
        for (String info : array) {
            if (StringUtil.isNullOrEmpty(info)) {
                continue;
            }
            try {
                String[] taobaoArray = info.split("-");
                Integer categoryId = Integer.parseInt(taobaoArray[1]);
                if (listExist != null && listExist.size() > 0) {
                    for (int i =0; i< listExist.size(); i++) {
                    for (int i = 0; i < listExist.size(); i++) {
                        TaoBaoClass taoBaoClass = listExist.get(i);
                        Integer categoryId2 = taoBaoClass.getCategoryId();
                        if (categoryId == categoryId2 || categoryId.equals(categoryId2)) {
@@ -100,7 +96,7 @@
                        }
                    }
                }
                TaoBaoClass tbClass = taoBaoClassMapper.getByCategoryId(Integer.parseInt(taobaoArray[1]));
                if (tbClass == null) {
                    tbClass = new TaoBaoClass();
@@ -110,7 +106,7 @@
                    tbClass.setUpdatetime(new Date());
                    taoBaoClassMapper.insert(tbClass);
                }
                TaoBaoClassRelation relation = taoBaoClassRelationMapper.getByLocalCid(tbClass.getId());
                if (relation != null) {
                    if (classId.equals(relation.getCid()) || classId == relation.getCid()) {
@@ -130,18 +126,47 @@
                    relation.setWeight(0.0);
                    taoBaoClassRelationMapper.insertSelective(relation);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (listId.size() > 0) {
            for (Long id: listId) {
            for (Long id : listId) {
                taoBaoClassMapper.deleteByPrimaryKey(id);
                taoBaoClassRelationMapper.deleteRelationByLocalCid(id);
            }
        }
    }
    @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
@@ -10,6 +10,9 @@
    
    
    public List<TaoBaoClass> listBySystemCid(long start, int count, Long systemCid);
    public List<TaoBaoClass> listBySystemSubCid(long start, int count, Long systemSubCid);
    /**
     * 根据系统主类查询淘宝类目id
@@ -26,5 +29,12 @@
     * @param taobaoCids
     */
    public void save(Long classId, String taobaoCids);
    /**
     * 保存二级分类
     * @param classId
     * @param taobaoCids
     */
    public void saveSub(Long subId, List<Long> taobaoCids);
}