Commit 584c65af authored by licc's avatar licc

月度奖金接口调试

parent 080b4735
...@@ -35,5 +35,10 @@ public interface MonthAwardMapper extends BaseMapper<MonthAward> { ...@@ -35,5 +35,10 @@ public interface MonthAwardMapper extends BaseMapper<MonthAward> {
*/ */
int delById(Integer id); int delById(Integer id);
/**
* 获取本月 月度奖金
* @param yearMonth 年月
* @return 月度奖金
*/
MonthAward getByTime(@Param("yearMonth")Date yearMonth); MonthAward getByTime(@Param("yearMonth")Date yearMonth);
} }
...@@ -93,9 +93,8 @@ ...@@ -93,9 +93,8 @@
<include refid="table"/> <include refid="table"/>
<where> <where>
<if test="yearMonth != null"> <if test="yearMonth != null">
AND(
YEAR(create_time) = YEAR(#{yearMonth}) YEAR(create_time) = YEAR(#{yearMonth})
AND MONTH(create_time) = MONTH(#{yearMonth})) AND MONTH(create_time) = MONTH(#{yearMonth})
</if> </if>
order by create_time desc order by create_time desc
limit 1 limit 1
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
from from
<include refid="table"/> <include refid="table"/>
<where> <where>
(type=2 or status=0) (trade_type=2 or status=0)
<if test="userId"> <if test="userId">
and user_id=#{userId} and user_id=#{userId}
</if> </if>
......
package cn.wisenergy.service.app.impl; package cn.wisenergy.service.app.impl;
import cn.wisenergy.common.utils.DateUtil;
import cn.wisenergy.common.utils.R; import cn.wisenergy.common.utils.R;
import cn.wisenergy.mapper.MonthAwardMapper; import cn.wisenergy.mapper.MonthAwardMapper;
import cn.wisenergy.mapper.TradeRecordMapper; import cn.wisenergy.mapper.TradeRecordMapper;
...@@ -20,6 +21,8 @@ import java.util.Date; ...@@ -20,6 +21,8 @@ import java.util.Date;
@Slf4j @Slf4j
@Service @Service
public class MonthAwardServiceImpl extends ServiceImpl<MonthAwardMapper, MonthAward> implements MonthAwardService { public class MonthAwardServiceImpl extends ServiceImpl<MonthAwardMapper, MonthAward> implements MonthAwardService {
private static final String PATTERN = "yyyy-MM";
@Autowired @Autowired
private TradeRecordMapper tradeRecordMapper; private TradeRecordMapper tradeRecordMapper;
......
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