Commit 72dc0356 authored by tangwei's avatar tangwei

巡检统计接口编写

parent 0feb06f1
...@@ -22,6 +22,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -22,6 +22,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -44,70 +45,81 @@ public class InspectionStatisticsController extends AbstractBaseController { ...@@ -44,70 +45,81 @@ public class InspectionStatisticsController extends AbstractBaseController {
@ApiOperation(value = "巡查点统计饼状图,已巡检未巡检", notes = "巡查点统计饼状图,已巡检未巡检") @ApiOperation(value = "巡查点统计饼状图,已巡检未巡检", notes = "巡查点统计饼状图,已巡检未巡检")
@GetMapping(value = "/point/statistics/xj") @GetMapping(value = "/point/statistics/xj")
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth=false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth=false)
public CommonResponse detailxj( public HashMap<String, Object> detailxj(
@ApiParam(value = "线路关键字", required = false) @RequestParam String name, @ApiParam(value = "线路关键字", required = false) @RequestParam(required = false) String name,
@ApiParam(value = "统计分类", required = true) @RequestParam String type) { @ApiParam(value = "统计分类", required = true) @RequestParam String type) {
String timeType=""; String timeType="";
switch (type) { switch (type) {
case "日": case "日":
timeType="d"; timeType="dt";
name= ( name!=null&&!"".equals(name)? "-日-"+name:null); name= ( name!=null&&!"".equals(name)? "-日-"+name:"-日-");
break; break;
case "月": case "月":
timeType="m"; timeType="mt";
name= ( name!=null&&!"".equals(name)? "-月-"+name:null); name= ( name!=null&&!"".equals(name)? "-月-"+name:"-月-");
break; break;
case "季": case "季":
timeType="j"; timeType="jt";
name= ( name!=null&&!"".equals(name)? "-季-"+name:null); name= ( name!=null&&!"".equals(name)? "-季-"+name:"-季-");
break; break;
case "年": case "年":
timeType="yr"; timeType="yrt";
name= ( name!=null&&!"".equals(name)? "-年-"+name:null); name= ( name!=null&&!"".equals(name)? "-年-"+name:"-年-");
break; break;
default: default:
throw new BadRequest("类型错误."); throw new BadRequest("类型错误.");
} }
List<Map<String, Object>> data= taskServiceImpl.getStatisticsByTypeXJ( name, timeType); List<Map<String, Object>> data= taskServiceImpl.getStatisticsByTypeXJ( name, timeType);
return CommonResponseUtil.success(data);
HashMap<String, Object> temph = new HashMap<>();
temph.put("result",data);
temph.put("status",200);
temph.put("message","");
return temph;
} }
@ApiOperation(value = "巡查点统计饼状图,合格不合格", notes = "巡查点统计饼状图,合格不合格") @ApiOperation(value = "巡查点统计饼状图,合格不合格", notes = "巡查点统计饼状图,合格不合格")
@GetMapping(value = "/point/statistics/hg") @GetMapping(value = "/point/statistics/hg")
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth=false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth=false)
public CommonResponse detailhg( public HashMap<String, Object> detailhg(
@ApiParam(value = "线路关键字", required = false) @RequestParam String name, @ApiParam(value = "线路关键字", required = false) @RequestParam (required = false) String name,
@ApiParam(value = "统计分类", required = true) @RequestParam String type) { @ApiParam(value = "统计分类", required = true) @RequestParam String type) {
String timeType=""; String timeType="";
switch (type) { switch (type) {
case "日": case "日":
timeType="d"; timeType="dt";
name= ( name!=null&&!"".equals(name)? "-日-"+name:null); name= ( name!=null&&!"".equals(name)? "-日-"+name:"-日-");
break; break;
case "月": case "月":
timeType="m"; timeType="mt";
name= ( name!=null&&!"".equals(name)? "-月-"+name:null); name= ( name!=null&&!"".equals(name)? "-月-"+name:"-月-");
break; break;
case "季": case "季":
timeType="j"; timeType="jt";
name= ( name!=null&&!"".equals(name)? "-季-"+name:null); name= ( name!=null&&!"".equals(name)? "-季-"+name:"-季-");
break; break;
case "年": case "年":
timeType="yr"; timeType="yrt";
name= ( name!=null&&!"".equals(name)? "-年-"+name:null); name= ( name!=null&&!"".equals(name)? "-年-"+name:"-年-");
break; break;
default: default:
throw new BadRequest("类型错误."); throw new BadRequest("类型错误.");
} }
List<Map<String, Object>> data= taskServiceImpl.getStatisticsByTypeHG( name, timeType); List<Map<String, Object>> data= taskServiceImpl.getStatisticsByTypeHG( name, timeType);
return CommonResponseUtil.success(data); HashMap<String, Object> temph = new HashMap<>();
temph.put("result",data);
temph.put("status",200);
temph.put("message","");
return temph;
} }
@ApiOperation(value = "日巡检线路区域", notes = "日巡检线路区域") @ApiOperation(value = "日巡检线路区域", notes = "日巡检线路区域")
@GetMapping(value = "/point/statistics/qy") @GetMapping(value = "/point/statistics/qy")
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth=false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth=false)
public CommonResponse detailqy( public HashMap<String, Object> detailqy(
@ApiParam(value = "统计分类", required = true) @RequestParam String type) { @ApiParam(value = "统计分类", required = true) @RequestParam String type,
@ApiParam(value = "线路关键字", required = true) @RequestParam int pageNumber,
@ApiParam(value = "统计分类", required = true) @RequestParam int pageSize) {
String name=""; String name="";
switch (type) { switch (type) {
case "日": case "日":
...@@ -125,8 +137,8 @@ public class InspectionStatisticsController extends AbstractBaseController { ...@@ -125,8 +137,8 @@ public class InspectionStatisticsController extends AbstractBaseController {
default: default:
throw new BadRequest("类型错误."); throw new BadRequest("类型错误.");
} }
List<Map<String, Object>> data= taskServiceImpl.getLinetype( name); HashMap<String, Object> data= taskServiceImpl.getLinetype(pageNumber-1,pageSize, name);
return CommonResponseUtil.success(data); return data;
} }
...@@ -134,68 +146,68 @@ public class InspectionStatisticsController extends AbstractBaseController { ...@@ -134,68 +146,68 @@ public class InspectionStatisticsController extends AbstractBaseController {
@ApiOperation(value = "巡检不合格", notes = "巡检不合格") @ApiOperation(value = "巡检不合格", notes = "巡检不合格")
@GetMapping(value = "/point/statistics/xjbhg") @GetMapping(value = "/point/statistics/xjbhg")
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth=false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth=false)
public CommonResponse detailxjbhg( public HashMap<String, Object> detailxjbhg(
@ApiParam(value = "线路关键字", required = false) @RequestParam String name, @ApiParam(value = "线路关键字", required = false) @RequestParam(required = false) String name,
@ApiParam(value = "统计分类", required = true) @RequestParam String type, @ApiParam(value = "统计分类", required = true) @RequestParam String type,
@ApiParam(value = "线路关键字", required = true) @RequestParam int pageNumber, @ApiParam(value = "线路关键字", required = true) @RequestParam int pageNumber,
@ApiParam(value = "统计分类", required = true) @RequestParam int pageSize) { @ApiParam(value = "统计分类", required = true) @RequestParam int pageSize) {
String timeType=""; String timeType="";
switch (type) { switch (type) {
case "日": case "日":
timeType="d"; timeType="dt";
name= ( name!=null&&!"".equals(name)? "-日-"+name:null); name= ( name!=null&&!"".equals(name)? "-日-"+name:"-日-");
break; break;
case "月": case "月":
timeType="m"; timeType="mt";
name= ( name!=null&&!"".equals(name)? "-月-"+name:null); name= ( name!=null&&!"".equals(name)? "-月-"+name:"-月-");
break; break;
case "季": case "季":
timeType="j"; timeType="jt";
name= ( name!=null&&!"".equals(name)? "-季-"+name:null); name= ( name!=null&&!"".equals(name)? "-季-"+name:"-季-");
break; break;
case "年": case "年":
timeType="yr"; timeType="yrt";
name= ( name!=null&&!"".equals(name)? "-年-"+name:null); name= ( name!=null&&!"".equals(name)? "-年-"+name:"-年-");
break; break;
default: default:
throw new BadRequest("类型错误."); throw new BadRequest("类型错误.");
} }
Page<Map<String, Object>> data= taskServiceImpl.getLinetypeUnqualified( pageNumber, pageSize, name, timeType); HashMap<String, Object> data= taskServiceImpl.getLinetypeUnqualified( pageNumber-1, pageSize, name, timeType);
return CommonResponseUtil.success(data); return data;
} }
@ApiOperation(value = "未巡检", notes = "未巡检") @ApiOperation(value = "未巡检", notes = "未巡检")
@GetMapping(value = "/point/statistics/wxj") @GetMapping(value = "/point/statistics/wxj")
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth=false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth=false)
public CommonResponse detailwxj( public HashMap<String, Object> detailwxj(
@ApiParam(value = "线路关键字", required = false) @RequestParam String name, @ApiParam(value = "线路关键字", required = false) @RequestParam(required = false) String name,
@ApiParam(value = "统计分类", required = true) @RequestParam String type, @ApiParam(value = "统计分类", required = true) @RequestParam String type,
@ApiParam(value = "线路关键字", required = true) @RequestParam int pageNumber, @ApiParam(value = "线路关键字", required = true) @RequestParam int pageNumber,
@ApiParam(value = "统计分类", required = true) @RequestParam int pageSize) { @ApiParam(value = "统计分类", required = true) @RequestParam int pageSize) {
String timeType=""; String timeType="";
switch (type) { switch (type) {
case "日": case "日":
timeType="d"; timeType="dt";
name= ( name!=null&&!"".equals(name)? "-日-"+name:null); name= ( name!=null&&!"".equals(name)? "-日-"+name:"-日-");
break; break;
case "月": case "月":
timeType="m"; timeType="mt";
name= ( name!=null&&!"".equals(name)? "-月-"+name:null); name= ( name!=null&&!"".equals(name)? "-月-"+name:"-月-");
break; break;
case "季": case "季":
timeType="j"; timeType="jt";
name= ( name!=null&&!"".equals(name)? "-季-"+name:null); name= ( name!=null&&!"".equals(name)? "-季-"+name:"-季-");
break; break;
case "年": case "年":
timeType="yr"; timeType="yrt";
name= ( name!=null&&!"".equals(name)? "-年-"+name:null); name= ( name!=null&&!"".equals(name)? "-年-"+name:"-年-");
break; break;
default: default:
throw new BadRequest("类型错误."); throw new BadRequest("类型错误.");
} }
Page<Map<String, Object>> data= taskServiceImpl.getLinetypeNotInspected( pageNumber, pageSize, name, timeType); HashMap<String, Object> data= taskServiceImpl.getLinetypeNotInspected( pageNumber-1, pageSize, name, timeType);
return CommonResponseUtil.success(data); return data;
} }
......
...@@ -211,7 +211,9 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -211,7 +211,9 @@ public interface PlanTaskMapper extends BaseMapper {
Map<String,Object> getStatisticsByTypeHG(@Param("name") String name,@Param("timeType") String timeType); Map<String,Object> getStatisticsByTypeHG(@Param("name") String name,@Param("timeType") String timeType);
//根据日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 获取线路关键区域 //根据日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 获取线路关键区域
List<Map<String,Object>> getLinetype(@Param("nameType") String nameType); List<Map<String,Object>> getLinetype(@Param("offset") Long offset,@Param("pageSize") int pageSize,@Param("name") String name);
//根据日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 获取线路关键区域
long getLinetypecount(@Param("name") String name);
//根据线路关键字过滤,日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 不合格 //根据线路关键字过滤,日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 不合格
List<Map<String,Object>> getLinetypeUnqualified(@Param("offset") Long offset,@Param("pageSize") int pageSize,@Param("name") String name,@Param("timeType") String timeType); List<Map<String,Object>> getLinetypeUnqualified(@Param("offset") Long offset,@Param("pageSize") int pageSize,@Param("name") String name,@Param("timeType") String timeType);
......
...@@ -635,26 +635,176 @@ public class TaskServiceImpl implements ITaskService { ...@@ -635,26 +635,176 @@ public class TaskServiceImpl implements ITaskService {
} }
@Override @Override
public List<Map<String, Object>> getLinetype(String nameType) { public HashMap<String, Object> getLinetype(int pageNumber,int pageSize,String nameType) {
return planTaskMapper.getLinetype(nameType); CommonPageable commonPageable=new CommonPageable(pageNumber, pageSize);
List<Map<String, Object>> data= planTaskMapper.getLinetype(commonPageable.getOffset(),commonPageable.getPageSize(),nameType);
Long total= planTaskMapper.getLinetypecount(nameType);
Page<Map<String, Object>> result = new PageImpl<Map<String, Object>>(data, commonPageable, total);
List< HashMap<String, Object>> colModel=new ArrayList<>();
HashMap<String, Object> temph1 = new HashMap<>();
temph1.put("fid","name");
temph1.put("dataIndex","name");
temph1.put("name"," 巡检区域");
temph1.put("title","巡检区域");
temph1.put("type","dataGrid");
temph1.put("key","name");
colModel.add(temph1);
HashMap<String, Object> dataGridMock = new HashMap<>();
dataGridMock.put("current",result.getNumber()+1);
dataGridMock.put("total",result.getTotalElements());
dataGridMock.put("pagination",false);
dataGridMock.put("totalPage",result.getTotalPages());
dataGridMock.put("dataList",result.getContent());
dataGridMock.put("pageSize",result.getSize());
HashMap<String, Object> DATE = new HashMap<>();
DATE.put("dataGridMock",dataGridMock);
DATE.put("colModel",colModel);
HashMap<String, Object> temph = new HashMap<>();
temph.put("result",DATE);
temph.put("status",200);
temph.put("message","");
return temph;
} }
@Override @Override
public Page<Map<String, Object>> getLinetypeUnqualified(int pageNumber,int pageSize,String nameType, String timeType) { public HashMap<String, Object> getLinetypeUnqualified(int pageNumber,int pageSize,String nameType, String timeType) {
CommonPageable commonPageable=new CommonPageable(pageNumber, pageSize); CommonPageable commonPageable=new CommonPageable(pageNumber, pageSize);
Long total= planTaskMapper.countLinetypeUnqualified(nameType,timeType); Long total= planTaskMapper.countLinetypeUnqualified(nameType,timeType);
List<Map<String,Object>> content=planTaskMapper.getLinetypeUnqualified(commonPageable.getOffset(), pageSize, nameType, timeType); List<Map<String,Object>> content=planTaskMapper.getLinetypeUnqualified(commonPageable.getOffset(), pageSize, nameType, timeType);
Page<Map<String, Object>> result = new PageImpl<Map<String, Object>>(content, commonPageable, total); Page<Map<String, Object>> result = new PageImpl<Map<String, Object>>(content, commonPageable, total);
return result; List< HashMap<String, Object>> colModel=new ArrayList<>();
HashMap<String, Object> temph1 = new HashMap<>();
temph1.put("fid","pointNum");
temph1.put("dataIndex","pointNum");
temph1.put("name"," 巡检点编号");
temph1.put("title","巡检点编号");
temph1.put("type","dataGrid");
temph1.put("key","pointNum");
colModel.add(temph1);
HashMap<String, Object> temph2 = new HashMap<>();
temph2.put("fid","name");
temph2.put("dataIndex","name");
temph2.put("name"," 巡检点名称");
temph2.put("title","巡检点名称");
temph2.put("type","dataGrid");
temph2.put("key","name");
colModel.add(temph2);
HashMap<String, Object> temph3 = new HashMap<>();
temph3.put("fid","bizOrgName");
temph3.put("dataIndex","bizOrgName");
temph3.put("name"," 所属部门");
temph3.put("title","所属部门");
temph3.put("type","dataGrid");
temph3.put("key","bizOrgName");
colModel.add(temph3);
HashMap<String, Object> temph4 = new HashMap<>();
temph4.put("fid","actor");
temph4.put("dataIndex","actor");
temph4.put("name"," 执行人");
temph4.put("title","执行人");
temph4.put("type","dataGrid");
temph4.put("key","actor");
colModel.add(temph4);
HashMap<String, Object> temph5 = new HashMap<>();
temph5.put("fid","create_date");
temph5.put("dataIndex","create_date");
temph5.put("name"," 时间");
temph5.put("title","时间");
temph5.put("type","dataGrid");
temph5.put("key","create_date");
colModel.add(temph5);
HashMap<String, Object> dataGridMock = new HashMap<>();
dataGridMock.put("current",result.getNumber()+1);
dataGridMock.put("total",result.getTotalElements());
dataGridMock.put("pagination",false);
dataGridMock.put("totalPage",result.getTotalPages());
dataGridMock.put("dataList",result.getContent());
dataGridMock.put("pageSize",result.getSize());
HashMap<String, Object> DATE = new HashMap<>();
DATE.put("dataGridMock",dataGridMock);
DATE.put("colModel",colModel);
HashMap<String, Object> temph = new HashMap<>();
temph.put("result",DATE);
temph.put("status",200);
temph.put("message","");
return temph;
} }
@Override @Override
public Page<Map<String, Object>> getLinetypeNotInspected(int pageNumber,int pageSize,String nameType, String timeType) { public HashMap<String, Object> getLinetypeNotInspected(int pageNumber,int pageSize,String nameType, String timeType) {
CommonPageable commonPageable=new CommonPageable(pageNumber, pageSize); CommonPageable commonPageable=new CommonPageable(pageNumber, pageSize);
Long total= planTaskMapper.countLinetypeNotInspected(nameType,timeType); Long total= planTaskMapper.countLinetypeNotInspected(nameType,timeType);
List<Map<String,Object>> content=planTaskMapper.getLinetypeNotInspected(commonPageable.getOffset(), pageSize, nameType, timeType); List<Map<String,Object>> content=planTaskMapper.getLinetypeNotInspected(commonPageable.getOffset(), pageSize, nameType, timeType);
Page<Map<String, Object>> result = new PageImpl<Map<String, Object>>(content, commonPageable, total); Page<Map<String, Object>> result = new PageImpl<Map<String, Object>>(content, commonPageable, total);
return result; List< HashMap<String, Object>> colModel=new ArrayList<>();
HashMap<String, Object> temph2 = new HashMap<>();
temph2.put("fid","routeName");
temph2.put("dataIndex","routeName");
temph2.put("name"," 路线名称");
temph2.put("title","路线名称");
temph2.put("type","dataGrid");
temph2.put("key","routeName");
colModel.add(temph2);
HashMap<String, Object> temph1 = new HashMap<>();
temph1.put("fid","pointNum");
temph1.put("dataIndex","pointNum");
temph1.put("name"," 巡检点编号");
temph1.put("title","巡检点编号");
temph1.put("type","dataGrid");
temph1.put("key","pointNum");
colModel.add(temph1);
HashMap<String, Object> temph0 = new HashMap<>();
temph0.put("fid","name");
temph0.put("dataIndex","name");
temph0.put("name"," 巡检点名称");
temph0.put("title","巡检点名称");
temph0.put("type","dataGrid");
temph0.put("key","name");
colModel.add(temph0);
HashMap<String, Object> temph3 = new HashMap<>();
temph3.put("fid","bizOrgName");
temph3.put("dataIndex","bizOrgName");
temph3.put("name"," 所属部门");
temph3.put("title","所属部门");
temph3.put("type","dataGrid");
temph3.put("key","bizOrgName");
colModel.add(temph3);
HashMap<String, Object> temph4 = new HashMap<>();
temph4.put("fid","actor");
temph4.put("dataIndex","actor");
temph4.put("name"," 执行人");
temph4.put("title","执行人");
temph4.put("type","dataGrid");
temph4.put("key","actor");
colModel.add(temph4);
HashMap<String, Object> dataGridMock = new HashMap<>();
dataGridMock.put("current",result.getNumber()+1);
dataGridMock.put("total",result.getTotalElements());
dataGridMock.put("pagination",false);
dataGridMock.put("totalPage",result.getTotalPages());
dataGridMock.put("dataList",result.getContent());
dataGridMock.put("pageSize",result.getSize());
HashMap<String, Object> DATE = new HashMap<>();
DATE.put("dataGridMock",dataGridMock);
DATE.put("colModel",colModel);
HashMap<String, Object> temph = new HashMap<>();
temph.put("result",DATE);
temph.put("status",200);
temph.put("message","");
return temph;
} }
} }
...@@ -177,13 +177,13 @@ public interface ITaskService { ...@@ -177,13 +177,13 @@ public interface ITaskService {
List<Map<String, Object>> getStatisticsByTypeHG( String name, String timeType); List<Map<String, Object>> getStatisticsByTypeHG( String name, String timeType);
//根据日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 获取线路关键区域 //根据日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 获取线路关键区域
List<Map<String,Object>> getLinetype( String nameType); HashMap<String, Object> getLinetype( int pageNumber,int pageSize,String nameType);
//根据线路关键字过滤,日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 不合格 //根据线路关键字过滤,日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 不合格
Page <Map<String,Object>> getLinetypeUnqualified(int offset,int pageSize, String nameType,String timeType); HashMap<String, Object> getLinetypeUnqualified(int offset,int pageSize, String nameType,String timeType);
//根据线路关键字过滤,日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 未巡检 //根据线路关键字过滤,日线路(今日),月线路(当月)。季度线路(本季度),年线路(本年) 未巡检
Page<Map<String,Object>> getLinetypeNotInspected( int offset,int pageSize,String nameType, String timeType); HashMap<String, Object> getLinetypeNotInspected( int offset,int pageSize,String nameType, String timeType);
......
...@@ -1156,27 +1156,27 @@ ...@@ -1156,27 +1156,27 @@
( ifnull( sum( p_plan_task.`point_num` ), 0 ) - ifnull( sum( p_plan_task.`finish_num` ), 0 ) ) AS `wxj` ( ifnull( sum( p_plan_task.`point_num` ), 0 ) - ifnull( sum( p_plan_task.`finish_num` ), 0 ) ) AS `wxj`
from p_plan_task left join p_plan from p_plan_task left join p_plan
on p_plan_task.plan_id=p_plan.id on p_plan_task.plan_id=p_plan.id
where <where>
<choose> <choose>
<when test="timeType == 'd'"> <when test="timeType == 'dt'">
to_days(p_plan_task.begin_time) = to_days(curdate()) and DATE(p_plan_task.begin_time) = DATE(curdate())
</when> </when>
<when test="timeType == 'm'"> <when test="timeType == 'mt'">
month(p_plan_task.begin_time) =month(curdate()) and year(p_plan_task.begin_time) = year(curdate()) and month(p_plan_task.begin_time) =month(curdate()) and year(p_plan_task.begin_time) = year(curdate())
</when> </when>
<when test="timeType == 'j'"> <when test="timeType == 'jt'">
QUARTER(p_plan_task.begin_time) =QUARTER(curdate()) and QUARTER(p_plan_task.begin_time) =QUARTER(curdate())
</when> </when>
<when test="timeType == 'yr'"> <when test="timeType == 'yrt'">
year( p_plan_task.begin_time ) = year( curdate( )) and year( p_plan_task.begin_time ) = year( curdate( ))
</when> </when>
</choose> </choose>
<if test="name != null and name!=''"> <if test="name != null and name!=''">
SUBSTRING_INDEX( p_plan.`name`,'-',-1)=#{name} and p_plan.`name` like CONCAT( '%',#{name}, '%')
</if> </if>
</where>
</select> </select>
<select id="getStatisticsByTypeHG" resultType="java.util.Map"> <select id="getStatisticsByTypeHG" resultType="java.util.Map">
...@@ -1187,33 +1187,52 @@ ...@@ -1187,33 +1187,52 @@
on p_plan_task.plan_id=p_plan.id on p_plan_task.plan_id=p_plan.id
LEFT JOIN p_plan_task_detail LEFT JOIN p_plan_task_detail
ON p_plan_task_detail.task_no=p_plan_task.id ON p_plan_task_detail.task_no=p_plan_task.id
where <where>
<choose> <choose>
<when test="timeType == 'd'"> <when test="timeType == 'dt'">
to_days(p_plan_task.begin_time) = to_days(curdate()) and DATE(p_plan_task.begin_time) = DATE(curdate())
</when> </when>
<when test="timeType == 'm'"> <when test="timeType == 'mt'">
month(p_plan_task.begin_time) =month(curdate()) and year(p_plan_task.begin_time) = year(curdate()) and month(p_plan_task.begin_time) =month(curdate()) and year(p_plan_task.begin_time) = year(curdate())
</when> </when>
<when test="timeType == 'j'"> <when test="timeType == 'jt'">
QUARTER(p_plan_task.begin_time) =QUARTER(curdate()) and QUARTER(p_plan_task.begin_time) =QUARTER(curdate())
</when> </when>
<when test="timeType == 'yr'"> <when test="timeType == 'yrt'">
year( p_plan_task.begin_time ) = year( curdate( )) and year( p_plan_task.begin_time ) = year( curdate( ))
</when> </when>
</choose> </choose>
<if test="name != null and name!=''"> <if test="name != null and name!=''">
SUBSTRING_INDEX( p_plan.`name`,'-',-1)=#{name} and p_plan.`name` like CONCAT('%',#{name}, '%')
</if> </if>
</where>
</select> </select>
<select id="getLinetype" resultType="java.util.Map"> <select id="getLinetype" resultType="java.util.Map">
select SUBSTRING_INDEX(p_plan.name,'-',-1) as `name` from p_plan
select
distinct SUBSTRING_INDEX(p_plan.name,'-',-1) as `name_measure` from p_plan
<where>
<if test="name != null and name!=''"> <if test="name != null and name!=''">
SUBSTRING_INDEX( p_plan.`name`,'-',-1)=#{name} p_plan.`name` like CONCAT('%',#{name}, '%')
</if> </if>
</where>
limit #{offset},#{pageSize}
</select>
<select id="getLinetypecount" resultType="long">
select
COUNT(1) AS num from p_plan
<where>
<if test="name != null and name!=''">
p_plan.`name` like CONCAT('%',#{name}, '%')
</if>
</where>
</select> </select>
<select id="countLinetypeUnqualified" resultType="long"> <select id="countLinetypeUnqualified" resultType="long">
SELECT SELECT
...@@ -1231,33 +1250,33 @@ ...@@ -1231,33 +1250,33 @@
RIGHT JOIN p_plan_task_detail pptd ON ppt.ID = pptd.TASK_NO RIGHT JOIN p_plan_task_detail pptd ON ppt.ID = pptd.TASK_NO
LEFT JOIN p_plan pp ON ppt.plan_id = pp.id LEFT JOIN p_plan pp ON ppt.plan_id = pp.id
LEFT JOIN p_point ppo ON ppo.id = pptd.point_id LEFT JOIN p_point ppo ON ppo.id = pptd.point_id
WHERE <where>
pptd.`status` = 2 pptd.`status` = 2
<if test="name != null and name !=''"> <if test="name != null and name !=''">
SUBSTRING_INDEX( p_plan.`name`,'-',-1)=#{name}
</if>
ORDER BY and pp.`name` like CONCAT('%',#{name}, '%')
pptd.create_date DESC </if>
) a <choose>
GROUP BY <when test="timeType == 'dt'">
pointNum and DATE(pptd.create_date) = DATE(curdate())
having
<choose>
<when test="timeType == 'd'">
to_days(create_date) = to_days(curdate())
</when> </when>
<when test="timeType == 'm'"> <when test="timeType == 'mt'">
month(create_date) =month(curdate()) and year(create_date) = year(curdate()) and month(pptd.create_date) =month(curdate()) and year(pptd.create_date) = year(curdate())
</when> </when>
<when test="timeType == 'j'"> <when test="timeType == 'jt'">
QUARTER(create_date) =QUARTER(curdate()) and QUARTER(pptd.create_date) =QUARTER(curdate())
</when> </when>
<when test="timeType == 'yr'"> <when test="timeType == 'yrt'">
year( create_date ) = year( curdate( )) and year( pptd.create_date ) = year( curdate( ))
</when> </when>
</choose> </choose>
</where>
GROUP BY
ppo.point_no
) a
</select> </select>
<select id="getLinetypeUnqualified" resultType="java.util.Map"> <select id="getLinetypeUnqualified" resultType="java.util.Map">
SELECT SELECT
...@@ -1265,50 +1284,56 @@ ...@@ -1265,50 +1284,56 @@
FROM FROM
( (
SELECT SELECT
ppo.point_no pointNum, ppo.point_no pointNum_measure1,
ppo.`name`, ppo.point_no pointNum_measure,
ppo.biz_org_name bizOrgName, ppo.`name` name_measure,
pptd.executor_name AS actor, ppo.biz_org_name bizOrgName_measure,
pptd.create_date pptd.executor_name AS actor_measure,
pptd.create_date create_date_measure
FROM FROM
p_plan_task ppt p_plan_task ppt
RIGHT JOIN p_plan_task_detail pptd ON ppt.ID = pptd.TASK_NO RIGHT JOIN p_plan_task_detail pptd ON ppt.ID = pptd.TASK_NO
LEFT JOIN p_plan pp ON ppt.plan_id = pp.id LEFT JOIN p_plan pp ON ppt.plan_id = pp.id
LEFT JOIN p_point ppo ON ppo.id = pptd.point_id LEFT JOIN p_point ppo ON ppo.id = pptd.point_id
WHERE <where>
pptd.`status` = 2 pptd.`status` = 2
<if test="name != null and name !=''"> <if test="name != null and name !=''">
SUBSTRING_INDEX( p_plan.`name`,'-',-1)=#{name} and pp.`name` like CONCAT('%',#{name}, '%')
</if> </if>
<choose>
<when test="timeType == 'dt'">
and DATE(pptd.create_date) = DATE(curdate())
</when>
<when test="timeType == 'mt'">
and month(pptd.create_date) =month(curdate()) and year(pptd.create_date) = year(curdate())
</when>
<when test="timeType == 'jt'">
and QUARTER(pptd.create_date) =QUARTER(curdate())
</when>
<when test="timeType == 'yrt'">
and year( pptd.create_date ) = year( curdate( ))
</when>
</choose>
</where>
GROUP BY
ppo.point_no
ORDER BY ORDER BY
pptd.create_date DESC pptd.create_date DESC
) a ) a
GROUP BY
pointNum
having
<choose>
<when test="timeType == 'd'">
to_days(create_date) = to_days(curdate())
</when>
<when test="timeType == 'm'">
month(create_date) =month(curdate()) and year(create_date) = year(curdate())
</when>
<when test="timeType == 'j'">
QUARTER(create_date) =QUARTER(curdate())
</when>
<when test="timeType == 'yr'">
year( create_date ) = year( curdate( ))
</when>
</choose>
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</select> </select>
<select id="countLinetypeNotInspected" resultType="long"> <select id="countLinetypeNotInspected" resultType="long">
select COUNT(* ) AS num from (
SELECT SELECT
COUNT(1) AS num ppo.point_no pointNum,
ppo.route_name routeName,
ppo.`name`,
ppo.biz_org_name bizOrgName,
pr.boss_name AS actor,
pc.create_date checkDate
FROM FROM
p_plan_task ppt p_plan_task ppt
RIGHT JOIN p_plan_task_detail pptd ON ppt.ID = pptd.TASK_NO RIGHT JOIN p_plan_task_detail pptd ON ppt.ID = pptd.TASK_NO
...@@ -1316,28 +1341,30 @@ ...@@ -1316,28 +1341,30 @@
LEFT JOIN p_point ppo ON ppo.id = pptd.point_id LEFT JOIN p_point ppo ON ppo.id = pptd.point_id
LEFT JOIN p_check pc ON pptd.id = pc.plan_task_detail_id LEFT JOIN p_check pc ON pptd.id = pc.plan_task_detail_id
LEFT JOIN p_route pr ON pr.id = ppt.route_id LEFT JOIN p_route pr ON pr.id = ppt.route_id
WHERE <where>
pptd.`is_finish` != 1 pptd.`is_finish` != 1
<choose> <choose>
<when test="timeType == 'd'"> <when test="timeType == 'dt'">
to_days(ppt.begin_time) = to_days(curdate()) and DATE(ppt.begin_time) = DATE(curdate())
</when> </when>
<when test="timeType == 'm'"> <when test="timeType == 'mt'">
month(ppt.begin_time) =month(curdate()) and year(ppt.begin_time) = year(curdate()) and month(ppt.begin_time) =month(curdate()) and year(ppt.begin_time) = year(curdate())
</when> </when>
<when test="timeType == 'j'"> <when test="timeType == 'jt'">
QUARTER(ppt.begin_time) =QUARTER(curdate()) and QUARTER(ppt.begin_time) =QUARTER(curdate())
</when> </when>
<when test="timeType == 'yr'"> <when test="timeType == 'yrt'">
year( ppt.begin_time ) = year( curdate( )) and year( ppt.begin_time ) = year( curdate( ))
</when> </when>
</choose> </choose>
<if test="name != null and name !=''"> <if test="name != null and name !=''">
SUBSTRING_INDEX( pp.`name`,'-',-1)=#{name} and pp.`name` like CONCAT('%',#{name}, '%')
</if> </if>
</where>
GROUP BY
ppo.point_no
) a
</select> </select>
...@@ -1348,12 +1375,12 @@ ...@@ -1348,12 +1375,12 @@
FROM FROM
( (
SELECT SELECT
ppo.point_no pointNum, ppo.point_no pointNum_measure,
ppo.route_name routeName, ppo.route_name routeName_measure,
ppo.`name`, ppo.`name` name_measure,
ppo.biz_org_name bizOrgName, ppo.biz_org_name bizOrgName_measure,
pr.boss_name AS actor, pr.boss_name AS actor_measure,
pc.create_date checkDate pc.create_date checkDate_measure
FROM FROM
p_plan_task ppt p_plan_task ppt
RIGHT JOIN p_plan_task_detail pptd ON ppt.ID = pptd.TASK_NO RIGHT JOIN p_plan_task_detail pptd ON ppt.ID = pptd.TASK_NO
...@@ -1361,31 +1388,33 @@ ...@@ -1361,31 +1388,33 @@
LEFT JOIN p_point ppo ON ppo.id = pptd.point_id LEFT JOIN p_point ppo ON ppo.id = pptd.point_id
LEFT JOIN p_check pc ON pptd.id = pc.plan_task_detail_id LEFT JOIN p_check pc ON pptd.id = pc.plan_task_detail_id
LEFT JOIN p_route pr ON pr.id = ppt.route_id LEFT JOIN p_route pr ON pr.id = ppt.route_id
WHERE <where>
pptd.`is_finish` != 1 pptd.`is_finish` != 1
<choose> <choose>
<when test="timeType == 'd'"> <when test="timeType == 'dt'">
to_days(ppt.begin_time) = to_days(curdate()) and DATE(ppt.begin_time) = DATE(curdate())
</when> </when>
<when test="timeType == 'm'"> <when test="timeType == 'mt'">
month(ppt.begin_time) =month(curdate()) and year(ppt.begin_time) = year(curdate()) and month(ppt.begin_time) =month(curdate()) and year(ppt.begin_time) = year(curdate())
</when> </when>
<when test="timeType == 'j'"> <when test="timeType == 'jt'">
QUARTER(ppt.begin_time) =QUARTER(curdate()) and QUARTER(ppt.begin_time) =QUARTER(curdate())
</when> </when>
<when test="timeType == 'yr'"> <when test="timeType == 'yrt'">
year( ppt.begin_time ) = year( curdate( )) and year( ppt.begin_time ) = year( curdate( ))
</when> </when>
</choose> </choose>
<if test="name != null and name !=''"> <if test="name != null and name !=''">
SUBSTRING_INDEX( pp.`name`,'-',-1)=#{name} and pp.`name` like CONCAT('%',#{name}, '%')
</if> </if>
</where>
GROUP BY
ppo.point_no
ORDER BY ORDER BY
pptd.create_date DESC pptd.create_date DESC
) a ) a
GROUP BY
pointNum
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</select> </select>
......
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