xuefei
2020-12-12 160487aedf89e2aea61f043c7a5c3d211ed19798
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cn.cetc54.platform.zhyl.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.cetc54.platform.zhyl.entity.SubsidyPersonStatics;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
import java.util.Map;
 
/**
 * 测试数据处理层
 * @author 
 */
public interface SubsidyPersonStaticsMapper extends BaseMapper<SubsidyPersonStatics> {
    /**
     * 获取每月新增和退出的历史数据
     * @param type
     * @return
     */
    @Select("<script>" +
            "select month,SUM(month_add) as mAdd,SUM(month_out) as mOut,SUM(check_num) as checkNum,SUM(total_num) as totalName " +
            "FROM t_yl_subsidy_person_statics " +
            " <where> " +
            "area_id = #{areaId} " +
            " <if test='type!= null'>" +
            " and subsidy_type = #{type}" +
            " </if>" +
            " </where>" +
            "GROUP BY month ORDER BY month DESC LIMIT 12" +
            " </script>")
    List<Map<String,Object>> getMonthAddOut(@Param("areaId") String areaId,@Param("type") Integer type);
}