bug修复
This commit is contained in:
parent
145e8d195f
commit
bc6a6594cf
7
src/main/java/com/zhgd/xmgl/constant/CommonConstant.java
Normal file
7
src/main/java/com/zhgd/xmgl/constant/CommonConstant.java
Normal file
@ -0,0 +1,7 @@
|
||||
package com.zhgd.xmgl.constant;
|
||||
|
||||
public interface CommonConstant {
|
||||
String ASC = "asc";
|
||||
String DESC = "desc";
|
||||
String ORDER = "order";
|
||||
}
|
||||
@ -592,7 +592,7 @@
|
||||
|
||||
</select>
|
||||
<select id="selectProjectTowerAlarmCountList" resultType="java.util.Map">
|
||||
SELECT count(1) alarmNum
|
||||
SELECT count(w1.id) alarmNum
|
||||
<if test="companyType == '1'.toString()">
|
||||
,f.company_name name,f.company_sn sn
|
||||
</if>
|
||||
@ -608,12 +608,16 @@
|
||||
<if test="companyType == '5'.toString()">
|
||||
,a.project_name name,a.project_sn sn
|
||||
</if>
|
||||
from tower_alarm w1 INNER JOIN project a ON w1.project_sn=a.project_sn
|
||||
from tower_alarm w1
|
||||
RIGHT JOIN project a ON w1.project_sn=a.project_sn and w1.add_time >=CONCAT(DATE_FORMAT(now(),"%Y-%m-%d"),'
|
||||
00:00:00') and w1.alarm_type=1
|
||||
<if test="companyType == '4'.toString()">
|
||||
and w1.project_sn=#{sn}
|
||||
</if>
|
||||
INNER JOIN company cp ON a.company_sn=cp.company_sn
|
||||
INNER JOIN company b ON cp.parent_id=b.company_id
|
||||
Left JOIN company f ON b.parent_id=f.company_id
|
||||
where w1.add_time >=CONCAT(DATE_FORMAT(now(),"%Y-%m-%d"),' 00:00:00')
|
||||
and w1.alarm_type=1
|
||||
where 1=1
|
||||
<if test="companyType == '1'.toString()">
|
||||
and f.headquarters_sn=#{sn}
|
||||
GROUP BY f.company_id
|
||||
@ -627,7 +631,6 @@
|
||||
GROUP BY cp.company_id
|
||||
</if>
|
||||
<if test="companyType == '4'.toString()">
|
||||
and w1.project_sn=#{sn}
|
||||
group by w1.project_sn
|
||||
</if>
|
||||
<if test="companyType == '5'.toString()">
|
||||
|
||||
@ -309,7 +309,7 @@
|
||||
|
||||
</select>
|
||||
<select id="selectProjectTowerViolationCountList" resultType="java.util.Map">
|
||||
SELECT count(1) violationNum
|
||||
SELECT count(w1.id) violationNum
|
||||
<if test="companyType == '1'.toString()">
|
||||
,f.company_name name,f.company_sn sn
|
||||
</if>
|
||||
@ -325,11 +325,16 @@
|
||||
<if test="companyType == '5'.toString()">
|
||||
,a.project_name name,a.project_sn sn
|
||||
</if>
|
||||
from tower_violation w1 INNER JOIN project a ON w1.project_sn=a.project_sn
|
||||
from tower_violation w1
|
||||
RIGHT JOIN project a ON w1.project_sn=a.project_sn and w1.violation_time
|
||||
>=CONCAT(DATE_FORMAT(now(),"%Y-%m-%d"),' 00:00:00')
|
||||
<if test="companyType == '4'.toString()">
|
||||
and w1.project_sn=#{sn}
|
||||
</if>
|
||||
INNER JOIN company cp ON a.company_sn=cp.company_sn
|
||||
INNER JOIN company b ON cp.parent_id=b.company_id
|
||||
Left JOIN company f ON b.parent_id=f.company_id
|
||||
where w1.violation_time >=CONCAT(DATE_FORMAT(now(),"%Y-%m-%d"),' 00:00:00')
|
||||
where 1=1
|
||||
<if test="companyType == '1'.toString()">
|
||||
and f.headquarters_sn=#{sn}
|
||||
GROUP BY f.company_id
|
||||
@ -343,7 +348,6 @@
|
||||
GROUP BY cp.company_id
|
||||
</if>
|
||||
<if test="companyType == '4'.toString()">
|
||||
and w1.project_sn=#{sn}
|
||||
group by w1.project_sn
|
||||
</if>
|
||||
<if test="companyType == '5'.toString()">
|
||||
|
||||
@ -220,7 +220,7 @@
|
||||
order by titleName
|
||||
</select>
|
||||
<select id="selectProjectTowerWorkCycleCountList" resultType="java.util.Map">
|
||||
SELECT count(1) cycleNum
|
||||
SELECT count(w1.id) cycleNum
|
||||
<if test="companyType == '1'.toString()">
|
||||
, f.company_name name
|
||||
, f.company_sn sn
|
||||
@ -242,11 +242,15 @@
|
||||
, a.project_sn sn
|
||||
</if>
|
||||
from tower_work_cycle w1
|
||||
INNER JOIN project a ON w1.project_sn = a.project_sn
|
||||
RIGHT JOIN project a ON w1.project_sn = a.project_sn AND w1.start_time >= CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'),
|
||||
' 00:00:00')
|
||||
<if test="companyType == '4'.toString()">
|
||||
and w1.project_sn=#{sn}
|
||||
</if>
|
||||
INNER JOIN company cp ON a.company_sn = cp.company_sn
|
||||
INNER JOIN company b ON cp.parent_id = b.company_id
|
||||
Left JOIN company f ON b.parent_id = f.company_id
|
||||
where w1.start_time >= CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' 00:00:00')
|
||||
where 1=1
|
||||
<if test="companyType == '1'.toString()">
|
||||
and f.headquarters_sn = #{sn}
|
||||
GROUP BY f.company_id
|
||||
@ -256,12 +260,10 @@
|
||||
GROUP BY b.company_id
|
||||
</if>
|
||||
<if test="companyType == '3'.toString()">
|
||||
|
||||
and b.company_sn=#{sn}
|
||||
GROUP BY cp.company_id
|
||||
</if>
|
||||
<if test="companyType == '4'.toString()">
|
||||
and w1.project_sn=#{sn}
|
||||
group by w1.project_sn
|
||||
</if>
|
||||
<if test="companyType == '5'.toString()">
|
||||
|
||||
@ -67,7 +67,8 @@ public class ElectricalDataController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "searchDate", value = "查询时间,格式yyyy-mm-dd", dataType = "String", paramType = "query", required = true),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "devSn", value = "设备唯一标识", dataType = "String", paramType = "query", required = true)
|
||||
@ApiImplicitParam(name = "devSn", value = "设备唯一标识", dataType = "String", paramType = "query", required = true),
|
||||
@ApiImplicitParam(name = "order", value = "asc:升序,desc:降序", dataType = "String", paramType = "query", required = false),
|
||||
})
|
||||
@PostMapping(value = "/selectElectricalDataList")
|
||||
public Result<List<ElectricalData>> selectElectricalDataList(@RequestBody Map<String,Object> map) {
|
||||
|
||||
@ -17,6 +17,9 @@
|
||||
and upload_time >= CONCAT(DATE_FORMAT(#{searchDate}, '%Y-%m-%d'), ' 00:00:00')
|
||||
and upload_time <= CONCAT(DATE_FORMAT(#{searchDate}, '%Y-%m-%d'), ' 23:59:59')
|
||||
ORDER BY upload_time
|
||||
<if test="order == null or order == '' or order == 'desc'">
|
||||
desc
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectElectricalDataPage" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT a.*, b.dev_name
|
||||
|
||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.constant.CommonConstant;
|
||||
import com.zhgd.xmgl.modules.electrical.entity.ElectricalData;
|
||||
import com.zhgd.xmgl.modules.electrical.entity.ElectricalDev;
|
||||
import com.zhgd.xmgl.modules.electrical.mapper.ElectricalDataMapper;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user