Commit d8668a91 by wuchengwu

设备监控管理查询sql优化,调整排序

parent bbc568c4
......@@ -109,5 +109,5 @@ public interface SysClientVpMapper {
* @param ip
* @return
*/
String getmcjsj(String ip);
String getMCjsj(String ip);
}
\ No newline at end of file
......@@ -335,7 +335,7 @@ public class SysClientVpServiceImpl implements SysClientVpService {
@Override
public String getmcjsj(String ip) {
String getMCjsj = sysClientVpMapper.getmcjsj(ip);
String getMCjsj = sysClientVpMapper.getMCjsj(ip);
return getMCjsj;
}
}
......@@ -8,10 +8,12 @@ import com.founder.ryswtz.controller.CommonController;
import com.founder.service.AutoTbXwRycjService;
import com.founder.service.IParamService;
import com.founder.service.ISwCjService;
import com.founder.service.XzxtcxService;
import com.founder.utils.EasyuiPage;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
......@@ -33,6 +35,8 @@ import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.*;
import static com.founder.model.Constant.USER_LEVEL_CX;
/**
* 声纹采集Controller
* @author www
......@@ -43,9 +47,13 @@ public class SwCjController {
private static Log log = LogFactory.getLog(SwCjController.class);
@Autowired
private ISwCjService swCjService;
/**
* 文件下载路径
*/
@Value("${wjxzlj}")
private String wjxzlj;
@Autowired
private IDicItemService dicItemService;
private XzxtcxService xzxtcxService;
@Autowired
private IParamService paramService;
......@@ -195,8 +203,9 @@ private static Log log = LogFactory.getLog(SwCjController.class);
int swcnt = swCjService.getSwSjXxCnt(rybhstr);
//List<TbStSw> tbStSws = swCjService.getSwSjXxList(rybhstr);
String savePath = "/personphoto/" + rybhstr.substring(rybhstr.length() - 10, rybhstr.length() - 4) + "/" + rybhstr.substring(rybhstr.length() - 3, rybhstr.length());
Param param = paramService.getParamById("0100");
String zplj = param.getParamvalue();
// Param param = paramService.getParamById("0100");
// String zplj = param.getParamvalue();
String zplj = wjxzlj;
String filePath = zplj;
filePath = filePath + savePath;
File filejia0 = new File(filePath);
......@@ -449,8 +458,9 @@ private static Log log = LogFactory.getLog(SwCjController.class);
int swcnt = swCjService.getSwSjXxCnt(rybhstr);
//List<TbStSw> tbStSws = swCjService.getSwSjXxList(rybhstr);
String savePath = "/personphoto/" + rybhstr.substring(rybhstr.length() - 10, rybhstr.length() - 4) + "/" + rybhstr.substring(rybhstr.length() - 3, rybhstr.length());
Param param = paramService.getParamById("0100");
String zplj = param.getParamvalue();
// Param param = paramService.getParamById("0100");
// String zplj = param.getParamvalue();
String zplj = wjxzlj;
String filePath = zplj;
filePath = filePath + savePath;
File filejia0 = new File(filePath);
......@@ -476,8 +486,13 @@ private static Log log = LogFactory.getLog(SwCjController.class);
@PostMapping("/getSwDetail")
@ResponseBody
public Map getSwDetail(String asjxgrybh){
List<TbStSw> tbStSws = swCjService.getSwSjXxList(asjxgrybh);
public Map getSwDetail(String asjxgrybh,String type){
List<TbStSw> tbStSws = new ArrayList<>();
if (USER_LEVEL_CX.equals(type)) {
tbStSws = xzxtcxService.getSwSjXxList(asjxgrybh);
}else {
tbStSws = swCjService.getSwSjXxList(asjxgrybh);
}
CommonController commonController = new CommonController();
TbStSw swzh = new TbStSw();
//表头数据展示
......@@ -682,8 +697,9 @@ private static Log log = LogFactory.getLog(SwCjController.class);
int swcnt = swCjService.getSwSjXxCnt(rybhstr);
//List<TbStSw> tbStSws = swCjService.getSwSjXxList(rybhstr);
String savePath = "/personphoto/" + rybhstr.substring(rybhstr.length() - 10, rybhstr.length() - 4) + "/" + rybhstr.substring(rybhstr.length() - 3, rybhstr.length());
Param param = paramService.getParamById("0100");
String zplj = param.getParamvalue();
// Param param = paramService.getParamById("0100");
// String zplj = param.getParamvalue();
String zplj = wjxzlj;
String filePath = zplj;
filePath = filePath + savePath;
File filejia0 = new File(filePath);
......@@ -774,8 +790,9 @@ private static Log log = LogFactory.getLog(SwCjController.class);
FileInputStream ips = null;
String savePath = "/personphoto/" + rybh.substring(rybh.length() - 10, rybh.length() - 4) + "/" + rybh.substring(rybh.length() - 3, rybh.length());
Param param = paramService.getParamById("0100");
String zplj = param.getParamvalue();
// Param param = paramService.getParamById("0100");
// String zplj = param.getParamvalue();
String zplj = wjxzlj;
String filePath = zplj;
filePath = filePath + savePath;
File filejia0 = new File(filePath);
......@@ -828,8 +845,9 @@ private static Log log = LogFactory.getLog(SwCjController.class);
boolean bool = swCjService.deleteSwxx(xxzjbh);
if(bool){
String savePath = "/personphoto/" + rybh.substring(rybh.length() - 10, rybh.length() - 4) + "/" + rybh.substring(rybh.length() - 3, rybh.length());
Param param = paramService.getParamById("0100");
String zplj = param.getParamvalue();
// Param param = paramService.getParamById("0100");
// String zplj = param.getParamvalue();
String zplj = wjxzlj;
String filePath = zplj;
filePath = filePath + savePath;
File filejia0 = new File(filePath);
......
......@@ -248,7 +248,7 @@
,YHKXSF_LXDH as yhkxsfLxdh
,DNAXSF_LXDH as dnaxsfLxdh
,YTHCJXSF_LXDH as ythcjxsfLxdh
,to_char(dqsj,'yyyy-mm-dd') dqsjStr
</sql>
<sql id="queryWhere" >
......@@ -338,7 +338,15 @@
nvl(ry.zjcjs, 0) as zjcjs,
nvl(ry.swcjs, 0) as swcjs,
nvl(ry.sjycs, 0) as sjycs
FROM Sys_Client_Vp vp
FROM (select pp.*, substr((select utl_raw.cast_to_varchar2(utl_encode.base64_decode(
utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(
utl_encode.base64_decode(utl_raw.cast_to_raw(pp.IP)))))) as ip
from dual), 1, instr((select utl_raw.cast_to_varchar2(
utl_encode.base64_decode(
utl_raw.cast_to_raw(
utl_raw.cast_to_varchar2(
utl_encode.base64_decode(utl_raw.cast_to_raw(pp.IP)))))) as ip
from dual), '{') - 1) as ips from Sys_Client_Vp pp where pp.scbz ='0' order by ip) vp
left join (select IP,
count(*) as ycs,
sum(HM) as hmcjs,
......@@ -363,18 +371,11 @@
and (ifhb is null or ifhb <![CDATA[<>]]> '1')
<if test="maxlrsjStr != null and maxlrsjStr != ''">and LRSJ <![CDATA[<]]> to_date(#{maxlrsjStr , jdbcType=VARCHAR },'YYYY-MM-DD')+1</if>
<if test="minlrsjStr != null and minlrsjStr != ''">and LRSJ <![CDATA[>=]]> to_date(#{minlrsjStr , jdbcType=VARCHAR },'YYYY-MM-DD')</if>
order by lrsj desc ,IP
)
group by ip) ry on
substr((select utl_raw.cast_to_varchar2(utl_encode.base64_decode(
utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(
utl_encode.base64_decode(utl_raw.cast_to_raw(vp.IP)))))) as ip
from dual), 1, instr((select utl_raw.cast_to_varchar2(
utl_encode.base64_decode(
utl_raw.cast_to_raw(
utl_raw.cast_to_varchar2(
utl_encode.base64_decode(utl_raw.cast_to_raw(vp.IP)))))) as ip
from dual), '{') - 1) = ry.IP
where vp.SCBZ='0'
vp.ips = ry.IP
where 1=1
<if test="ip!=null and ip !=''">AND vp.ip = #{ip}</if>
<if test="spzt!=null and spzt !=''">AND vp.spzt = #{spzt}</if>
<if test="ssdwcode!=null and ssdwcode !=''">AND vp.SSDW_CODE like #{ssdwcode}||'%'</if>
......@@ -391,9 +392,9 @@
<if test="zjcjycode!=null and zjcjycode !=''">AND vp.ZJCJY_CODE = #{zjcjycode}</if>
<if test="hmcjycode!=null and hmcjycode !=''">AND vp.HMCJY_CODE = #{hmcjycode}</if>
<if test="swcjycode!=null and swcjycode !=''">AND vp.SWCJY_CODE = #{swcjycode}</if>
order by rylrsj desc
) A
where ROWNUM <![CDATA[ <= ]]> ${end}
order by A.SPZT, A.rylrsj desc
)
WHERE RN <![CDATA[ >= ]]> ${begin}
</select>
......@@ -1040,7 +1041,7 @@
from dual)
</sql>
<select id="ClientYlist" parameterType="java.lang.String" resultMap="BaseResultMap">
<select id="clientYlist" parameterType="java.lang.String" resultMap="BaseResultMap">
select b.month yysjstr,decode(sl,'',0,sl) yycsstr from
( <include refid="cyxj"/> ) a,
( <include refid="dnyf"/>) b where a.mo(+) = b.month order by b.month
......
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