浏览代码

代码修改

LAPTOP-KB9HII50\70708 3 年之前
父节点
当前提交
0018e2fa93

+ 10 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/wlyygc/WlyygcDataEndpoint.java

@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
 * Created by yeshijie on 2022/1/18.
 */
@RestController
@RequestMapping(value = "open/gc/data")
@RequestMapping(value = "open/g1c/data")
@Api(value = "对外开放统计数据", tags = {"对外开放统计数据"})
public class WlyygcDataEndpoint extends EnvelopRestEndpoint {
@ -64,14 +64,18 @@ public class WlyygcDataEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "emeAndSecInfo")
    @ApiOperation(value = "安防/紧急呼叫概要")
    public ListEnvelop emeAndSecInfo(@ApiParam(name = "code", value = "社区编码")
                                    @RequestParam(value = "code", required = true) String code,
    public ListEnvelop emeAndSecInfo(@ApiParam(name = "code", value = "社区编码", required = true)
                                     @RequestParam(value = "code", required = true) String code,
                                     @ApiParam(name = "page", value = "分页大小", required = true)
                                    @RequestParam(value = "page") Integer page,
                                     @RequestParam(value = "page") Integer page,
                                     @ApiParam(name = "size", value = "页码", required = true)
                                    @RequestParam(value = "size") Integer size) {
                                     @RequestParam(value = "size") Integer size,
                                     @ApiParam(name = "type", value = "类型", required = false)
                                     @RequestParam(value = "type", required = false) Integer type,
                                     @ApiParam(name = "status", value = "状态", required = false)
                                     @RequestParam(value = "status", required = false) Integer status) {
        try {
            JSONArray result = wlyygcStatisticsService.emeAndSecInfo(page,size,code);
            JSONArray result = wlyygcStatisticsService.emeAndSecInfo(page,size,code,type,status);
            return success(result);
        } catch (Exception e) {
            return failedListEnvelopException2(e);

+ 11 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/WlyygcStatisticsService.java

@ -181,7 +181,7 @@ public class WlyygcStatisticsService {
     * @param code
     * @return
     */
    public JSONArray emeAndSecInfo(Integer page, Integer size,String code){
    public JSONArray emeAndSecInfo(Integer page, Integer size,String code,Integer type,Integer status){
        JSONArray jsonArray = new JSONArray();
        String filter = "";
        if("1".equals(code)){
@ -189,6 +189,9 @@ public class WlyygcStatisticsService {
        }else {
            return jsonArray;
        }
        if(status!=null){
            filter += " and o.status = "+status;
        }
        if(page==null){
            page =1;
        }
@ -206,13 +209,18 @@ public class WlyygcStatisticsService {
                ", base_service_package_record r, base_emergency_assistance_order o    " +
                "WHERE p.del = 1 and p.archive_type =1 and r.patient = p.id " +
                "and p.id = o.patient " + filter +
                "UNION ALL " +
                " UNION ALL " +
                "select o.id,p.name,p.idcard,p.residential_area,'2' type,o.serve_address,o.serve_desc,o.status,o.create_time FROM  " +
                "base_patient p INNER JOIN base_service_package_sign_record sr on p.id = sr.patient and sr.`status`=1 " +
                ", base_service_package_record r, base_security_monitoring_order o " +
                "WHERE p.del = 1 and p.archive_type =1 and r.patient = p.id " +
                "and p.id = o.patient " + filter +
                " ) a ORDER BY a.create_time desc limit "+(page*size)+","+size;
                " ) a where 1=1 ";
        if(type!=null){
            sql += " and a.type = '"+type+"'";
        }
        sql += "ORDER BY a.create_time desc limit "+(page*size)+","+size;
        List<Map<String,Object>> res = jdbcTemplate.queryForList(sql);
        for (Map<String,Object> map : res){
            JSONObject json = new JSONObject();