Authored by Lixiaodi

入驻账户信息软删除

package com.yohoufo.dal.order;
import com.yohoufo.dal.order.model.SellerJoinHistory;
public interface SellerJoinHistoryMapper {
int deleteByPrimaryKey(Integer id);
int insert(SellerJoinHistory record);
int insertSelective(SellerJoinHistory record);
SellerJoinHistory selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SellerJoinHistory record);
int updateByPrimaryKey(SellerJoinHistory record);
}
\ No newline at end of file
... ...
package com.yohoufo.dal.order.model;
public class SellerJoinHistory {
private Integer id;
private Integer uid;
private String certNo;
private Integer createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUid() {
return uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public String getCertNo() {
return certNo;
}
public void setCertNo(String certNo) {
this.certNo = certNo == null ? null : certNo.trim();
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
}
\ No newline at end of file
... ...
... ... @@ -182,7 +182,7 @@
<sql id="Query_Condition_Sql" >
uid = #{uid,jdbcType=INTEGER}
uid = #{uid,jdbcType=INTEGER} and del=0
</sql>
<select id="selectCountByUid" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
... ... @@ -205,10 +205,10 @@
select
uid, sum(amount) as amount
from entry_seller_recharge_order
where status = 1 and uid = #{uid,jdbcType=INTEGER} and type in(1,2)
where status = 1 and uid = #{uid,jdbcType=INTEGER} and type in(1,2) and del=0
</select>
<delete id="clearUserHistoryData">
delete from entry_seller_recharge_order
<update id="clearUserHistoryData">
update entry_seller_recharge_order set del = 1
where uid = #{uid} and order_code &lt; #{orderCode}
</delete>
</update>
</mapper>
\ No newline at end of file
... ...
<?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.yohoufo.dal.order.SellerJoinHistoryMapper" >
<resultMap id="BaseResultMap" type="com.yohoufo.dal.order.model.SellerJoinHistory" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="cert_no" property="certNo" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, cert_no, create_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from seller_join_history
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from seller_join_history
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yohoufo.dal.order.model.SellerJoinHistory" >
insert into seller_join_history (id, uid, cert_no,
create_time)
values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{certNo,jdbcType=VARCHAR},
#{createTime,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yohoufo.dal.order.model.SellerJoinHistory" >
insert into seller_join_history
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="uid != null" >
uid,
</if>
<if test="certNo != null" >
cert_no,
</if>
<if test="createTime != null" >
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="uid != null" >
#{uid,jdbcType=INTEGER},
</if>
<if test="certNo != null" >
#{certNo,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yohoufo.dal.order.model.SellerJoinHistory" >
update seller_join_history
<set >
<if test="uid != null" >
uid = #{uid,jdbcType=INTEGER},
</if>
<if test="certNo != null" >
cert_no = #{certNo,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yohoufo.dal.order.model.SellerJoinHistory" >
update seller_join_history
set uid = #{uid,jdbcType=INTEGER},
cert_no = #{certNo,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -185,23 +185,23 @@
select
count(*)
from seller_wallet_detail
where uid = #{uid,jdbcType=INTEGER} and is_batch = 0 and type in (1,31,32,33,34,35,61)
where uid = #{uid,jdbcType=INTEGER} and is_batch = 0 and type in (1,31,32,33,34,35,61) and del=0
</select>
<select id="selectUserDetail" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from seller_wallet_detail
where uid = #{uid,jdbcType=INTEGER} and is_batch = 0 and type in (1,31,32,33,34,35,61) order by id desc limit #{start},#{count}
where uid = #{uid,jdbcType=INTEGER} and is_batch = 0 and type in (1,31,32,33,34,35,61) and del=0 order by id desc limit #{start},#{count}
</select>
<select id="selectUserPunishAmount" resultMap="BaseResultMap" >
select
uid, sum(amount) as amount
from seller_wallet_detail
where uid = #{uid,jdbcType=INTEGER} and is_batch = 0 and type in (31,32,33,34,35)
where uid = #{uid,jdbcType=INTEGER} and is_batch = 0 and type in (31,32,33,34,35) and del=0
</select>
<delete id="clearUserHistoryData">
delete from seller_wallet_detail
update seller_wallet_detail set del = 1
where uid = #{uid,jdbcType=INTEGER}
</delete>
... ...
... ... @@ -169,7 +169,7 @@
lock_amount = #{lockAmount,jdbcType=DECIMAL},
</if>
<if test="joinTimes != null" >
join_times = #{joinTimes,jdbcType=DECIMAL},
join_times = #{joinTimes,jdbcType=INTEGER},
</if>
update_time = #{updateTime,jdbcType=INTEGER}, status=1
where uid = #{uid,jdbcType=INTEGER} and type=1 and status=0
... ... @@ -186,4 +186,5 @@
<update id="updateMoneyForTest">
update seller_wallet set amount = amount + 10 where id = 3
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -42,11 +42,4 @@ public class MerchantController {
return service.getMerchantLowMoneyWarnTip(uid);
}
@RequestMapping(params = "method=ufo.merchant.canRejoin")
@ResponseBody
public ApiResponse canRejoin(@RequestParam("uid") int uid) {
LOG.info("canReJoin uid={}", uid);
return new ApiResponse(200, "查询成功", service.canRejoin(uid));
}
}
... ...
... ... @@ -381,6 +381,8 @@ public class PaymentServiceImpl implements IPaymentService {
OrdersPayTransfer newTransfer = new OrdersPayTransfer();
newTransfer.setId(transfer.getId());
newTransfer.setStatus(1);
newTransfer.setAlipayTradeId(transferData.getAlipayTradeId());
newTransfer.setAlipayTradeResult(JSON.toJSONString(transferData));
newTransfer.setUpdateTime(now);
ordersPayTransferMapper.updateByPrimaryKeySelective(newTransfer);
logger.info("transferSuccess 修改转账状态成功 tradeBillsId={}, tradeBillsId={}, orderCode={}", tradeBillsId, tradeBillsId, orderCode);
... ... @@ -395,6 +397,8 @@ public class PaymentServiceImpl implements IPaymentService {
OrdersPayTransfer newTransfer = new OrdersPayTransfer();
newTransfer.setId(transfer.getId());
newTransfer.setStatus(3);
newTransfer.setAlipayTradeId(transferData.getAlipayTradeId());
newTransfer.setAlipayTradeResult(JSON.toJSONString(transferData));
newTransfer.setUpdateTime(now);
ordersPayTransferMapper.updateByPrimaryKeySelective(newTransfer);
logger.info("transferSuccess 转账表(失败)更新成功 tradeBillsId={}, tradeBillsId={}, orderCode={}", tradeBillsId, tradeBillsId, orderCode);
... ...
package com.yohoufo.order;
import com.google.common.collect.Lists;
import com.yohoufo.product.model.PriceTrendResp;
import java.util.List;
import java.util.stream.Collectors;
/**
* Created by li.ma on 2019/1/17.
*/
public class Test11 {
public static void main(String[] args) {
List<PriceTrendResp> result = Lists.newArrayList();
PriceTrendResp resp =new PriceTrendResp();
resp.setEndTime("2019-01-09 00:00:00");
resp.setProductId(1002512);
result.add(resp);
PriceTrendResp resp1 =new PriceTrendResp();
resp1.setEndTime("2019-01-09 00:00:00");
resp1.setProductId(46346346);
result.add(resp1);
List<PriceTrendResp> collect = result.stream().distinct().collect(Collectors.toList());
System.out.println(collect);
}
}
... ... @@ -86,6 +86,7 @@ datasources:
- com.yohoufo.dal.order.SellerLevelFuncMapper
- com.yohoufo.dal.order.OrderOverTimeMapper
- com.yohoufo.dal.order.BuyerOrderViewMapper
- com.yohoufo.dal.order.SellerJoinHistoryMapper
ufo_promotion:
servers:
... ...
... ... @@ -85,6 +85,7 @@ datasources:
- com.yohoufo.dal.order.SellerLevelFuncMapper
- com.yohoufo.dal.order.OrderOverTimeMapper
- com.yohoufo.dal.order.BuyerOrderViewMapper
- com.yohoufo.dal.order.SellerJoinHistoryMapper
ufo_promotion:
servers:
... ...