Merge remote-tracking branch 'origin/div' into div
New file |
| | |
| | | package com.yeshi.fanli.controller.admin.recommend;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
|
| | | import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/deleteHistory")
|
| | | public class RecommendGoodsDeleteHistoryController {
|
| | |
|
| | | @Resource
|
| | | private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService;
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | |
|
| | | try {
|
| | | List<RecommendGoodsDeleteHistory> list = recommendGoodsDeleteHistoryService.listBackStage((pageIndex - 1) * pageSize, pageSize, key);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = recommendGoodsDeleteHistoryService.countBackStage(key);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm").create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", gson.toJson(list));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import java.util.Calendar;
|
| | | import java.util.Collections;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.regex.Matcher;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | |
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | |
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendBanner;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendBanner;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | |
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | |
| | | });
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 京东分享商品信息
|
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param uid
|
| | | * @param callback
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getJDGoodsDetail")
|
| | | public void getJDGoodsDetail(final AcceptData acceptData, final Long id, String uid, String callback,
|
| | | PrintWriter out) {
|
| | | if (id == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(uid)) {
|
| | | uid = AESUtil.decrypt(uid, Constant.UIDAESKEY);
|
| | | }
|
| | |
|
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(id);
|
| | | if (jdGoods == null) {
|
| | | jdGoods = JDApiUtil.getGoodsDetail(id);
|
| | | }
|
| | |
|
| | | if (jdGoods == null) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("商品信息获取失败")));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<String> imageList = jdGoods.getImageList();
|
| | | if (imageList == null) {
|
| | | imageList = new ArrayList<>();
|
| | | imageList.add(jdGoods.getPicUrl());
|
| | | }
|
| | | |
| | | boolean hasCoupon = false;
|
| | | String couponUrl = null;
|
| | | BigDecimal discount = new BigDecimal(0);
|
| | | JDCouponInfo couponInfo = jdGoods.getCouponInfo();
|
| | | if (couponInfo != null) {
|
| | | hasCoupon = true;
|
| | | discount = couponInfo.getDiscount();
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | |
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | | String jumpLink = JDApiUtil.convertLink(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("imgs", imageList);
|
| | | data.put("title", jdGoods.getSkuName());
|
| | | data.put("zkPrice", jdGoods.getPrice());
|
| | | data.put("coupon", hasCoupon);
|
| | | data.put("couponAmount", discount);
|
| | | data.put("couponPrice", JDUtil.getQuanPrice(jdGoods));
|
| | | data.put("helpLink", configService.get("jd_share_h5_help_link"));
|
| | | data.put("jumpLink", jumpLink);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | final String tempUid = uid;
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | if (!StringUtil.isNullOrEmpty(tempUid))
|
| | | userShareGoodsGroupService.updateBrowseNum(Long.parseLong(tempUid), id, Constant.SOURCE_TYPE_JD);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (UserShareGoodsRecordException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | });
|
| | | return;
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.dao.mybatis.goods.recommend; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory; |
| | | |
| | | public interface RecommendGoodsDeleteHistoryMapper extends BaseMapper<RecommendGoodsDeleteHistory> { |
| | | |
| | | /** |
| | | * 批量查询商品是否在删除队列中 |
| | | * |
| | | * @param goodsList |
| | | * @return |
| | | */ |
| | | List<RecommendGoodsDeleteHistory> listByGoodsInfo(@Param("device") String device, |
| | | @Param("goodsList") List<RecommendGoodsDeleteHistory> goodsList); |
| | | package com.yeshi.fanli.dao.mybatis.goods.recommend;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
|
| | |
|
| | | public interface RecommendGoodsDeleteHistoryMapper extends BaseMapper<RecommendGoodsDeleteHistory> {
|
| | |
|
| | | /**
|
| | | * 批量查询商品是否在删除队列中
|
| | | * |
| | | * @param goodsList
|
| | | * @return
|
| | | */
|
| | | List<RecommendGoodsDeleteHistory> listByGoodsInfo(@Param("device") String device,
|
| | | @Param("goodsList") List<RecommendGoodsDeleteHistory> goodsList);
|
| | |
|
| | | |
| | | /**
|
| | | * 后台统计
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | List<RecommendGoodsDeleteHistory> listBackStage(@Param("start") long start, @Param("count") int count,
|
| | | @Param("key") String key);
|
| | | |
| | | long countBackStage(@Param("key") String key);
|
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.share; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup; |
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum; |
| | | |
| | | public interface UserShareGoodsGroupMapper { |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(UserShareGoodsGroup record); |
| | | |
| | | int insertSelective(UserShareGoodsGroup record); |
| | | |
| | | UserShareGoodsGroup selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(UserShareGoodsGroup record); |
| | | |
| | | int updateByPrimaryKey(UserShareGoodsGroup record); |
| | | |
| | | /** |
| | | * 批量插入 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | int insertBatch(List<UserShareGoodsGroup> list); |
| | | |
| | | |
| | | /** |
| | | * 批量选择更新 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | int updateBatchSelective(List<UserShareGoodsGroup> list); |
| | | |
| | | /** |
| | | * 查询分享商品 |
| | | * @param recordId |
| | | * @return |
| | | */ |
| | | List<UserShareGoodsGroup> listByRecordId(@Param("recordId") Long recordId); |
| | | |
| | | /** |
| | | * 查询单个商品 判断是否单个商品分享 |
| | | * @param recordId |
| | | * @return |
| | | */ |
| | | UserShareGoodsGroup getSingleGoods(@Param("source") ShareSourceTypeEnum source, @Param("cid") Long cid, @Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 查询最新更新的商品 |
| | | * @param cid |
| | | * @param auctionId |
| | | * @return |
| | | */ |
| | | UserShareGoodsGroup getNewestRecord (@Param("uid") Long uid, @Param("auctionId") Long auctionId); |
| | | package com.yeshi.fanli.dao.mybatis.share;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum;
|
| | |
|
| | | public interface UserShareGoodsGroupMapper {
|
| | |
|
| | | int deleteByPrimaryKey(Long id);
|
| | |
|
| | | int insert(UserShareGoodsGroup record);
|
| | |
|
| | | int insertSelective(UserShareGoodsGroup record);
|
| | |
|
| | | UserShareGoodsGroup selectByPrimaryKey(Long id);
|
| | |
|
| | | int updateByPrimaryKeySelective(UserShareGoodsGroup record);
|
| | |
|
| | | int updateByPrimaryKey(UserShareGoodsGroup record);
|
| | | |
| | | /**
|
| | | * 批量插入
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | int insertBatch(List<UserShareGoodsGroup> list);
|
| | | |
| | | |
| | | /**
|
| | | * 批量选择更新
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | int updateBatchSelective(List<UserShareGoodsGroup> list);
|
| | | |
| | | /**
|
| | | * 查询分享商品
|
| | | * @param recordId
|
| | | * @return
|
| | | */
|
| | | List<UserShareGoodsGroup> listByRecordId(@Param("recordId") Long recordId);
|
| | | |
| | | /**
|
| | | * 查询单个商品 判断是否单个商品分享
|
| | | * @param recordId
|
| | | * @return
|
| | | */
|
| | | UserShareGoodsGroup getSingleGoods(@Param("source") ShareSourceTypeEnum source, @Param("cid") Long cid, @Param("uid") Long uid);
|
| | | |
| | | /**
|
| | | * 查询最新更新的商品
|
| | | * @param cid
|
| | | * @param auctionId
|
| | | * @return
|
| | | */
|
| | | UserShareGoodsGroup getNewestRecord (@Param("uid") Long uid, @Param("goodsId") Long goodsId, @Param("goodsType") Integer goodsType);
|
| | | } |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper |
| | | namespace="com.yeshi.fanli.dao.mybatis.goods.recommend.RecommendGoodsDeleteHistoryMapper"> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory"> |
| | | <id column="ud_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="ud_device" property="device" jdbcType="VARCHAR" /> |
| | | <result column="ud_uid" property="uid" jdbcType="BIGINT" /> |
| | | <result column="ud_goods_id" property="goodsId" jdbcType="BIGINT" /> |
| | | <result column="ud_goods_source" property="goodsSource" |
| | | jdbcType="INTEGER" /> |
| | | <result column="ud_reason" property="reason" jdbcType="VARCHAR" /> |
| | | <result column="ud_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="ud_beizhu" property="beiZhu" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ud_id,ud_device,ud_uid,ud_goods_id,ud_goods_source,ud_reason,ud_create_time,ud_beizhu |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_recommend_goods_user_delete where ud_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="listByGoodsInfo" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_recommend_goods_user_delete where ud_device = |
| | | #{device} |
| | | <foreach collection="goodsList" item="item" open=" and (" |
| | | close=")" separator=" or "> |
| | | ( |
| | | ud_goods_id= #{item.goodsId} and ud_goods_source=#{item.goodsSource} |
| | | ) |
| | | </foreach> |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_recommend_goods_user_delete where ud_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" |
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_recommend_goods_user_delete |
| | | (ud_id,ud_device,ud_uid,ud_goods_id,ud_goods_source,ud_reason,ud_create_time,ud_beizhu) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{goodsId,jdbcType=BIGINT},#{goodsSource,jdbcType=INTEGER},#{reason,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{beiZhu,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" |
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_recommend_goods_user_delete |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ud_id,</if> |
| | | <if test="device != null">ud_device,</if> |
| | | <if test="uid != null">ud_uid,</if> |
| | | <if test="goodsId != null">ud_goods_id,</if> |
| | | <if test="goodsSource != null">ud_goods_source,</if> |
| | | <if test="reason != null">ud_reason,</if> |
| | | <if test="createTime != null">ud_create_time,</if> |
| | | <if test="beiZhu != null">ud_beizhu,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="device != null">#{device,jdbcType=VARCHAR},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="goodsId != null">#{goodsId,jdbcType=BIGINT},</if> |
| | | <if test="goodsSource != null">#{goodsSource,jdbcType=INTEGER},</if> |
| | | <if test="reason != null">#{reason,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">update yeshi_ec_recommend_goods_user_delete set |
| | | ud_device = #{device,jdbcType=VARCHAR},ud_uid = |
| | | #{uid,jdbcType=BIGINT},ud_goods_id = |
| | | #{goodsId,jdbcType=BIGINT},ud_goods_source = |
| | | #{goodsSource,jdbcType=INTEGER},ud_reason = |
| | | #{reason,jdbcType=VARCHAR},ud_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},ud_beizhu = |
| | | #{beiZhu,jdbcType=VARCHAR} where ud_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" |
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory"> |
| | | update yeshi_ec_recommend_goods_user_delete |
| | | <set> |
| | | <if test="device != null">ud_device=#{device,jdbcType=VARCHAR},</if> |
| | | <if test="uid != null">ud_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="goodsId != null">ud_goods_id=#{goodsId,jdbcType=BIGINT},</if> |
| | | <if test="goodsSource != null">ud_goods_source=#{goodsSource,jdbcType=INTEGER},</if> |
| | | <if test="reason != null">ud_reason=#{reason,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">ud_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="beiZhu != null">ud_beizhu=#{beiZhu,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where ud_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | |
|
| | | <mapper
|
| | | namespace="com.yeshi.fanli.dao.mybatis.goods.recommend.RecommendGoodsDeleteHistoryMapper">
|
| | | <resultMap id="BaseResultMap"
|
| | | type="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">
|
| | | <id column="ud_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="ud_device" property="device" jdbcType="VARCHAR" />
|
| | | <result column="ud_uid" property="uid" jdbcType="BIGINT" />
|
| | | <result column="ud_goods_id" property="goodsId" jdbcType="BIGINT" />
|
| | | <result column="ud_goods_source" property="goodsSource"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="ud_reason" property="reason" jdbcType="VARCHAR" />
|
| | | <result column="ud_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
| | | <result column="ud_beizhu" property="beiZhu" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">ud_id,ud_device,ud_uid,ud_goods_id,ud_goods_source,ud_reason,ud_create_time,ud_beizhu
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_recommend_goods_user_delete where ud_id =
|
| | | #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listByGoodsInfo" resultMap="BaseResultMap">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_recommend_goods_user_delete where ud_device =
|
| | | #{device}
|
| | | <foreach collection="goodsList" item="item" open=" and ("
|
| | | close=")" separator=" or ">
|
| | | (
|
| | | ud_goods_id= #{item.goodsId} and ud_goods_source=#{item.goodsSource}
|
| | | )
|
| | | </foreach>
|
| | | </select>
|
| | | |
| | | <select id="listBackStage" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_recommend_goods_user_delete
|
| | | WHERE 1=1 <if test="key != null ">
|
| | | AND (t.`ud_uid` = ${key} OR t.`ud_reason` LIKE '%${key}%')
|
| | | </if>
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | | <select id="countBackStage" resultMap="BaseResultMap">
|
| | | SELECT IFNULL(COUNT(t.`ud_id`),0) FROM yeshi_ec_recommend_goods_user_delete t
|
| | | WHERE 1=1 <if test="key != null ">
|
| | | AND (t.`ud_uid` = ${key} OR t.`ud_reason` LIKE '%${key}%')
|
| | | </if>
|
| | | </select>
|
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_recommend_goods_user_delete where ud_id =
|
| | | #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | | <insert id="insert"
|
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into
|
| | | yeshi_ec_recommend_goods_user_delete
|
| | | (ud_id,ud_device,ud_uid,ud_goods_id,ud_goods_source,ud_reason,ud_create_time,ud_beizhu)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{goodsId,jdbcType=BIGINT},#{goodsSource,jdbcType=INTEGER},#{reason,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{beiZhu,jdbcType=VARCHAR})
|
| | | </insert>
|
| | | <insert id="insertSelective"
|
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_recommend_goods_user_delete
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">ud_id,</if>
|
| | | <if test="device != null">ud_device,</if>
|
| | | <if test="uid != null">ud_uid,</if>
|
| | | <if test="goodsId != null">ud_goods_id,</if>
|
| | | <if test="goodsSource != null">ud_goods_source,</if>
|
| | | <if test="reason != null">ud_reason,</if>
|
| | | <if test="createTime != null">ud_create_time,</if>
|
| | | <if test="beiZhu != null">ud_beizhu,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="device != null">#{device,jdbcType=VARCHAR},</if>
|
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="goodsId != null">#{goodsId,jdbcType=BIGINT},</if>
|
| | | <if test="goodsSource != null">#{goodsSource,jdbcType=INTEGER},</if>
|
| | | <if test="reason != null">#{reason,jdbcType=VARCHAR},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey"
|
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">update yeshi_ec_recommend_goods_user_delete set
|
| | | ud_device = #{device,jdbcType=VARCHAR},ud_uid =
|
| | | #{uid,jdbcType=BIGINT},ud_goods_id =
|
| | | #{goodsId,jdbcType=BIGINT},ud_goods_source =
|
| | | #{goodsSource,jdbcType=INTEGER},ud_reason =
|
| | | #{reason,jdbcType=VARCHAR},ud_create_time =
|
| | | #{createTime,jdbcType=TIMESTAMP},ud_beizhu =
|
| | | #{beiZhu,jdbcType=VARCHAR} where ud_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective"
|
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">
|
| | | update yeshi_ec_recommend_goods_user_delete
|
| | | <set>
|
| | | <if test="device != null">ud_device=#{device,jdbcType=VARCHAR},</if>
|
| | | <if test="uid != null">ud_uid=#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="goodsId != null">ud_goods_id=#{goodsId,jdbcType=BIGINT},</if>
|
| | | <if test="goodsSource != null">ud_goods_source=#{goodsSource,jdbcType=INTEGER},</if>
|
| | | <if test="reason != null">ud_reason=#{reason,jdbcType=VARCHAR},</if>
|
| | | <if test="createTime != null">ud_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="beiZhu != null">ud_beizhu=#{beiZhu,jdbcType=VARCHAR},</if>
|
| | | </set>
|
| | | where ud_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | </mapper>
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.share.UserShareGoodsGroupMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup"> |
| | | <id column="gu_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="gu_record_id" property="recordId" jdbcType="BIGINT"/> |
| | | <result column="gu_today_browse" property="todayBrowse" jdbcType="INTEGER"/> |
| | | <result column="gu_total_browse" property="totalBrowse" jdbcType="INTEGER"/> |
| | | <result column="gu_total_order" property="totalOrder" jdbcType="INTEGER"/> |
| | | <result column="gu_total_money" property="totalMoney" jdbcType="DECIMAL"/> |
| | | <result column="gu_browse_time" property="browseTime" jdbcType="TIMESTAMP"/> |
| | | <result column="gu_createtime" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="gu_updatetime" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <!-- 记录组中的总商品数量 --> |
| | | <result column="totalGoods" property="totalGoods" jdbcType="INTEGER"/> |
| | | |
| | | <association property="commonGoods" column="gu_common_goods_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.goods.CommonGoodsMapper.BaseResultMap" /> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">gu_id,gu_record_id,gu_common_goods_id,gu_today_browse,gu_total_browse,gu_total_order,gu_total_money,gu_browse_time,gu_createtime,gu_updatetime</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_share_goods_group where gu_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_share_goods_group where gu_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_share_goods_group (gu_id,gu_record_id,gu_common_goods_id,gu_today_browse,gu_total_browse,gu_total_order,gu_total_money,gu_browse_time,gu_createtime,gu_updatetime) values (#{id,jdbcType=BIGINT},#{recordId,jdbcType=BIGINT},#{commonGoods.id,jdbcType=BIGINT},#{todayBrowse,jdbcType=INTEGER},#{totalBrowse,jdbcType=INTEGER},#{totalOrder,jdbcType=INTEGER},#{totalMoney,jdbcType=DECIMAL},#{browseTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_share_goods_group |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">gu_id,</if> |
| | | <if test="recordId != null">gu_record_id,</if> |
| | | <if test="commonGoods != null">gu_common_goods_id,</if> |
| | | <if test="todayBrowse != null">gu_today_browse,</if> |
| | | <if test="totalBrowse != null">gu_total_browse,</if> |
| | | <if test="totalOrder != null">gu_total_order,</if> |
| | | <if test="totalMoney != null">gu_total_money,</if> |
| | | <if test="browseTime != null">gu_browse_time,</if> |
| | | <if test="createTime != null">gu_createtime,</if> |
| | | <if test="updateTime != null">gu_updatetime,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="recordId != null">#{recordId,jdbcType=BIGINT},</if> |
| | | <if test="commonGoods != null">#{commonGoods.id,jdbcType=BIGINT},</if> |
| | | <if test="todayBrowse != null">#{todayBrowse,jdbcType=INTEGER},</if> |
| | | <if test="totalBrowse != null">#{totalBrowse,jdbcType=INTEGER},</if> |
| | | <if test="totalOrder != null">#{totalOrder,jdbcType=INTEGER},</if> |
| | | <if test="totalMoney != null">#{totalMoney,jdbcType=DECIMAL},</if> |
| | | <if test="browseTime != null">#{browseTime,jdbcType=TIMESTAMP},</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.share.UserShareGoodsGroup">update yeshi_ec_share_goods_group set gu_record_id = #{recordId,jdbcType=BIGINT},gu_common_goods_id = #{commonGoods.id,jdbcType=BIGINT},gu_today_browse = #{todayBrowse,jdbcType=INTEGER},gu_total_browse = #{totalBrowse,jdbcType=INTEGER},gu_total_order = #{totalOrder,jdbcType=INTEGER},gu_total_money = #{totalMoney,jdbcType=DECIMAL},gu_browse_time = #{browseTime,jdbcType=TIMESTAMP},gu_createtime = #{createTime,jdbcType=TIMESTAMP},gu_updatetime = #{updateTime,jdbcType=TIMESTAMP} where gu_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup">update yeshi_ec_share_goods_group |
| | | <set> |
| | | <if test="recordId != null">gu_record_id=#{recordId,jdbcType=BIGINT},</if> |
| | | <if test="commonGoods != null">gu_common_goods_id=#{commonGoods.id,jdbcType=BIGINT},</if> |
| | | <if test="todayBrowse != null">gu_today_browse=#{todayBrowse,jdbcType=INTEGER},</if> |
| | | <if test="totalBrowse != null">gu_total_browse=#{totalBrowse,jdbcType=INTEGER},</if> |
| | | <if test="totalOrder != null">gu_total_order=#{totalOrder,jdbcType=INTEGER},</if> |
| | | <if test="totalMoney != null">gu_total_money=#{totalMoney,jdbcType=DECIMAL},</if> |
| | | <if test="browseTime != null">gu_browse_time=#{browseTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">gu_createtime=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">gu_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where gu_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <insert id="insertBatch" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List"> |
| | | insert into yeshi_ec_share_goods_group |
| | | (<include refid="Base_Column_List" />) |
| | | values |
| | | |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.id,jdbcType=BIGINT}, |
| | | #{item.recordId,jdbcType=BIGINT}, |
| | | #{item.commonGoods.id,jdbcType=BIGINT}, |
| | | #{item.todayBrowse,jdbcType=INTEGER}, |
| | | #{item.totalBrowse,jdbcType=INTEGER}, |
| | | #{item.totalOrder,jdbcType=INTEGER}, |
| | | #{item.totalMoney,jdbcType=DECIMAL}, |
| | | #{item.browseTime,jdbcType=TIMESTAMP}, |
| | | #{item.createTime,jdbcType=TIMESTAMP}, |
| | | #{item.updateTime,jdbcType=TIMESTAMP} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | |
| | | <update id="updateBatchSelective" parameterType="java.util.List"> |
| | | update yeshi_ec_share_goods_group |
| | | <trim prefix="set" suffixOverrides=","> |
| | | <trim prefix="gu_today_browse =case" suffix="end,"> |
| | | <foreach collection="list" item="item" index="index"> |
| | | <if test="item.todayBrowse !=null"> |
| | | when gu_id=#{item.id} then #{item.todayBrowse} |
| | | </if> |
| | | </foreach> |
| | | </trim> |
| | | <trim prefix="gu_total_browse =case" suffix="end,"> |
| | | <foreach collection="list" item="item" index="index"> |
| | | <if test="item.totalBrowse !=null"> |
| | | when gu_id=#{item.id} then #{item.totalBrowse} |
| | | </if> |
| | | </foreach> |
| | | </trim> |
| | | <trim prefix="gu_total_order =case" suffix="end,"> |
| | | <foreach collection="list" item="item" index="index"> |
| | | <if test="item.totalOrder !=null"> |
| | | when gu_id=#{item.id} then #{item.totalOrder} |
| | | </if> |
| | | </foreach> |
| | | </trim> |
| | | <trim prefix="gu_total_money =case" suffix="end,"> |
| | | <foreach collection="list" item="item" index="index"> |
| | | <if test="item.totalMoney !=null"> |
| | | when gu_id=#{item.id} then #{item.totalMoney} |
| | | </if> |
| | | </foreach> |
| | | </trim> |
| | | <trim prefix="gu_browse_time =case" suffix="end,"> |
| | | <foreach collection="list" item="item" index="index"> |
| | | <if test="item.browseTime !=null"> |
| | | when gu_id=#{item.id} then #{item.browseTime} |
| | | </if> |
| | | </foreach> |
| | | </trim> |
| | | </trim> |
| | | where gu_id in |
| | | <foreach collection="list" index="index" item="item" separator="," open="(" close=")"> |
| | | #{item.id,jdbcType=BIGINT} |
| | | </foreach> |
| | | </update> |
| | | |
| | | |
| | | <select id="listByRecordId" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_share_goods_group tg |
| | | LEFT JOIN `yeshi_ec_common_goods` cg ON tg.`gu_common_goods_id` = cg.`cg_id` |
| | | WHERE tg.`gu_record_id` = #{recordId} |
| | | ORDER BY tg.`gu_createtime` |
| | | </select> |
| | | |
| | | <select id="getSingleGoods" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_share_goods_group g |
| | | LEFT JOIN `yeshi_ec_share_goods_record` r ON g.`gu_record_id` = r.`sgr_id` |
| | | WHERE r.sgr_share_state = 1 AND r.`sgr_source` = #{source} |
| | | AND g.`gu_common_goods_id` = #{cid} AND r.`sgr_uid` = #{uid} |
| | | ORDER BY g.gu_updatetime desc LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getNewestRecord" resultMap="BaseResultMap"> |
| | | SELECT tg.* FROM yeshi_ec_share_goods_group tg |
| | | RIGHT JOIN `yeshi_ec_share_goods_record` r ON tg.`gu_record_id` = r.`sgr_id` |
| | | LEFT JOIN `yeshi_ec_common_goods` cg ON tg.`gu_common_goods_id` = cg.`cg_id` |
| | | WHERE r.`sgr_uid` = #{uid} AND cg.`cg_goods_id` = #{auctionId} AND r.sgr_share_state = 1 |
| | | ORDER BY tg.gu_updatetime desc LIMIT 1 |
| | | </select> |
| | | |
| | | </mapper> |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | |
|
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.share.UserShareGoodsGroupMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup">
|
| | | <id column="gu_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="gu_record_id" property="recordId" jdbcType="BIGINT"/>
|
| | | <result column="gu_today_browse" property="todayBrowse" jdbcType="INTEGER"/>
|
| | | <result column="gu_total_browse" property="totalBrowse" jdbcType="INTEGER"/>
|
| | | <result column="gu_total_order" property="totalOrder" jdbcType="INTEGER"/>
|
| | | <result column="gu_total_money" property="totalMoney" jdbcType="DECIMAL"/>
|
| | | <result column="gu_browse_time" property="browseTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="gu_createtime" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="gu_updatetime" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | | <!-- 记录组中的总商品数量 -->
|
| | | <result column="totalGoods" property="totalGoods" jdbcType="INTEGER"/>
|
| | | |
| | | <association property="commonGoods" column="gu_common_goods_id"
|
| | | resultMap="com.yeshi.fanli.dao.mybatis.goods.CommonGoodsMapper.BaseResultMap" />
|
| | | |
| | | </resultMap>
|
| | | <sql id="Base_Column_List">gu_id,gu_record_id,gu_common_goods_id,gu_today_browse,gu_total_browse,gu_total_order,gu_total_money,gu_browse_time,gu_createtime,gu_updatetime</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
| | | <include refid="Base_Column_List"/>from yeshi_ec_share_goods_group where gu_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_share_goods_group where gu_id = #{id,jdbcType=BIGINT}</delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_share_goods_group (gu_id,gu_record_id,gu_common_goods_id,gu_today_browse,gu_total_browse,gu_total_order,gu_total_money,gu_browse_time,gu_createtime,gu_updatetime) values (#{id,jdbcType=BIGINT},#{recordId,jdbcType=BIGINT},#{commonGoods.id,jdbcType=BIGINT},#{todayBrowse,jdbcType=INTEGER},#{totalBrowse,jdbcType=INTEGER},#{totalOrder,jdbcType=INTEGER},#{totalMoney,jdbcType=DECIMAL},#{browseTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_share_goods_group
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">gu_id,</if>
|
| | | <if test="recordId != null">gu_record_id,</if>
|
| | | <if test="commonGoods != null">gu_common_goods_id,</if>
|
| | | <if test="todayBrowse != null">gu_today_browse,</if>
|
| | | <if test="totalBrowse != null">gu_total_browse,</if>
|
| | | <if test="totalOrder != null">gu_total_order,</if>
|
| | | <if test="totalMoney != null">gu_total_money,</if>
|
| | | <if test="browseTime != null">gu_browse_time,</if>
|
| | | <if test="createTime != null">gu_createtime,</if>
|
| | | <if test="updateTime != null">gu_updatetime,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="recordId != null">#{recordId,jdbcType=BIGINT},</if>
|
| | | <if test="commonGoods != null">#{commonGoods.id,jdbcType=BIGINT},</if>
|
| | | <if test="todayBrowse != null">#{todayBrowse,jdbcType=INTEGER},</if>
|
| | | <if test="totalBrowse != null">#{totalBrowse,jdbcType=INTEGER},</if>
|
| | | <if test="totalOrder != null">#{totalOrder,jdbcType=INTEGER},</if>
|
| | | <if test="totalMoney != null">#{totalMoney,jdbcType=DECIMAL},</if>
|
| | | <if test="browseTime != null">#{browseTime,jdbcType=TIMESTAMP},</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.share.UserShareGoodsGroup">update yeshi_ec_share_goods_group set gu_record_id = #{recordId,jdbcType=BIGINT},gu_common_goods_id = #{commonGoods.id,jdbcType=BIGINT},gu_today_browse = #{todayBrowse,jdbcType=INTEGER},gu_total_browse = #{totalBrowse,jdbcType=INTEGER},gu_total_order = #{totalOrder,jdbcType=INTEGER},gu_total_money = #{totalMoney,jdbcType=DECIMAL},gu_browse_time = #{browseTime,jdbcType=TIMESTAMP},gu_createtime = #{createTime,jdbcType=TIMESTAMP},gu_updatetime = #{updateTime,jdbcType=TIMESTAMP} where gu_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup">update yeshi_ec_share_goods_group
|
| | | <set>
|
| | | <if test="recordId != null">gu_record_id=#{recordId,jdbcType=BIGINT},</if>
|
| | | <if test="commonGoods != null">gu_common_goods_id=#{commonGoods.id,jdbcType=BIGINT},</if>
|
| | | <if test="todayBrowse != null">gu_today_browse=#{todayBrowse,jdbcType=INTEGER},</if>
|
| | | <if test="totalBrowse != null">gu_total_browse=#{totalBrowse,jdbcType=INTEGER},</if>
|
| | | <if test="totalOrder != null">gu_total_order=#{totalOrder,jdbcType=INTEGER},</if>
|
| | | <if test="totalMoney != null">gu_total_money=#{totalMoney,jdbcType=DECIMAL},</if>
|
| | | <if test="browseTime != null">gu_browse_time=#{browseTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="createTime != null">gu_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">gu_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where gu_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | |
| | | |
| | | <insert id="insertBatch" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List">
|
| | | insert into yeshi_ec_share_goods_group
|
| | | (<include refid="Base_Column_List" />)
|
| | | values
|
| | | |
| | | <foreach collection="list" item="item" separator=",">
|
| | | (
|
| | | #{item.id,jdbcType=BIGINT},
|
| | | #{item.recordId,jdbcType=BIGINT},
|
| | | #{item.commonGoods.id,jdbcType=BIGINT},
|
| | | #{item.todayBrowse,jdbcType=INTEGER},
|
| | | #{item.totalBrowse,jdbcType=INTEGER},
|
| | | #{item.totalOrder,jdbcType=INTEGER},
|
| | | #{item.totalMoney,jdbcType=DECIMAL},
|
| | | #{item.browseTime,jdbcType=TIMESTAMP},
|
| | | #{item.createTime,jdbcType=TIMESTAMP},
|
| | | #{item.updateTime,jdbcType=TIMESTAMP}
|
| | | )
|
| | | </foreach>
|
| | | </insert>
|
| | | |
| | | |
| | | <update id="updateBatchSelective" parameterType="java.util.List">
|
| | | update yeshi_ec_share_goods_group |
| | | <trim prefix="set" suffixOverrides=",">
|
| | | <trim prefix="gu_today_browse =case" suffix="end,">
|
| | | <foreach collection="list" item="item" index="index">
|
| | | <if test="item.todayBrowse !=null">
|
| | | when gu_id=#{item.id} then #{item.todayBrowse}
|
| | | </if>
|
| | | </foreach>
|
| | | </trim>
|
| | | <trim prefix="gu_total_browse =case" suffix="end,">
|
| | | <foreach collection="list" item="item" index="index">
|
| | | <if test="item.totalBrowse !=null">
|
| | | when gu_id=#{item.id} then #{item.totalBrowse}
|
| | | </if>
|
| | | </foreach>
|
| | | </trim>
|
| | | <trim prefix="gu_total_order =case" suffix="end,">
|
| | | <foreach collection="list" item="item" index="index">
|
| | | <if test="item.totalOrder !=null">
|
| | | when gu_id=#{item.id} then #{item.totalOrder}
|
| | | </if>
|
| | | </foreach>
|
| | | </trim>
|
| | | <trim prefix="gu_total_money =case" suffix="end,">
|
| | | <foreach collection="list" item="item" index="index">
|
| | | <if test="item.totalMoney !=null">
|
| | | when gu_id=#{item.id} then #{item.totalMoney}
|
| | | </if>
|
| | | </foreach>
|
| | | </trim>
|
| | | <trim prefix="gu_browse_time =case" suffix="end,">
|
| | | <foreach collection="list" item="item" index="index">
|
| | | <if test="item.browseTime !=null">
|
| | | when gu_id=#{item.id} then #{item.browseTime}
|
| | | </if>
|
| | | </foreach>
|
| | | </trim>
|
| | | </trim>
|
| | | where gu_id in
|
| | | <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
| | | #{item.id,jdbcType=BIGINT}
|
| | | </foreach>
|
| | | </update>
|
| | | |
| | | |
| | | <select id="listByRecordId" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_share_goods_group tg
|
| | | LEFT JOIN `yeshi_ec_common_goods` cg ON tg.`gu_common_goods_id` = cg.`cg_id`
|
| | | WHERE tg.`gu_record_id` = #{recordId}
|
| | | ORDER BY tg.`gu_createtime`
|
| | | </select>
|
| | | |
| | | <select id="getSingleGoods" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_share_goods_group g |
| | | LEFT JOIN `yeshi_ec_share_goods_record` r ON g.`gu_record_id` = r.`sgr_id`
|
| | | WHERE r.sgr_share_state = 1 AND r.`sgr_source` = #{source}
|
| | | AND g.`gu_common_goods_id` = #{cid} AND r.`sgr_uid` = #{uid}
|
| | | ORDER BY g.gu_updatetime desc LIMIT 1
|
| | | </select>
|
| | | |
| | | <select id="getNewestRecord" resultMap="BaseResultMap">
|
| | | SELECT tg.* FROM yeshi_ec_share_goods_group tg |
| | | RIGHT JOIN `yeshi_ec_share_goods_record` r ON tg.`gu_record_id` = r.`sgr_id`
|
| | | LEFT JOIN `yeshi_ec_common_goods` cg ON tg.`gu_common_goods_id` = cg.`cg_id`
|
| | | WHERE r.`sgr_uid` = #{uid} AND cg.`cg_goods_id` = #{goodsId} AND r.sgr_share_state = 1 |
| | | AND cg.`cg_goods_type` = #{goodsType}
|
| | | ORDER BY tg.gu_updatetime desc LIMIT 1
|
| | | </select>
|
| | | |
| | | </mapper>
|
| | |
| | | return resultList;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<RecommendGoodsDeleteHistory> listBackStage(long start, int count, String key) {
|
| | | return recommendGoodsDeleteHistoryMapper.listBackStage(start, count, key);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countBackStage(String key) {
|
| | | return recommendGoodsDeleteHistoryMapper.countBackStage(key);
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
|
| | | @Service
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public UserShareGoodsGroup getNewestRecord(Long uid, Long auctionId) {
|
| | | return userShareGoodsGroupMapper.getNewestRecord(uid, auctionId);
|
| | | public UserShareGoodsGroup getNewestRecord(Long uid, Long auctionId, Integer goodsType) {
|
| | | return userShareGoodsGroupMapper.getNewestRecord(uid, auctionId, goodsType);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | * @param auctionId
|
| | | */
|
| | | @Override
|
| | | public void updateOrderRecord (HongBao hongBao) throws UserShareGoodsRecordException{
|
| | | public void updateOrderRecord (HongBao hongBao, int goodsType) throws UserShareGoodsRecordException{
|
| | |
|
| | | if (hongBao == null) {
|
| | | throw new UserShareGoodsRecordException(1, "hongBao不能为空");
|
| | |
| | | throw new UserShareGoodsRecordException(1, "商品ID不能为空");
|
| | | }
|
| | |
|
| | | UserShareGoodsGroup newestRecord = getNewestRecord(uid, hongBao.getAuctionId());
|
| | | UserShareGoodsGroup newestRecord = getNewestRecord(uid, hongBao.getAuctionId(), goodsType);
|
| | |
|
| | | if (newestRecord != null) {
|
| | | // 更新订单数量
|
| | |
| | | throw new UserShareGoodsRecordException(1, "商品Id不能为空");
|
| | | }
|
| | |
|
| | | UserShareGoodsGroup group = getNewestRecord(uid, auctionId);
|
| | | UserShareGoodsGroup group = getNewestRecord(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | |
|
| | | if (group != null) {
|
| | | UserShareGoodsGroup shareGoodsGroup = new UserShareGoodsGroup(group.getId());
|
| | |
| | | userShareGoodsGroupMapper.updateByPrimaryKeySelective(shareGoodsGroup);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public void updateBrowseNum(Long uid, Long id, int goodsType) throws UserShareGoodsRecordException{
|
| | | |
| | | if (uid == null) {
|
| | | throw new UserShareGoodsRecordException(1, "用户ID不能为空");
|
| | | }
|
| | | |
| | | if (id == null) {
|
| | | throw new UserShareGoodsRecordException(1, "商品Id不能为空");
|
| | | }
|
| | | |
| | | UserShareGoodsGroup group = getNewestRecord(uid, id, goodsType);
|
| | | if (group != null) {
|
| | | UserShareGoodsGroup shareGoodsGroup = new UserShareGoodsGroup(group.getId());
|
| | | // 累计浏览
|
| | | Integer totalBrowse = group.getTotalBrowse();
|
| | | if (totalBrowse == null) {
|
| | | totalBrowse = 0;
|
| | | }
|
| | | shareGoodsGroup.setTotalBrowse(totalBrowse + 1);
|
| | | |
| | | // 今日浏览
|
| | | Date date = new Date();
|
| | | Date browseTime = group.getBrowseTime();
|
| | | if (DateUtil.isSameDay(browseTime, date)) {
|
| | | shareGoodsGroup.setTodayBrowse(group.getTodayBrowse() + 1);
|
| | | } else {
|
| | | shareGoodsGroup.setTodayBrowse(1);
|
| | | }
|
| | | shareGoodsGroup.setBrowseTime(date);
|
| | | userShareGoodsGroupMapper.updateByPrimaryKeySelective(shareGoodsGroup);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | */
|
| | | public List<TaoBaoGoodsBrief> filterGoods(String device, List<TaoBaoGoodsBrief> goodsList);
|
| | |
|
| | | /**
|
| | | * 后台统计列表
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public List<RecommendGoodsDeleteHistory> listBackStage(long start, int count, String key);
|
| | |
|
| | | public long countBackStage(String key);
|
| | |
|
| | | }
|
| | |
| | | * @param auctionId
|
| | | * @return
|
| | | */
|
| | | public UserShareGoodsGroup getNewestRecord(Long uid, Long auctionId);
|
| | | public UserShareGoodsGroup getNewestRecord(Long uid, Long auctionId, Integer goodsType);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @param count 订单数量
|
| | | * @throws UserShareGoodsRecordException
|
| | | */
|
| | | public void updateOrderRecord(HongBao hongBao) throws UserShareGoodsRecordException;
|
| | | public void updateOrderRecord(HongBao hongBao, int goodsType) throws UserShareGoodsRecordException;
|
| | |
|
| | | /**
|
| | | * 单个商品分享浏览记录
|
| | |
| | | * @throws UserShareGoodsRecordException
|
| | | */
|
| | | public void updateBrowseRecord(Long uid, Long auctionId, int count) throws UserShareGoodsRecordException;
|
| | |
|
| | | /**
|
| | | * 记录浏览次数
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param goodsType
|
| | | * @throws UserShareGoodsRecordException
|
| | | */
|
| | | public void updateBrowseNum(Long uid, Long id, int goodsType) throws UserShareGoodsRecordException;
|
| | | }
|
| | |
| | | contentList.add(new ClientTextStyleVO(Constant.getSourceName(msg.getOrderType()), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("渠道来源", COLOR_TITLE), contentList));
|
| | |
|
| | |
|
| | | String orderId = msg.getOrderId();
|
| | | MsgTypeOrderTypeEnum type = msg.getType();
|
| | | if (type == MsgTypeOrderTypeEnum.invite || type == MsgTypeOrderTypeEnum.share) {
|
| | | orderId = orderId.substring(0, orderId.length() - 6);
|
| | | orderId = orderId + "******";
|
| | | }
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO(orderId, COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单号", COLOR_TITLE), contentList, true));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | |
| | | *
|
| | | * @return
|
| | | */
|
| | | public static String convertLink(String materialId, String couponUrl, String pid) {
|
| | | public static String convertLink(String materialId, String couponUrl, String positionId, String ext1) {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("materialId", materialId);
|
| | | json.put("siteId", APP_ID);
|
| | | if (couponUrl != null)
|
| | | json.put("positionId", positionId);
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(couponUrl))
|
| | | json.put("couponUrl", couponUrl);
|
| | | // json.put("ext1", "437032_12");
|
| | | json.put("pid", pid);
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(ext1))
|
| | | json.put("ext1", ext1);
|
| | |
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("promotionCodeReq", json);
|
| | |
|
| | | String result = baseRequest("jd.union.open.promotion.common.get", null, json);
|
| | | String result = baseRequest("jd.union.open.promotion.common.get", null, root);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | result = resultJson.optJSONObject("jd_union_open_promotion_common_get_response").optString("result");
|
| | | resultJson = JSONObject.fromObject(result);
|