一、controller层写路由地址 和service接口方法
/** * 查询数量 路由地址aaa/bbb/ccc/getDone */ @PreAuthorize("@ss.hasPermi('aaa:bbb:ccc:list')") @GetMapping("/getDone") public ActionResult getDone(MeterPagination meterPagination) { List<HashMap> list = meterService.getDone(meterPagination); return ActionResult.success(list); }
二、service层写接口名称
List<HashMap> getDone(MeterPagination meterPagination);
三、serviceimpl实现接口重写
@Override public List<HashMap>getDone(MeterPagination pagination){ List<HashMap> list=meterMapper.getDone(pagination); return list; }
四、mapper写sql文
@Select("<script>" + "select 。。\n" + "from meter\n " + " INNER JOIN A表 on xx=xx \n"+ "where xx " + "and xx"+ "<if test=\"query.create_time != null \"> and reading.meter_month = DATE_FORMAT( #{query.create_time},'%Y-%m') </if>" + "<if test=\"query.waterworksId != null and query.waterworksId != ''\"> and tabular.waterworks_id = #{query.waterworksId}</if>" + "</script>" ) List<HashMap> getDone(@Param("query") MeterPagination query);
标签:MeterPagination,getDone,spingBoot,Get,List,list,----,xx,query From: https://www.cnblogs.com/CNLuminous/p/17517511.html