Commit ada3b161 authored by tangwei's avatar tangwei

点状态,更新

parent a85fe42f
package com.yeejoin.amos.bank.controller; package com.yeejoin.amos.bank.controller;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.yeejoin.amos.bank.service.InspectionService; import com.yeejoin.amos.bank.service.InspectionService;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.op.core.common.response.CommonResponse; import com.yeejoin.amos.op.core.common.response.CommonResponse;
import com.yeejoin.amos.op.core.util.CommonResponseUtil; import com.yeejoin.amos.op.core.util.CommonResponseUtil;
import com.yeejoin.amos.spc.business.controller.BaseController; import com.yeejoin.amos.spc.business.controller.BaseController;
import com.yeejoin.amos.spc.business.param.ReginParams; import com.yeejoin.amos.spc.business.param.ReginParams;
import com.yeejoin.amos.spc.business.remote.RemoteSecurityService; import com.yeejoin.amos.spc.business.remote.RemoteSecurityService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
/** /**
* 巡检controller * 巡检controller
* @author DELL * @author DELL
* *
*/ */
@RestController @RestController
@RequestMapping(value = "/bank/inspection") @RequestMapping(value = "/bank/inspection")
@Api(value = "/bank/inspection", tags = {"巡检API"}) @Api(value = "/bank/inspection", tags = {"巡检API"})
public class InspectionController extends BaseController{ public class InspectionController extends BaseController{
@Autowired @Autowired
private InspectionService inspectionService; private InspectionService inspectionService;
@Autowired @Autowired
RemoteSecurityService remoteSecurityService; RemoteSecurityService remoteSecurityService;
@GetMapping(value = "/rightTopChart", produces = "application/json;charset=UTF-8") @GetMapping(value = "/rightTopChart", produces = "application/json;charset=UTF-8")
@ApiOperation(value = "查询主页右上角图片", notes = "查询主页右上角图片") @ApiOperation(value = "查询主页右上角图片", notes = "查询主页右上角图片")
public CommonResponse rightTopChartData(@ApiParam(value = "公司id", required = false)String companyId) { public CommonResponse rightTopChartData(@ApiParam(value = "公司id", required = false)String companyId) {
// if(companyId == null || "".equals(companyId)) { // if(companyId == null || "".equals(companyId)) {
// ReginParams reginParams = getSelectedOrgInfo(); // ReginParams reginParams = getSelectedOrgInfo();
// companyId = getCompanyId(reginParams); // companyId = getCompanyId(reginParams);
// //
// return CommonResponseUtil.failure(); // return CommonResponseUtil.failure();
// } // }
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
companyId = getCompanyId(reginParams); companyId = getCompanyId(reginParams);
return CommonResponseUtil.success(inspectionService.queryRightTopChart(companyId)); return CommonResponseUtil.success(inspectionService.queryRightTopChart(companyId));
} }
@GetMapping(value = "/bottomTable", produces = "application/json;charset=UTF-8") @GetMapping(value = "/bottomTable", produces = "application/json;charset=UTF-8")
@ApiOperation(value = "查询主页右下角table", notes = "查询主页右下角table") @ApiOperation(value = "查询主页右下角table", notes = "查询主页右下角table")
public CommonResponse bottomTableData() { public CommonResponse bottomTableData() {
return CommonResponseUtil.success(inspectionService.queryBottomTableData()); return CommonResponseUtil.success(inspectionService.queryBottomTableData());
} }
@ApiOperation(value = "巡检计划执行情况列表", notes = "巡检计划执行情况列表") @ApiOperation(value = "巡检计划执行情况列表", notes = "巡检计划执行情况列表")
@GetMapping(value = "/patrolPlanList") @GetMapping(value = "/patrolPlanList")
public CommonResponse patrolPlanList(@ApiParam(value = "当前条数", required = true) @RequestParam Integer start, public CommonResponse patrolPlanList(@ApiParam(value = "当前条数", required = true) @RequestParam Integer start,
@ApiParam(value = "到条数", required = true) @RequestParam Integer end, @ApiParam(value = "到条数", required = true) @RequestParam Integer end,
@ApiParam(value = "部门编号") @RequestParam(required = false) String deptId, @ApiParam(value = "部门编号") @RequestParam(required = false) String deptId,
@ApiParam(value = "部门编号") @RequestParam(required = false) String deptName) { @ApiParam(value = "部门编号") @RequestParam(required = false) String deptName) {
try { try {
return CommonResponseUtil.success(inspectionService.queryRightTopChartlist(start, end, deptId,deptName)); return CommonResponseUtil.success(inspectionService.queryRightTopChartlist(start, end, deptId,deptName));
} catch (Exception e) { } catch (Exception e) {
return CommonResponseUtil.failure("查询异常"); return CommonResponseUtil.failure("查询异常");
} }
} }
@GetMapping(value = "/getporint", produces = "application/json;charset=UTF-8") @GetMapping(value = "/getporint", produces = "application/json;charset=UTF-8")
@ApiOperation(value = "点的状态", notes = "点的状态") @ApiOperation(value = "点的状态", notes = "点的状态")
public CommonResponse getporint(@ApiParam(value = "公司id", required = false)String pointid) { public CommonResponse getporint(@ApiParam(value = "公司id", required = false)String pointid) {
java.util.HashMap<String, Object> map=inspectionService.getporint(pointid); java.util.HashMap<String, Object> map=inspectionService.getporint(pointid);
List<DictionarieValueModel> listDictionaryByDictCode = remoteSecurityService.listDictionaryByDictCode("BANK_ORG"); List<DictionarieValueModel> listDictionaryByDictCode = remoteSecurityService.listDictionaryByDictCode("BANK_ORG");
String xian=""; String xian="";
String xianyang=""; String xianyang="";
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (DictionarieValueModel e : listDictionaryByDictCode) { for (DictionarieValueModel e : listDictionaryByDictCode) {
if("xian".equals(e.getDictDataKey())) { if("xian".equals(e.getDictDataKey())) {
xian=e.getDictDataValue(); xian=e.getDictDataValue();
} }
if("xianyang".equals(e.getDictDataKey())) { if("xianyang".equals(e.getDictDataKey())) {
xianyang=e.getDictDataValue(); xianyang=e.getDictDataValue();
} }
} }
java.util.HashMap<String, Object> map1 =new java.util.HashMap<>(); java.util.HashMap<String, Object> map1 =new java.util.HashMap<>();
if(map!=null){ if(map!=null){
int status= Integer.valueOf(map.get("status").toString()); int status= Integer.valueOf(map.get("status").toString());
String code= map.get("code").toString(); String code= map.get("code").toString();
if(status==2){ if(status==1){
map1.put("pointtype", true); map1.put("pointtype", true);
}else{ }else{
map1.put("pointtype",false ); map1.put("pointtype",false );
} }
if (code.indexOf(xian)!=-1){ if (code.indexOf(xian)!=-1){
map1.put("cstype","xian" ); map1.put("cstype","xian" );
} }
if (code.indexOf(xianyang)!=-1){ if (code.indexOf(xianyang)!=-1){
map1.put("cstype","xianyang" ); map1.put("cstype","xianyang" );
} }
} }
return CommonResponseUtil.success(map1); return CommonResponseUtil.success(map1);
} }
} }
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.spc.business.dao.mapper.StatisticsMapper"> <mapper namespace="com.yeejoin.amos.spc.business.dao.mapper.StatisticsMapper">
<select id="queryForRiseUp" resultType="java.util.Map"> <select id="queryForRiseUp" resultType="java.util.Map">
select select
d.countOfType0, d.countOfType0,
d.countOfSource, d.countOfSource,
CONCAT(ROUND(IFNULL(d.countOfType0/d.countOfSource,0)*100,2),'%') as type0Rate CONCAT(ROUND(IFNULL(d.countOfType0/d.countOfSource,0)*100,2),'%') as type0Rate
from from
( (
select select
count(distinct cl.risk_factors_id) as countOfType0, count(distinct cl.risk_factors_id) as countOfType0,
(select count(1) from spc_risk_factors rs) as countOfSource (select count(1) from spc_risk_factors rs) as countOfSource
from from
spc_risk_factors_level_log as cl spc_risk_factors_level_log as cl
where where
cl.type = 1 cl.type = 1
and and
cl.create_date between '${startTime}' and '${endTime}' cl.create_date between '${startTime}' and '${endTime}'
) as d ) as d
</select> </select>
<select id="riskSourceBroupByDepartment" resultType="java.util.Map"> <select id="riskSourceBroupByDepartment" resultType="java.util.Map">
select select
count(b.code = '1' or null) as '1级', count(b.code = '1' or null) as '1级',
count(b.code = '2' or null) as '2级', count(b.code = '2' or null) as '2级',
count(b.code = '3' or null) as '3级', count(b.code = '3' or null) as '3级',
count(b.code = '4' or null) as '4级', count(b.code = '4' or null) as '4级',
a.belong_department_id as belongDepartmentId, a.belong_department_id as belongDepartmentId,
b.level, b.level,
b.code b.code
from from
spc_risk_source as a spc_risk_source as a
left join left join
spc_risk_level as b on a.risk_level = b.id spc_risk_level as b on a.risk_level = b.id
where where
a.risk_type = '04' a.risk_type = '04'
and and
a.belong_department_id is not null a.belong_department_id is not null
and and
a.belong_department_id != "" a.belong_department_id != ""
group by a.belong_department_id group by a.belong_department_id
</select> </select>
<select id="latentDangerBroupByDepartment" resultType="java.util.Map"> <select id="latentDangerBroupByDepartment" resultType="java.util.Map">
select select
count(c.danger_level = 1 or null) as '一般隐患', count(c.danger_level = 1 or null) as '一般隐患',
count(c.danger_level = 2 or null) as '重大隐患', count(c.danger_level = 2 or null) as '重大隐患',
a.belong_department_id as belongDepartmentId a.belong_department_id as belongDepartmentId
from from
spc_risk_source as a spc_risk_source as a
left join left join
p_point as b on b.original_id = a.id p_point as b on b.original_id = a.id
left join left join
( (
select select
a.*,b.point_id a.*,b.point_id
from from
p_latent_danger as a p_latent_danger as a
inner join inner join
p_latent_danger_patrol as b on a.id = b.latent_danger_id p_latent_danger_patrol as b on a.id = b.latent_danger_id
where where
a.danger_type in (2,3) a.danger_type in (2,3)
and a.danger_state in (2,3,4) and a.danger_state in (2,3,4)
) as c on c.point_id = b.id ) as c on c.point_id = b.id
where where
a.belong_department_id is not null a.belong_department_id is not null
and and
a.belong_department_id != "" a.belong_department_id != ""
and and
a.risk_type = '04' a.risk_type = '04'
group by a.belong_department_id group by a.belong_department_id
</select> </select>
<select id="latentDangerRateGroupByDepartment" resultType="java.util.Map"> <select id="latentDangerRateGroupByDepartment" resultType="java.util.Map">
select select
count(c.id) as dangerCount, count(c.id) as dangerCount,
a.belong_department_id as belongDepartmentId a.belong_department_id as belongDepartmentId
from from
spc_risk_source as a spc_risk_source as a
left join left join
p_point as b on b.original_id = a.id p_point as b on b.original_id = a.id
left join left join
( (
select select
a.*,b.point_id a.*,b.point_id
from from
p_latent_danger as a p_latent_danger as a
inner join inner join
p_latent_danger_patrol as b on a.id = b.latent_danger_id p_latent_danger_patrol as b on a.id = b.latent_danger_id
where where
a.danger_type in (2,3) a.danger_type in (2,3)
and a.danger_state in (2,3,4) and a.danger_state in (2,3,4)
and a.overtime_state = 1 and a.overtime_state = 1
) as c on c.point_id = b.id ) as c on c.point_id = b.id
where where
a.belong_department_id is not null a.belong_department_id is not null
and and
a.belong_department_id != "" a.belong_department_id != ""
and and
a.risk_type = '04' a.risk_type = '04'
group by a.belong_department_id group by a.belong_department_id
</select> </select>
<select id="listPatrolPlan" resultType="java.util.Map"> <select id="listPatrolPlan" resultType="java.util.Map">
select select
a.id as planTaskId, a.id as planTaskId,
a.user_id as userId, a.user_id as userId,
b.name as planName, b.name as planName,
b.dept_id as deptId, b.dept_id as deptId,
(select count(1) from p_plan_task_detail where task_no = a.id and status = 0) as noStartNum, (select count(1) from p_plan_task_detail where task_no = a.id and status = 0) as noStartNum,
(select count(1) from p_plan_task_detail where task_no = a.id and status = 1) as passNum, (select count(1) from p_plan_task_detail where task_no = a.id and status = 1) as passNum,
(select count(1) from p_plan_task_detail where task_no = a.id and status = 2) as noPassNum, (select count(1) from p_plan_task_detail where task_no = a.id and status = 2) as noPassNum,
(select count(1) from p_plan_task_detail where task_no = a.id and status = 3) as overTimeNum (select count(1) from p_plan_task_detail where task_no = a.id and status = 3) as overTimeNum
from from
p_plan_task as a p_plan_task as a
left join left join
p_plan as b on a.plan_id = b.id p_plan as b on a.plan_id = b.id
<where> <where>
<if test="true"> <if test="true">
and a.begin_time &lt;= now() and a.begin_time &lt;= now()
</if> </if>
<if test="true"> <if test="true">
and a.end_time &gt;= now() and a.end_time &gt;= now()
</if> </if>
<if test="deptId != null and deptId != ''"> <if test="deptId != null and deptId != ''">
and find_in_set(#{deptId},b.dept_id) and find_in_set(#{deptId},b.dept_id)
</if> </if>
</where> </where>
group by b.id group by b.id
<if test="offset != null and limit != null"> <if test="offset != null and limit != null">
limit #{offset},#{limit} limit #{offset},#{limit}
</if> </if>
</select> </select>
<select id="countPatrolPlan" resultType="java.lang.Long"> <select id="countPatrolPlan" resultType="java.lang.Long">
select count(1) from ( select count(1) from (
select select
a.id a.id
from from
p_plan_task as a p_plan_task as a
left join left join
p_plan as b on a.plan_id = b.id p_plan as b on a.plan_id = b.id
<where> <where>
<if test="true"> <if test="true">
and a.begin_time &lt;= now() and a.begin_time &lt;= now()
</if> </if>
<if test="true"> <if test="true">
and a.end_time &gt;= now() and a.end_time &gt;= now()
</if> </if>
<if test="deptId != null and deptId != ''"> <if test="deptId != null and deptId != ''">
and find_in_set(#{deptId},b.dept_id) and find_in_set(#{deptId},b.dept_id)
</if> </if>
</where> </where>
group by b.id group by b.id
) tmp ) tmp
</select> </select>
<select id="listByTaskNo" resultType="java.util.Map"> <select id="listByTaskNo" resultType="java.util.Map">
select select
a.task_no as planTaskId, a.task_no as planTaskId,
a.point_id as pointId, a.point_id as pointId,
a.status as status, a.status as status,
b.name as pointName b.name as pointName
from from
p_plan_task_detail as a p_plan_task_detail as a
left join left join
p_point as b on a.point_id = b.id p_point as b on a.point_id = b.id
where where
task_no in task_no in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")"> <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</select> </select>
<select id="queryRightTopChartDataByDepId" resultType="java.util.HashMap"> <select id="queryRightTopChartDataByDepId" resultType="java.util.HashMap">
<!-- select sum(tmp2.passNum) as passNum,sum(tmp2.nopassNum) as nopassNum,sum(tmp2.overTime) as overTime,dept_id as deptId <!-- select sum(tmp2.passNum) as passNum,sum(tmp2.nopassNum) as nopassNum,sum(tmp2.overTime) as overTime,dept_id as deptId
from from
(select (select
if(tmp.status=1,1,0) as passNum, if(tmp.status=1,1,0) as passNum,
if(tmp.status=2,1,0) as nopassNum, if(tmp.status=2,1,0) as nopassNum,
if(tmp.status=3,1,0) as overTime, if(tmp.status=3,1,0) as overTime,
tmp.dept_id tmp.dept_id
from ( from (
select D.point_id,D.status,P.dept_id select D.point_id,D.status,P.dept_id
from p_plan_task_detail D from p_plan_task_detail D
left join p_plan_task T on D.task_no = T.id left join p_plan_task T on D.task_no = T.id
left join p_plan P on P.id = T.plan_id left join p_plan P on P.id = T.plan_id
where D.id in (select max(id) from p_plan_task_detail group by point_id) where D.id in (select max(id) from p_plan_task_detail group by point_id)
AND T.end_time &lt; NOW() AND T.end_time &lt; NOW()
AND P.dept_id IS NOT NULL) tmp AND P.dept_id IS NOT NULL) tmp
where tmp.dept_id IN where tmp.dept_id IN
<foreach collection="list" item="item" index="index" open="(" separator="," close=")"> <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
) tmp2 group by tmp2.dept_id --> ) tmp2 group by tmp2.dept_id -->
<!-- select <!-- select
sum(tmp2.passNum) as passNum,sum(tmp2.nopassNum) as nopassNum,sum(tmp2.overTime) as overTime,dept_id as deptId,tmp2.name,tmp2.beginTime,tmp2.endTime sum(tmp2.passNum) as passNum,sum(tmp2.nopassNum) as nopassNum,sum(tmp2.overTime) as overTime,dept_id as deptId,tmp2.name,tmp2.beginTime,tmp2.endTime
from from
(select (select
if(tmp.status=1,1,0) as passNum, if(tmp.status=1,1,0) as passNum,
if(tmp.status=2,1,0) as nopassNum, if(tmp.status=2,1,0) as nopassNum,
if(IFNULL(tmp.status,3)=3,1,0) as overTime, if(IFNULL(tmp.status,3)=3,1,0) as overTime,
tmp.dept_id, tmp.dept_id,
tmp.name, tmp.name,
tmp.begin_time as beginTime, tmp.begin_time as beginTime,
tmp.end_time as endTime tmp.end_time as endTime
from ( from (
select pl.id,D.point_id,D.status,R.dept_id,R.name,pl.begin_time,pl.end_time select pl.id,D.point_id,D.status,R.dept_id,R.name,pl.begin_time,pl.end_time
from P_plan_task pl from P_plan_task pl
left join p_plan_task_detail D ON D.task_no = pl.id left join p_plan_task_detail D ON D.task_no = pl.id
left join p_route_point p on D.point_id = P.point_id left join p_route_point p on D.point_id = P.point_id
left join p_route R on R.id = P.route_id left join p_route R on R.id = P.route_id
left join P_plan_task T on T.id = D.task_no left join P_plan_task T on T.id = D.task_no
left join p_plan N on N.id = pl.plan_id left join p_plan N on N.id = pl.plan_id
where pl.Finish_Status in(2,3) AND R.dept_id = #{deptId} where pl.Finish_Status in(2,3) AND R.dept_id = #{deptId}
AND N.status = 1 AND N.status = 1
AND pl.end_time = CURRENT_DATE AND pl.end_time = CURRENT_DATE
order by pl.id DESC limit 1 order by pl.id DESC limit 1
) tmp ) tmp
) tmp2 group by name,tmp2.beginTime,tmp2.endTime --> ) tmp2 group by name,tmp2.beginTime,tmp2.endTime -->
select select
<!-- SUBSTRING_INDEX(org_code, "-", -1)deptId, <!-- SUBSTRING_INDEX(org_code, "-", -1)deptId,
--> MAX(CASE a.finish_status WHEN 0 THEN a.NUM ELSE 0 END ) noStartNum, --> MAX(CASE a.finish_status WHEN 0 THEN a.NUM ELSE 0 END ) noStartNum,
MAX(CASE a.finish_status WHEN 1 THEN a.NUM ELSE 0 END ) noPassNum, MAX(CASE a.finish_status WHEN 1 THEN a.NUM ELSE 0 END ) noPassNum,
MAX(CASE a.finish_status WHEN 2 THEN a.NUM ELSE 0 END ) passNum, MAX(CASE a.finish_status WHEN 2 THEN a.NUM ELSE 0 END ) passNum,
MAX(CASE a.finish_status WHEN 3 THEN a.NUM ELSE 0 END ) overTimeNum MAX(CASE a.finish_status WHEN 3 THEN a.NUM ELSE 0 END ) overTimeNum
from ( select from ( select
COUNT(*) NUM, COUNT(*) NUM,
l.finish_status, l.finish_status,
l.org_code l.org_code
from p_plan_task as l where DATE_FORMAT(l.begin_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d') from p_plan_task as l where DATE_FORMAT(l.begin_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
and l.org_code like CONCAT(#{deptId},"%") GROUP BY l.finish_status) a and l.org_code like CONCAT(#{deptId},"%") GROUP BY l.finish_status) a
</select> </select>
<resultMap id="planTaskReturn" type="com.yeejoin.amos.bank.entity.planTaskReturn"> <resultMap id="planTaskReturn" type="com.yeejoin.amos.bank.entity.planTaskReturn">
<id column="planTaskId" property="planTaskId"/> <id column="planTaskId" property="planTaskId"/>
<result column="userId" property="userId"/> <result column="userId" property="userId"/>
<result column="planName" property="planName"/> <result column="planName" property="planName"/>
<result column="deptId" property="deptId"/> <result column="deptId" property="deptId"/>
<result column="noStartNum" property="noStartNum"/> <result column="noStartNum" property="noStartNum"/>
<result column="passNum" property="passNum"/> <result column="passNum" property="passNum"/>
<result column="noPassNum" property="noPassNum"/> <result column="noPassNum" property="noPassNum"/>
<result column="overTimeNum" property="overTimeNum"/> <result column="overTimeNum" property="overTimeNum"/>
<result column="beginTime" property="beginTime"/> <result column="beginTime" property="beginTime"/>
<result column="endTime" property="endTime"/> <result column="endTime" property="endTime"/>
</resultMap> </resultMap>
<resultMap id="pointReturn" type="com.yeejoin.amos.bank.entity.pointReturn"> <resultMap id="pointReturn" type="com.yeejoin.amos.bank.entity.pointReturn">
<id property="taskNo" column="taskNo"></id> <id property="taskNo" column="taskNo"></id>
<result property="isFinish" column="isFinish"/> <result property="isFinish" column="isFinish"/>
<result property="name" column="name"/> <result property="name" column="name"/>
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="coordinates" column="coordinates"/> <result property="coordinates" column="coordinates"/>
<result property="floor" column="floor"/> <result property="floor" column="floor"/>
</resultMap> </resultMap>
<select id="planTaskReturnliat" resultMap="planTaskReturn"> <select id="planTaskReturnliat" resultMap="planTaskReturn">
select select
a.id as planTaskId, a.id as planTaskId,
a.user_id as userId, a.user_id as userId,
CONCAT(a.id,"-",b.name) as planName, CONCAT(a.id,"-",b.name) as planName,
b.dept_id as deptId, b.dept_id as deptId,
a.begin_time beginTime, a.begin_time beginTime,
a.end_time endTime, a.end_time endTime,
(select count(1) from p_plan_task_detail where task_no = a.id and status = 0) as noStartNum, (select count(1) from p_plan_task_detail where task_no = a.id and status = 0) as noStartNum,
(select count(1) from p_plan_task_detail where task_no = a.id and status = 1) as passNum, (select count(1) from p_plan_task_detail where task_no = a.id and status = 1) as passNum,
(select count(1) from p_plan_task_detail where task_no = a.id and status = 2) as noPassNum, (select count(1) from p_plan_task_detail where task_no = a.id and status = 2) as noPassNum,
(select count(1) from p_plan_task_detail where task_no = a.id and status = 3) as overTimeNum (select count(1) from p_plan_task_detail where task_no = a.id and status = 3) as overTimeNum
from from
(select l.* from p_plan_task as l where DATE_FORMAT(l.begin_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d') and l.org_code like CONCAT(#{deptId},"%"))as a (select l.* from p_plan_task as l where DATE_FORMAT(l.begin_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d') and l.org_code like CONCAT(#{deptId},"%"))as a
left join left join
p_plan as b on a.plan_id = b.id p_plan as b on a.plan_id = b.id
group by a.id group by a.id
<if test="offset != null and limit != null"> <if test="offset != null and limit != null">
limit #{offset},#{limit} limit #{offset},#{limit}
</if> </if>
</select> </select>
<select id="pointReturnlist" resultMap="pointReturn"> <select id="pointReturnlist" resultMap="pointReturn">
select select
p_plan_task_detail.status isFinish , p_plan_task_detail.status isFinish ,
p_point.`name`, p_point.`name`,
p_point.id, p_point.id,
p_point.floor, p_point.floor,
p_point.coordinates, p_point.coordinates,
p_plan_task_detail.task_no taskNo p_plan_task_detail.task_no taskNo
from p_plan_task_detail LEFT JOIN p_point on p_plan_task_detail.point_id =p_point.id from p_plan_task_detail LEFT JOIN p_point on p_plan_task_detail.point_id =p_point.id
where p_plan_task_detail.task_no=#{planTaskId} ORDER BY p_plan_task_detail.id where p_plan_task_detail.task_no=#{planTaskId} ORDER BY p_plan_task_detail.id
</select> </select>
<select id="getporint" resultType="java.util.Map"> <select id="getporint" resultType="java.util.Map">
SELECT SELECT
p_point.org_code code, p_alarm_point.`code` code ,
p_point.status p_alarm_point.is_alarm status
from p_point where p_point.id=#{pointid}
from p_alarm_point where p_alarm_point.point_type=3 and p_alarm_point.is_alarm=1 and p_alarm_point.point_id=#{pointid}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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