Commit b7be65e5 authored by libin's avatar libin

钱包

parent e6568038
...@@ -271,6 +271,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -271,6 +271,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
SellingWalletPagVo sellingWalletPagVo = new SellingWalletPagVo(); SellingWalletPagVo sellingWalletPagVo = new SellingWalletPagVo();
Example example = new Example(AppUserSellingWater.class); Example example = new Example(AppUserSellingWater.class);
example.setOrderByClause("crt_time DESC");
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
if (waiting != null) { if (waiting != null) {
criteria.andEqualTo("waiting", waiting); criteria.andEqualTo("waiting", waiting);
......
...@@ -80,7 +80,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> { ...@@ -80,7 +80,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
walletpg.setWithdrawaling(withDrawaling); walletpg.setWithdrawaling(withDrawaling);
walletpg.setWithdrawals(walletpg.getWithdrawals()==null?new BigDecimal(0):walletpg.getWithdrawals()); walletpg.setWithdrawals(walletpg.getWithdrawals()==null?new BigDecimal(0):walletpg.getWithdrawals());
walletpg.setUnbooked(walletpg.getUnbooked()==null?new BigDecimal(0):walletpg.getUnbooked()); walletpg.setUnbooked(walletpg.getUnbooked()==null?new BigDecimal(0):walletpg.getUnbooked());
walletpg.setTotalAmount(walletpg.getTodayAmount()==null?walletpg.getUnbooked():walletpg.getTotalAmount().add(walletpg.getUnbooked())); walletpg.setTotalAmount(walletpg.getTodayAmount()==null?new BigDecimal(0):walletpg.getTotalAmount());
walletpg.setTotalConsumption(totalConsumpution); walletpg.setTotalConsumption(totalConsumpution);
walletPageVos.add(walletpg); walletPageVos.add(walletpg);
} }
......
...@@ -41,6 +41,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> { ...@@ -41,6 +41,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("stauts", state); criteria.andEqualTo("stauts", state);
criteria.andEqualTo("userId", userId); criteria.andEqualTo("userId", userId);
example.setOrderByClause("crt_time DESC");
PageDataVO<MyWalletCath> walletCathPage = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example)); PageDataVO<MyWalletCath> walletCathPage = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example));
List<MyWalletCath> walletCaths = walletCathPage.getData(); List<MyWalletCath> walletCaths = walletCathPage.getData();
......
...@@ -19,6 +19,7 @@ import tk.mybatis.mapper.entity.Example; ...@@ -19,6 +19,7 @@ import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -42,6 +43,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet ...@@ -42,6 +43,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
Example example = new Example(MyWalletDetail.class); Example example = new Example(MyWalletDetail.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId",userId); criteria.andEqualTo("userId",userId);
example.setOrderByClause("crt_time DESC");
PageDataVO<MyWalletDetail> walletDetailPageVoPageDataVO = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example)); PageDataVO<MyWalletDetail> walletDetailPageVoPageDataVO = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example));
List<MyWalletDetail> walletDetails = walletDetailPageVoPageDataVO.getData(); List<MyWalletDetail> walletDetails = walletDetailPageVoPageDataVO.getData();
...@@ -84,6 +86,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet ...@@ -84,6 +86,7 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
walletDetailAdminVos.add(walletDetailAdminVo); walletDetailAdminVos.add(walletDetailAdminVo);
walletDetailAdminVo.setSourceName(StringUtils.isEmpty(detailListDTO.getTitle())?detailListDTO.getActivityName():detailListDTO.getTitle()); walletDetailAdminVo.setSourceName(StringUtils.isEmpty(detailListDTO.getTitle())?detailListDTO.getActivityName():detailListDTO.getTitle());
} }
walletDetailAdminVos.sort(Comparator.comparing(WalletDetailAdminVo::getCrtTime).reversed());
pageDataVO.setPageNum(walletDetailFindDTO.getPage()); pageDataVO.setPageNum(walletDetailFindDTO.getPage());
pageDataVO.setPageSize(walletDetailFindDTO.getLimit()); pageDataVO.setPageSize(walletDetailFindDTO.getLimit());
pageDataVO.setTotalCount(walletDetailPage.getTotalCount()); pageDataVO.setTotalCount(walletDetailPage.getTotalCount());
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
<select id="selectByLeaderId" resultType="com.github.wxiaoqi.security.admin.entity.AppUserRelation"> <select id="selectByLeaderId" resultType="com.github.wxiaoqi.security.admin.entity.AppUserRelation">
select `parent_id` as `parentId`,`user_id`as `userId`,`bind_time` as `bindTime` from `app_user_relation` where `parent_id`=#{leaderId} and `is_del`=0 select `parent_id` as `parentId`,`user_id`as `userId`,`bind_time` as `bindTime` from `app_user_relation` where `parent_id`=#{leaderId} and `is_del`=0 order by `bind_time` DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if
test="userName != null and userName != ''"> test="userName != null and userName != ''">
WHERE nickname =#{userName} OR realname =#{userName} WHERE nickname =#{userName} OR realname =#{userName}
</if> ) AS `aud` ON aud.userid = aul.id </if> ) AS `aud` ON aud.userid = aul.id order by wc.crt_time DESC
</select> </select>
<select id="findUserWithDrawingByUserIds" resultType="com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO"> <select id="findUserWithDrawingByUserIds" resultType="com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO">
......
...@@ -30,6 +30,7 @@ FROM ...@@ -30,6 +30,7 @@ FROM
WHERE `nickname`=#{userName} OR `realname`=#{userName} WHERE `nickname`=#{userName} OR `realname`=#{userName}
</if>) AS `aud` ON aud.userid = aul.id </if>) AS `aud` ON aud.userid = aul.id
LEFT JOIN (SELECT DISTINCT order_id,id,price,extract,waiting,title FROM `app_user_selling_water`) AS `ausw` ON ausw.order_id = wd.cono LEFT JOIN (SELECT DISTINCT order_id,id,price,extract,waiting,title FROM `app_user_selling_water`) AS `ausw` ON ausw.order_id = wd.cono
ORDER BY wd.crt_time DESC
</select> </select>
<select id="findpersonalConsumptionsByUserIds" resultType="com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO"> <select id="findpersonalConsumptionsByUserIds" resultType="com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO">
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
w.user_id AS `userId`, w.user_id AS `userId`,
w.balance, w.balance,
w.withdrawals, w.withdrawals,
w.total_amount AS `totalAmount`, (w.total_amount+w.unbooked) AS `totalAmount`,
w.today_amount AS `todayAmount`, w.today_amount AS `todayAmount`,
w.unbooked, w.unbooked,
w.is_frozen AS `isFrozen`, w.is_frozen AS `isFrozen`,
...@@ -65,6 +65,6 @@ FROM ...@@ -65,6 +65,6 @@ FROM
</if> ) AS `aul` ON aul.id = w.user_id </if> ) AS `aul` ON aul.id = w.user_id
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if test="username != null and username != ''"> INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if test="username != null and username != ''">
WHERE nickname =#{username} OR realname =#{username} WHERE nickname =#{username} OR realname =#{username}
</if> ) AS `aud` ON aud.userid = aul.id </if> ) AS `aud` ON aud.userid = aul.id ORDER BY `totalAmount` DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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