Commit 33bc90d0 authored by litengwei's avatar litengwei

省测卡片问题

parent 22f17c7e
......@@ -2038,6 +2038,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
int xcdw = 0;
int hgdw = 0;
int lcdw = 0;
int zxcdw = 0;
for (Map<String, Object> map : statics
) {
if(map.get("code").equals("xfxcjrljxcdw")) {
......@@ -2049,6 +2050,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if(map.get("code").equals("xfxcjrlcdw")) {
lcdw = Integer.parseInt(map.get("value").toString());
}
if(map.get("code").equals("xfxcjrzxcdw")) {
zxcdw = Integer.parseInt(map.get("value").toString());
}
}
if(xcdw == 0) {
for (Map<String, Object> map : statics
......@@ -2056,9 +2060,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if(map.get("code").equals("xfxchgzb")) {
map.put("value","0");
}
if(map.get("code").equals("xfxclcl")) {
map.put("value","0");
}
}
} else {
for (Map<String, Object> map : statics
......@@ -2066,8 +2067,20 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if(map.get("code").equals("xfxchgzb")) {
map.put("value",String.valueOf((hgdw / xcdw)*100));
}
}
}
if(zxcdw == 0) {
for (Map<String, Object> map : statics
) {
if(map.get("code").equals("xfxclcl")) {
map.put("value","0");
}
}
} else {
for (Map<String, Object> map : statics
) {
if(map.get("code").equals("xfxclcl")) {
map.put("value",String.valueOf((lcdw / xcdw)*100) );
map.put("value",String.valueOf((lcdw / zxcdw)*100) );
}
}
}
......
......@@ -5967,8 +5967,8 @@
<select id="selectCarStats" resultType="java.util.Map">
SELECT
COUNT(*) AS totalCount,
0 AS yellowCodeCount,
0 AS redCodeCount
SUM(CASE WHEN wc.status = 1 then 1 else 0 end ) AS yellowCodeCount,
SUM(CASE WHEN wc.status = 2 then 1 else 0 end ) AS redCodeCount
FROM
wl_car wc
LEFT JOIN wl_equipment wle ON wle.id = wc.equipment_id
......
......@@ -1359,6 +1359,19 @@
<select id="getStatics" resultType="java.util.Map">
SELECT
'0' AS `key`,
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'' AS unit,
'今日总巡查点位' AS `name`,
'xfxcjrzxcdw' AS code
FROM
`p_plan_task`
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
SELECT
'1' AS `key`,
ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`,
'' AS unit,
......
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