Commit b729b12c by 魏文甫

update

1 parent 0cdd7851
......@@ -8,4 +8,6 @@ import java.util.Map;
*/
public interface IntegralMapper {
List<Map<String, Object>> signInList(Map<String, Object> param);
Map<String, Object> queryTodaySign(Map<String, Object> param2);
}
......@@ -54,7 +54,7 @@ public class UserServiceImpl implements UserService {
tKzyUserIntegralFlowing.setCreateDt(new Date());
tKzyUserIntegralFlowing.setSourceType(1);
tKzyUserIntegralFlowing.setType(1);
tKzyUserIntegralFlowing.setUserId(loginUser.getId());
if (loginUser.getIntegral() == null) {
loginUser.setIntegral(0);
}
......@@ -96,10 +96,21 @@ public class UserServiceImpl implements UserService {
@Override
public Map<String, Object> signInList(TKzyUser loginUser) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd");
Map<String, Object> param = new HashMap<String, Object>();
param.put("userId", loginUser.getId());
param.put("month", simpleDateFormat.format(new Date()));
List<Map<String, Object>> list = integralMapper.signInList(param);
Map<String, Object> param2 = new HashMap<String, Object>();
param2.put("userId", loginUser.getId());
param2.put("today", simpleDateFormat2.format(new Date()));
Map<String, Object> todaySign = integralMapper.queryTodaySign(param2);
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("list", list);
dataMap.put("todaySign", todaySign);
return ResultMapUtil.returnMap("1", "", list);
}
......
......@@ -14,4 +14,17 @@
AND t.user_id = #{userId,jdbcType=BIGINT}
AND DATE_FORMAT(t.create_dt, '%Y-%m') = #{month,jdbcType=VARCHAR}
</select>
<select id="queryTodaySign" parameterType="java.util.HashMap" resultType="java.util.HashMap">
SELECT
t.id,
t.create_dt AS createDt,
t.integral
FROM
t_kzy_user_integral_flowing t
WHERE
t.source_type = 1
AND t.user_id = #{userId,jdbcType=BIGINT}
AND DATE_FORMAT(t.create_dt, '%Y-%m-%') = #{todya,jdbcType=VARCHAR}
limit t.id DESC limit 0,1
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!