46 changed files with 1393 additions and 215 deletions
@ -0,0 +1,37 @@ |
|||
package com.kms.yg.sz.domain.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class AqrwDto { |
|||
|
|||
|
|||
private String adcdName; |
|||
|
|||
|
|||
private int total; |
|||
|
|||
private int zeroNum; |
|||
|
|||
private int oneNum; |
|||
|
|||
private int twoNum; |
|||
|
|||
private int threeNum; |
|||
|
|||
private int one; |
|||
|
|||
private int two; |
|||
|
|||
private int three; |
|||
|
|||
private String rate; |
|||
|
|||
public void setTotal() { |
|||
this.total = this.zeroNum+this.oneNum+this.twoNum+this.threeNum; |
|||
} |
|||
|
|||
public void setRate() { |
|||
this.rate = String.valueOf(this.threeNum/this.total); |
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.kms.yg.sz.domain.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class HistogramDto { |
|||
|
|||
private HashMap<String, List<String>> map; |
|||
|
|||
} |
@ -0,0 +1,11 @@ |
|||
package com.kms.yg.sz.domain.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class NumDto { |
|||
|
|||
private String name; |
|||
|
|||
private int num; |
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.kms.yg.sz.domain.dto; |
|||
|
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class PieDto { |
|||
|
|||
private String name; |
|||
|
|||
private String num; |
|||
|
|||
private String status; |
|||
|
|||
private String type; |
|||
} |
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.kms.system.mapper.SysXzqhMapper"> |
|||
|
|||
<!--<resultMap type="SysXzqh" id="SysXzqh"> |
|||
<result property="name" column="name" /> |
|||
<result property="xzqhdm" column="XZQHDM" /> |
|||
<result property="num" column="num"/> |
|||
</resultMap> |
|||
|
|||
<select id="getArea" resultMap="SysXzqh"> |
|||
SELECT name,SUBSTRING(XZQHDM, 1, 4) as XZQHDM |
|||
FROM sys_xzqh |
|||
WHERE XZQHDM LIKE '44%' |
|||
GROUP BY SUBSTRING(XZQHDM, 1, 4); |
|||
</select>--> |
|||
|
|||
<sql id="xzqhCondition"> |
|||
<if test="adcd!=null and adcd !=''"> |
|||
and adcd like concat(#{adcd},'%') |
|||
</if> |
|||
<if test="id!=null and id!=''"> |
|||
and id=#{id} |
|||
</if> |
|||
</sql> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,119 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.kms.yg.sz.mapper.BsSgcSzAqrwMapper"> |
|||
|
|||
<sql id="info"> |
|||
SELECT sx.`NAME`, |
|||
COUNT(1) num |
|||
FROM bs_sgc_sz_szrw ss |
|||
LEFT JOIN bs_sgc_sz_safe_jbxx sj ON sj.id = ss.WAGA_ID |
|||
LEFT JOIN sys_xzqh sx ON sj.adcd = sx.XZQHDM |
|||
</sql> |
|||
|
|||
|
|||
|
|||
<resultMap id="NumDto" type="NumDto"> |
|||
<result property="name" column="name"/> |
|||
<result property="num" column="num"/> |
|||
</resultMap> |
|||
|
|||
<select id="getZeroNum" resultMap="NumDto"> |
|||
<include refid="info"></include> |
|||
where task_id =#{taskId} and ss.`status`="0" |
|||
<if test="layer==1"> |
|||
GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
GROUP BY sj.adcd |
|||
</if> |
|||
</select> |
|||
<select id="getOneNum" resultMap="NumDto"> |
|||
<include refid="info"></include> |
|||
where task_id =#{taskId} and ss.`status`="1" |
|||
<if test="layer==1"> |
|||
GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
GROUP BY sj.adcd |
|||
</if> |
|||
</select> |
|||
<select id="getTwoNum" resultMap="NumDto"> |
|||
<include refid="info"></include> |
|||
where task_id =#{taskId} and ss.`status`="2" |
|||
<if test="layer==1"> |
|||
GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
GROUP BY sj.adcd |
|||
</if> |
|||
</select> |
|||
<select id="getThreeNum" resultMap="NumDto"> |
|||
<include refid="info"></include> |
|||
where task_id =#{taskId} and ss.`status`="3" |
|||
<if test="layer==1"> |
|||
GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
GROUP BY sj.adcd |
|||
</if> |
|||
</select> |
|||
<select id="getNum" resultMap="NumDto"> |
|||
<include refid="info"></include> |
|||
where task_id =#{taskId} |
|||
<if test="layer==1"> |
|||
GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
GROUP BY sj.adcd |
|||
</if> |
|||
</select> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
<select id="getOne" resultMap="NumDto"> |
|||
<include refid="info"></include> |
|||
where task_id =#{taskId} and sj.`security_category`="0" |
|||
<if test="layer==1"> |
|||
GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
GROUP BY sj.adcd |
|||
</if> |
|||
</select> |
|||
<select id="getTwo" resultMap="NumDto"> |
|||
<include refid="info"></include> |
|||
where task_id =#{taskId} and sj.`security_category`="1" |
|||
<if test="layer==1"> |
|||
GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
GROUP BY sj.adcd |
|||
</if> |
|||
</select> |
|||
<select id="getThree" resultMap="NumDto"> |
|||
<include refid="info"></include> |
|||
where task_id =#{taskId} and sj.`security_category`="2" |
|||
<if test="layer==1"> |
|||
GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
GROUP BY sj.adcd |
|||
</if> |
|||
</select> |
|||
|
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,122 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.kms.yg.sz.mapper.BsSgcSzFzrMapper"> |
|||
|
|||
<sql id="info"> |
|||
select sj.waga_name, |
|||
sf.* |
|||
from bs_sgc_sz_fzr sf |
|||
left join bs_sgc_sz_safe_jbxx sj on sf.waga_id = sj.id |
|||
</sql> |
|||
|
|||
|
|||
<sql id="getHistogram"> |
|||
select sx.name, |
|||
count(1) num, |
|||
sf.type |
|||
from bs_sgc_sz_fzr sf |
|||
left join bs_sgc_sz_safe_jbxx sj on sf.waga_id = sj.id |
|||
left join sys_xzqh sx on sj.adcd=sx.xzqhdm |
|||
</sql> |
|||
|
|||
|
|||
<resultMap type="pieDto" id="pieDto"> |
|||
<result property="name" column="name"/> |
|||
<result property="num" column="num"/> |
|||
<result property="type" column="type"/> |
|||
</resultMap> |
|||
|
|||
|
|||
<resultMap type="BsSgcSzFzr" id="BsSgcSzFzr"> |
|||
<id property="id" column="id" /> |
|||
<result property="wagaName" column="waga_name"/> |
|||
<result property="name" column="name"/> |
|||
<result property="unit" column="unit"/> |
|||
<result property="duties" column="duties"/> |
|||
<result property="phone" column="phone"/> |
|||
<result property="type" column="type"/> |
|||
<result property="competentDepartment" column="competent_department"/> |
|||
<result property="competentDepartmentDuties" column="competent_department_duties"/> |
|||
<result property="effectiveDate" column="effective_date"/> |
|||
<result property="createTime" column="create_time"/> |
|||
</resultMap> |
|||
|
|||
<!--<select id="selectList1" resultMap="Result"> |
|||
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind> |
|||
SELECT sluice_name, adcd, COUNT(1) number,sluice_code |
|||
FROM bs_sgc_sz_bzbp |
|||
<where> |
|||
<if test="sluiceName != null and sluiceName != ''"> |
|||
sluice_name like concat('%', #{sluiceName}, '%') |
|||
</if> |
|||
<if test="adcd != null and adcd != ''"> |
|||
and adcd like concat(#{adcd},'%') |
|||
</if> |
|||
</where> |
|||
GROUP BY sluice_code |
|||
ORDER BY create_time DESC |
|||
LIMIT #{pageNum}, #{pageSize} |
|||
</select>--> |
|||
|
|||
<select id="getList" resultMap="BsSgcSzFzr"> |
|||
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind> |
|||
<include refid="info"></include> |
|||
<where> |
|||
<if test="wagaId!=null and wagaId!=''"> |
|||
and waga_id =#{wagaId} |
|||
</if> |
|||
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include> |
|||
</where> |
|||
order by ${orderBy} desc LIMIT #{pageNum},#{pageSize}; |
|||
</select> |
|||
|
|||
<select id="getType1" resultMap="pieDto"> |
|||
<include refid="getHistogram"></include> |
|||
<if test="layer==1"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sf.type='0' GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sf.type='0' GROUP BY sj.adcd |
|||
</if> |
|||
<if test="layer==3"> |
|||
WHERE |
|||
sj.adcd = #{adcd} and sf.type='0' |
|||
</if> |
|||
</select> |
|||
|
|||
<select id="getType2" resultMap="pieDto"> |
|||
<include refid="getHistogram"></include> |
|||
<if test="layer==1"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sf.type='1' GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sf.type='1' GROUP BY sj.adcd |
|||
</if> |
|||
<if test="layer==3"> |
|||
WHERE |
|||
sj.adcd = #{adcd} and sf.type='1' |
|||
</if> |
|||
</select> |
|||
|
|||
<select id="getType3" resultMap="pieDto"> |
|||
<include refid="getHistogram"></include> |
|||
<if test="layer==1"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sf.type='2' GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sf.type='2' GROUP BY sj.adcd |
|||
</if> |
|||
<if test="layer==3"> |
|||
WHERE |
|||
sj.adcd = #{adcd} and sf.type='2' |
|||
</if> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,44 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.kms.yg.sz.mapper.BsSgcSzQqhjMapper"> |
|||
|
|||
<sql id="info"> |
|||
select sj.waga_name, |
|||
sj.waga_code, |
|||
sj.waga_type, |
|||
sj.ENG_SCAL, |
|||
sj.adcd, |
|||
sq.* |
|||
from bs_sgc_sz_qqhj sq |
|||
left join bs_sgc_sz_safe_jbxx sj on sq.waga_id = sj.id |
|||
</sql> |
|||
|
|||
|
|||
<resultMap type="BsSgcSzQqhj" id="BsSgcSzQqhj"> |
|||
<id property="id" column="id" /> |
|||
<result property="wagaName" column="waga_name"/> |
|||
<result property="wagaCode" column="waga_code"/> |
|||
<result property="adcd" column="adcd"/> |
|||
<result property="engScal" column="ENG_SCAL"/> |
|||
<result property="wagaType" column="waga_type"/> |
|||
<result property="createTime" column="create_time"/> |
|||
</resultMap> |
|||
|
|||
|
|||
<select id="getList" resultMap="BsSgcSzQqhj"> |
|||
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind> |
|||
<include refid="info"></include> |
|||
<where> |
|||
<if test="wagaName!=null and wagaName!=''"> |
|||
and waga_name like concat('%',#{wagaName},'%') |
|||
</if> |
|||
<if test="wagaType!=null and wagaType!=''"> |
|||
and waga_type=#{wagaType} |
|||
</if> |
|||
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include> |
|||
</where> |
|||
order by ${orderBy} desc LIMIT #{pageNum},#{pageSize}; |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,74 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.kms.yg.sz.mapper.BsSgcSzSafeJbxxMapper"> |
|||
|
|||
<sql id="info"> |
|||
select sx.name, |
|||
count(1) num, |
|||
sj.`status` |
|||
from bs_sgc_sz_safe_jbxx sj |
|||
left join sys_xzqh sx on sj.adcd=sx.xzqhdm |
|||
</sql> |
|||
|
|||
|
|||
<resultMap type="pieDto" id="pieDto"> |
|||
<result property="name" column="name"/> |
|||
<result property="num" column="num"/> |
|||
<result property="status" column="status"/> |
|||
</resultMap> |
|||
|
|||
|
|||
|
|||
<select id="getPie" resultMap="pieDto"> |
|||
<include refid="info"></include> |
|||
<if test="layer==1"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') GROUP BY sj.adcd |
|||
</if> |
|||
<if test="layer==3"> |
|||
WHERE |
|||
sj.adcd = #{adcd} |
|||
</if> |
|||
</select> |
|||
|
|||
|
|||
<select id="getNo" resultMap="pieDto"> |
|||
<include refid="info"></include> |
|||
<if test="layer==1"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sj.status='0' GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sj.status='0' GROUP BY sj.adcd |
|||
</if> |
|||
<if test="layer==3"> |
|||
WHERE |
|||
sj.adcd = #{adcd} and sj.status='0' |
|||
</if> |
|||
</select> |
|||
|
|||
|
|||
|
|||
<select id="getFin" resultMap="pieDto"> |
|||
<include refid="info"></include> |
|||
<if test="layer==1"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sj.status!='0' GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sj.status!='0' GROUP BY sj.adcd |
|||
</if> |
|||
<if test="layer==3"> |
|||
WHERE |
|||
sj.adcd = #{adcd} and sj.status!='0' |
|||
</if> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,92 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.kms.yg.sz.mapper.BsSgcSzYhxxMapper"> |
|||
|
|||
<sql id="info"> |
|||
select sy.`status`, |
|||
count(1) num, |
|||
sx.`name` |
|||
from bs_sgc_sz_yhxx sy |
|||
left join bs_sgc_sz_safe_jbxx sj on sj.id=sy.waga_id |
|||
left join sys_xzqh sx on sj.adcd=sx.xzqhdm |
|||
</sql> |
|||
|
|||
|
|||
<resultMap type="pieDto" id="pieDto"> |
|||
<result property="status" column="status"/> |
|||
<result property="num" column="num"/> |
|||
<result property="name" column="name"/> |
|||
</resultMap> |
|||
|
|||
|
|||
|
|||
<select id="getPie" resultMap="pieDto"> |
|||
<include refid="info"></include> |
|||
<if test="layer==1"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') GROUP BY sy.`status` |
|||
</if> |
|||
<if test="layer==2"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') GROUP BY sy.`status` |
|||
</if> |
|||
<if test="layer==3"> |
|||
WHERE |
|||
sj.adcd = #{adcd} GROUP BY sy.`status` |
|||
</if> |
|||
</select> |
|||
|
|||
|
|||
<select id="getNo" resultMap="pieDto"> |
|||
<include refid="info"></include> |
|||
<if test="layer==1"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') GROUP BY sj.adcd |
|||
</if> |
|||
<if test="layer==3"> |
|||
WHERE |
|||
sj.adcd = #{adcd} |
|||
</if> |
|||
</select> |
|||
|
|||
|
|||
|
|||
<select id="getFin" resultMap="pieDto"> |
|||
<include refid="info"></include> |
|||
<if test="layer==1"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sj.status!='0' GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sj.status!='0' GROUP BY sj.adcd |
|||
</if> |
|||
<if test="layer==3"> |
|||
WHERE |
|||
sj.adcd = #{adcd} and sj.status!='0' |
|||
</if> |
|||
</select> |
|||
|
|||
<select id="getHistogram" resultMap="pieDto"> |
|||
select * from ( |
|||
<include refid="info"></include> |
|||
<if test="layer==1"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sj.status!='0' GROUP BY LEFT(sj.adcd,4) |
|||
</if> |
|||
<if test="layer==2"> |
|||
WHERE |
|||
sj.adcd LIKE concat(#{adcd},'%') and sj.status!='0' GROUP BY sj.adcd |
|||
</if> |
|||
<if test="layer==3"> |
|||
WHERE |
|||
sj.adcd = #{adcd} and sj.status!='0' |
|||
</if> ) t GROUP BY t.`status` |
|||
</select> |
|||
</mapper> |
Loading…
Reference in new issue