供水量整编

master
yangzhe123 2025-09-05 16:13:08 +08:00
parent eaecd54de0
commit d6a270547b
3 changed files with 22 additions and 3 deletions

View File

@ -174,7 +174,7 @@ public class StWaterRReorganizeController {
return R.ok(list); return R.ok(list);
} }
@Operation(summary = "供水统计") @Operation(summary = "供水统计-右边四项统计")
@PostMapping("/count") @PostMapping("/count")
public R<StWaterRRVo> count(@RequestBody @Validated StWaterRReorganize stWaterRReorganize ){ public R<StWaterRRVo> count(@RequestBody @Validated StWaterRReorganize stWaterRReorganize ){
String searchType = stWaterRReorganize.getSearchType(); String searchType = stWaterRReorganize.getSearchType();

View File

@ -39,6 +39,12 @@ public class StWaterRReal implements Serializable {
@NotBlank(message = "测站编码不能为空") @NotBlank(message = "测站编码不能为空")
private String stcd; private String stcd;
/**
*
*/
@TableField(exist = false)
private String stnm;
/** /**
* *
*/ */

View File

@ -3,11 +3,24 @@
<mapper namespace="com.gunshi.project.hsz.mapper.StWaterRRealMapper"> <mapper namespace="com.gunshi.project.hsz.mapper.StWaterRRealMapper">
<select id="listRelated" resultType="com.gunshi.project.hsz.model.StWaterRReal"> <select id="listRelated" resultType="com.gunshi.project.hsz.model.StWaterRReal">
SELECT stb.stcd, stb.sttp, t.tm, t.q, t.v SELECT
stb.stcd,
stb.sttp,
stb.stnm,
t.tm,
t.q,
t.v
FROM public.st_stbprp_b stb FROM public.st_stbprp_b stb
JOIN public.st_water_r_real t ON t.stcd = stb.stcd JOIN public.st_water_r_real t ON t.stcd = stb.stcd
JOIN (
SELECT stcd, MAX(tm) as max_tm
FROM public.st_water_r_real
GROUP BY stcd
) latest ON t.stcd = latest.stcd AND t.tm = latest.max_tm
<where> <where>
stb.sttp in ('QQ', 'PQ') stb.sttp in ('QQ', 'PQ')
and stb.stcd in ('1112','1113','1114') -- 站点编码,这里到时候得改
</where> </where>
</select> </select>
</mapper> </mapper>