| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectCount") |
| | | public R selectCount(String uid) { |
| | | public R selectCount(String uid,String type) { |
| | | List<Map<Object, Object>> list = integralService.selectCount(uid); |
| | | List<Map<Object, Object>> listAll = integralService.selectList(uid,type); |
| | | Map map = new HashMap(); |
| | | Integer a = Integer.parseInt(list.get(0).get("integral").toString()); |
| | | Integer b = Integer.parseInt(list.get(1).get("integral").toString()); |
| | |
| | | map.put("yjf", list.get(1)); |
| | | //剩余积分 |
| | | map.put("sjf", a - b); |
| | | map.put("list",listAll); |
| | | return R.data(map); |
| | | } |
| | | |
| | |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id") |
| | | private Integer uid; |
| | | private Long uid; |
| | | /** |
| | | * 获取途径 |
| | | */ |
| | |
| | | */ |
| | | List<IntegralVO> selectIntegralPage(IPage page, IntegralVO integral); |
| | | List<Map<Object, Object>> selectCount(String uid); |
| | | List<Map<Object, Object>> selectList(String uid,String type); |
| | | } |
| | |
| | | <select id="selectIntegralPage" resultMap="integralResultMap"> |
| | | select * |
| | | from sys_integral |
| | | where is_deleted = 0 |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="java.util.HashMap"> |
| | |
| | | FROM sys_integral |
| | | WHERE type = 2 AND uid=#{uid} |
| | | </select> |
| | | <select id="selectList" resultType="org.springblade.modules.integral.entity.Integral"> |
| | | SELECT * |
| | | FROM sys_integral |
| | | WHERE uid=#{uid} |
| | | <if test="type == 2 "> |
| | | and type =1 |
| | | </if> |
| | | <if test="type == 3 "> |
| | | |
| | | and type =2 |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | IPage<IntegralVO> selectIntegralPage(IPage<IntegralVO> page, IntegralVO integral); |
| | | List<Map<Object, Object>> selectCount(String uid); |
| | | List<Map<Object, Object>> selectList(String uid,String type); |
| | | } |
| | |
| | | return baseMapper.selectCount(uid); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<Object, Object>> selectList(String uid,String type) { |
| | | return baseMapper.selectList(uid,type); |
| | | } |
| | | |
| | | } |