Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -37,6 +37,9 @@ public interface TbActivateInRecordMapper {
|
||||
int queryByVipIdAndShopIdAndProId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId,@Param("productId") Integer productId);
|
||||
List<TbActivateInRecord> queryAllByVipIdAndShopIdAndProId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId,@Param("productId") Integer productId);
|
||||
|
||||
int countCouponNum(@Param("userId") Integer userId);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -32,6 +33,8 @@ public interface TbShopUserMapper {
|
||||
TbShopUser selectByPhoneAndShopId(@Param("phone") String phone,@Param("shopId") String shopId);
|
||||
TbShopUser selectPCByPhoneAndShopId(@Param("phone") String phone,@Param("shopId") String shopId);
|
||||
List<TbShopUser> selectAllByUserId(@Param("userId") String userId);
|
||||
List<TbShopUser> selectVipByUserId(@Param("userId") Integer userId);
|
||||
BigDecimal countAmount(@Param("userId") Integer userId);
|
||||
|
||||
|
||||
List<ShopUserListVo> selectByUserId(@Param("userId") String userId, @Param("shopId") String shopId);
|
||||
|
||||
@@ -101,7 +101,11 @@ public class TbUserInfo implements Serializable {
|
||||
|
||||
private String pwd;
|
||||
|
||||
private String custPhone="400-6666-389";
|
||||
private String custPhone = "400-6666-389";
|
||||
//优惠卷数量
|
||||
private Integer couponAll = 0;
|
||||
//储值数量
|
||||
private BigDecimal balanceAll = BigDecimal.ZERO;
|
||||
|
||||
|
||||
public String getAvatar() {
|
||||
@@ -505,4 +509,20 @@ public class TbUserInfo implements Serializable {
|
||||
public void setPwd(String pwd) {
|
||||
this.pwd = pwd;
|
||||
}
|
||||
|
||||
public Integer getCouponAll() {
|
||||
return couponAll;
|
||||
}
|
||||
|
||||
public void setCouponAll(Integer couponAll) {
|
||||
this.couponAll = couponAll;
|
||||
}
|
||||
|
||||
public BigDecimal getBalanceAll() {
|
||||
return balanceAll;
|
||||
}
|
||||
|
||||
public void setBalanceAll(BigDecimal balanceAll) {
|
||||
this.balanceAll = balanceAll;
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,9 @@ public class LoginService {
|
||||
@Autowired
|
||||
private TbShopUserMapper tbShopUserMapper;
|
||||
|
||||
@Autowired
|
||||
private TbActivateInRecordMapper inRecordMapper;
|
||||
|
||||
@Autowired
|
||||
private TbShopTableMapper tbShopTableMapper;
|
||||
|
||||
@@ -498,6 +501,9 @@ public class LoginService {
|
||||
if (tbUserInfo == null) {
|
||||
return Result.success(CodeEnum.ENCRYPT, new ArrayList());
|
||||
}
|
||||
tbUserInfo.setBalanceAll(tbShopUserMapper.countAmount(userId));
|
||||
tbUserInfo.setCouponAll(inRecordMapper.countCouponNum(userId));
|
||||
|
||||
return Result.success(CodeEnum.ENCRYPT, tbUserInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,15 @@
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询剩余商品优惠卷数量-->
|
||||
<select id="countCouponNum" resultType="INTEGER">
|
||||
SELECT
|
||||
sum(over_num)
|
||||
FROM
|
||||
tb_activate_in_record record
|
||||
INNER JOIN tb_shop_user vip ON record.vip_user_id = vip.id AND vip.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="queryByVipIdAndShopId" resultType="com.chaozhanggui.system.cashierservice.entity.TbProduct">
|
||||
SELECT
|
||||
tb_product.*, sum(tb_activate_in_record.over_num) as limitNumber
|
||||
|
||||
@@ -429,6 +429,10 @@
|
||||
select * from tb_shop_user where user_id=#{userId} and is_vip = 1
|
||||
</select>
|
||||
|
||||
<select id="countAmount" resultType="BigDecimal">
|
||||
select sum(amount) from tb_shop_user where user_id=#{userId} and is_vip = 1
|
||||
</select>
|
||||
|
||||
<select id="selectByOpenId" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
||||
select * from tb_shop_user where mini_open_id = #{openId}
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user