Commit 3a04e478 authored by 童得柱's avatar 童得柱

goodscoin查资产

parent 120b3f6d
......@@ -128,14 +128,14 @@ public interface UserAssetMapper extends BaseMapper<UserAsset> {
@Update("update user_asset set amount = amount - #{unpaidAmount} where uid = #{uid} and coin = #{coinName} and amount >= #{unpaidAmount}")
int delAsset(@Param("uid") String uid, @Param("unpaidAmount") BigDecimal unpaidAmount, @Param("coinName") String coinName);
@Select("select * from user_asset where uid = #{uid} and amount >0 and coin != 'BASE' limit #{start},#{size}")
@Select("select * from user_asset where uid = #{uid} and amount >0 and goods_coin != 'BASE' limit #{start},#{size}")
List<UserAsset> getList(@Param("uid") String uid, @Param("start") int start, @Param("size") Integer size);
@Select("select count(*) from user_asset where uid = #{uid} and amount >0 and coin != 'BASE' ")
Integer getCount(@Param("uid") String uid);
@Select("select IFNULL(sum(a.amount * b.original_price),0) from user_asset a left join goods_sku b on a.coin = b.coin_name where a.uid = #{uid} and a.amount > 0 and a.coin != 'BASE'")
BigDecimal getAllNotMallCoin(String uid);
@Select("select IFNULL(sum(a.amount * b.original_price),0) from user_asset a left join goods_sku b on a.goods_coin = b.coin_name where a.uid = #{uid} and a.amount > 0 and a.goods_coin != #{mallCoin}")
BigDecimal getAllNotMallCoin(@Param("uid") String uid,@Param("mallCoin") String mallCoin);
@Update("update user_asset set amount = amount + #{amount} where id = #{id}")
void addCoin(@Param("id") Long id, @Param("amount") BigDecimal amount);
......
......@@ -138,7 +138,7 @@ public interface IUserAssetService extends IService<UserAsset> {
Integer getCount(String uid);
BigDecimal getAllNotMallCoin(String uid);
BigDecimal getAllNotMallCoin(String uid,String mallCoin);
void addCoin(Long id, BigDecimal amount);
......
......@@ -515,8 +515,8 @@ public class UserAssetServiceImpl extends ServiceImpl<UserAssetMapper, UserAsset
}
@Override
public BigDecimal getAllNotMallCoin(String uid) {
return coinDao.getAllNotMallCoin(uid);
public BigDecimal getAllNotMallCoin(String uid,String mallCoin) {
return coinDao.getAllNotMallCoin(uid,mallCoin);
}
@Override
......
......@@ -329,7 +329,7 @@ public class UserController {
assetVo.setList(assets);
Integer count = userAssetService.getCount(uid);
assetVo.setCount(count);
BigDecimal all = userAssetService.getAllNotMallCoin(uid);
BigDecimal all = userAssetService.getAllNotMallCoin(uid,CoinNameEnum.MALLCOIN.value());
if (all == null) {
all = BigDecimal.ZERO;
}
......@@ -487,7 +487,7 @@ public class UserController {
BigDecimal mallCoin = u.getAmount();
//优惠券数量
int couponCount = couponService.getCount(uid, header.getType(), "1");
BigDecimal all = userAssetService.getAllNotMallCoin(uid);
BigDecimal all = userAssetService.getAllNotMallCoin(uid,CoinNameEnum.MALLCOIN.value());
if (all == null) {
all = BigDecimal.ZERO;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment