Commit bae66871 authored by zhengjiawei's avatar zhengjiawei

消防整改

parent bc1bb984
package com.yeejoin.amos.fas.business.bo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(description = "消防整改 消防要求实体类")
public class FireInfoBo {
/**
* 风险类型
*/
private String type;
/**
* 实际完成数量
*/
private int realNum;
/**
* 阈值
*/
private int threshold;
public FireInfoBo(int realNum, int threshold) {
this.realNum = realNum;
this.threshold = threshold;
}
public FireInfoBo() {
}
}
package com.yeejoin.amos.fas.business.bo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(description = "消防整改 整改数据实体")
public class FireMoreDataBo {
/**
* req 主键
*/
private String req;
/**
* 类型或登记
*/
private String lvl;
/**
* 设备名称
*/
private String name;
/**
* 描述
*/
private String persent;
/**
* 影响
*/
private String affect;
/**
* 处理结果
*/
private String doneResult;
/**
* 反馈
*/
private String backResult;
/**
* 反馈
*/
private String filePath;
}
package com.yeejoin.amos.fas.business.bo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(description = "消防整改 消防要求实体类")
public class FireParamBo {
private List<FireMoreDataBo> warnningData;
private List<FireMoreDataBo> hiddenData;
private List<FireMoreDataBo> dangerData;
private String backResult;
private String refResult;
private String billNo;
}
package com.yeejoin.amos.fas.business.bo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(description = "消防整改数据展示实体")
public class FireRectificationBo {
/**
* 登记单号
*/
private String billno;
/**
* 站编号
*/
private String stationNum;
/**
* 站名称
*/
private String stationName;
/**
* 需处理告警
*/
private Integer warnning;
/**
* 需关注风险
*/
private Integer danger;
/**
* 需处理隐患
*/
private Integer hiddenTrouble;
/**
* 需加强消防管理
*/
private Integer adminOfFire;
/**
* 安全负责人
*/
private String chargePerson;
/**
* 联系人电话
*/
private String chargePersonTel;
/**
* 治理完成日期
*/
private String completionDate;
/**
* 实际完成日期
*/
private String reCompletionDate;
/**
* 状态
*/
private String status;
/**
* 状态code
*/
private String statuscode;
/**
* 整改下发人员
*/
private String disUser;
/**
* 整改下发登记日期
*/
private String disDate;
/**
* 环流站复制人员
*/
private String stationUser;
/**
* 整改下发人员联系电话
*/
private String stationUserTel;
/**
* 安全负责人
*/
private String safeUser;
/**
* 安全负责人电话
*/
private String safeUserTel;
/**
* 要求完成日
*/
private String reqDate;
/**
* 实际完成日
*/
private String finishDate;
/**
* 整改结果
*/
private String refResult;
/**
* 意见及建议
*/
private String viewsAndSuggestions;
/**
* 反馈结果
*/
private String backResult;
}
package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.bo.FireParamBo;
import com.yeejoin.amos.fas.business.service.intfc.FireRectificationService;
import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 安全执行-消防整改 控制器
*
* @author 郑嘉伟
*/
@RestController
@RequestMapping(value = "/api/fireRectification")
@Api(tags = "消防整改")
public class FireRectificationController extends BaseController {
@Autowired
private FireRectificationService fireRectificationService;
@Permission
@ApiOperation(httpMethod = "GET", value = "按条件查询消防整改列表信息", notes = "按条件查询消防整改列表信息")
@GetMapping(value = "/list")
public CommonResponse queryFireList(
@RequestParam(value = "nameLike") String nameLike,
@RequestParam(value = "sDate") String sDate,
@RequestParam(value = "eDate") String eDate,
@RequestParam(value = "states") int states,
@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize) {
return CommonResponseUtil.success(fireRectificationService.queryFiresAndCount(nameLike,sDate,eDate,states,pageNum,pageSize));
}
@Permission
@ApiOperation(httpMethod = "GET", value = "获取单个单据详细数据", notes = "获取单个单据详细数据")
@GetMapping(value = "/getMoreData")
public CommonResponse seleteOne(@RequestParam(value = "billNo") String billNo){
return CommonResponseUtil.success(fireRectificationService.selectOneById(billNo));
}
@Permission
@ApiOperation(httpMethod = "POST", value = "下载附件", notes = "下载附件")
@PostMapping(value = "/downLoad")
public void downLoad(@RequestBody List<String> path, HttpServletResponse response){
fireRectificationService.downLoadFilesByUrll(path.get(0),response);
}
@Permission
@ApiOperation(httpMethod = "POST", value = "修改表单数据", notes = "修改表单数据")
@PostMapping(value = "/update")
public CommonResponse update(@RequestBody FireParamBo paramBo){
return CommonResponseUtil.success(fireRectificationService.updateByid(paramBo));
}
}
package com.yeejoin.amos.fas.business.dao.mapper;
import com.yeejoin.amos.fas.business.bo.FireInfoBo;
import com.yeejoin.amos.fas.business.bo.FireMoreDataBo;
import com.yeejoin.amos.fas.business.bo.FireRectificationBo;
import java.util.List;
import java.util.Map;
public interface FireRectificationMapper extends BaseMapper{
List<FireRectificationBo> queryFiresAndCount(Map<String,Object> param);
long countQueryFireList(Map<String,Object> param);
FireRectificationBo selectOneForBase(String billNo);
List<FireMoreDataBo> selectOneForEmergency(String billNo);
List<FireMoreDataBo> selectOneForDanger(String billNo);
List<FireMoreDataBo> selectOneForHidden (String billNo);
FireInfoBo selectOneForfire(String billNo, int id);
int updateBill(Map<String,String > param);
int updateWarnning(FireMoreDataBo param);
int updateHidden(FireMoreDataBo param);
int updateDanger(FireMoreDataBo param);
}
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.bo.FireInfoBo;
import com.yeejoin.amos.fas.business.bo.FireMoreDataBo;
import com.yeejoin.amos.fas.business.bo.FireParamBo;
import com.yeejoin.amos.fas.business.bo.FireRectificationBo;
import com.yeejoin.amos.fas.business.dao.mapper.FireRectificationMapper;
import com.yeejoin.amos.fas.business.service.intfc.FireRectificationService;
import com.yeejoin.amos.fas.business.util.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("fireRectificationService")
public class FireRectificationServiceImpl implements FireRectificationService {
@Autowired
FireRectificationMapper fireRectificationMapper;
/**
* 文件服务器地址
*/
@Value("${file.downLoad.url}")
private String ipUrl;
@Override
public Map<String, Object> queryFiresAndCount(String nameLike, String sDate, String eDate, int states, int pageNum,int pageSize) {
if(nameLike.trim().equals("")){
nameLike = null;
}
Map<String, Object> map = new HashMap<>();
int spage = (pageNum-1)*pageSize;
map.put("nameLike",nameLike);
map.put("sDate",sDate);
map.put("eDate",eDate);
map.put("states",states);
map.put("spage",spage);
map.put("pageSize",pageSize);
List<FireRectificationBo> fireRectificationBos = fireRectificationMapper.queryFiresAndCount(map);
long countFires = fireRectificationMapper.countQueryFireList(map);
map.clear();
map.put("fireRectificationBos",fireRectificationBos);
map.put("countFires",countFires);
return map;
}
@Override
public Map<String, Object> selectOneById(String billNo) {
Map<String ,Object> result = new HashMap();
FireRectificationBo base = fireRectificationMapper.selectOneForBase(billNo);
List<FireMoreDataBo> warnnings = fireRectificationMapper.selectOneForEmergency(billNo);
List<FireMoreDataBo> danger = fireRectificationMapper.selectOneForDanger(billNo);
List<FireMoreDataBo> hidden = fireRectificationMapper.selectOneForHidden(billNo);
List<FireInfoBo> files = new ArrayList<>();
for (int i=0;i<4;i++){
files.add(fireRectificationMapper.selectOneForfire(billNo,i));
}
Map<String ,Object> backResult = makeFIreString(files);
result.put("base", base);
result.put("warnnings", warnnings);
result.put("danger", danger);
result.put("hidden", hidden);
result.put("fires", backResult.get("fires"));
result.put("backResult", backResult.get("backResult"));
return result;
}
@Override
public void downLoadFilesByUrll(String path, HttpServletResponse response) {
List<String> list = Arrays.asList(path.split(","));
try {
FileUtils.downloadZIP(response,list,ipUrl);
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public Map<String, String> updateByid(FireParamBo paramBo) {
Map<String, String> map = new HashMap<>();
map.put("billNo",paramBo.getBillNo());
map.put("backResult",paramBo.getBackResult());
map.put("refResult",paramBo.getRefResult());
try {
if(isDataEmpty(paramBo.getBillNo(),null) ||
isDataEmpty(paramBo.getBackResult(),null) ||
isDataEmpty(paramBo.getRefResult(),null)
){
fireRectificationMapper.updateBill(map);
}
if (isDataEmpty(null,paramBo.getWarnningData())){
for (FireMoreDataBo bo : paramBo.getWarnningData()) {
fireRectificationMapper.updateWarnning(bo);
}
}
if (isDataEmpty(null,paramBo.getHiddenData())){
for (FireMoreDataBo bo : paramBo.getHiddenData()) {
fireRectificationMapper.updateHidden(bo);
}
}
if (isDataEmpty(null,paramBo.getDangerData())){
for (FireMoreDataBo bo : paramBo.getDangerData()) {
fireRectificationMapper.updateDanger(bo);
}
}
map.clear();
}catch (Exception e) {
map.put("result","数据保存失败");
map.put("message","error");
return map;
}
map.put("result","数据保存成功");
map.put("message","success");
return map;
}
public boolean isDataEmpty (String data,List<FireMoreDataBo> list) {
if (data != null){
return !("").equals(data);
}
return list != null && list.size() != 0;
}
/**
* 生成返回拼接评价
* @param files
* @return
*/
public Map<String ,Object> makeFIreString( List<FireInfoBo> files){
Map<String ,Object> result = new HashMap();
Map<String ,Object> newfires = new HashMap();
String backResult = ",需加强";
FireInfoBo fire1= files.get(0);
FireInfoBo fire2= files.get(1);
FireInfoBo fire3= files.get(2);
FireInfoBo fire4= files.get(3);
if (fire1 == null){
fire1 = new FireInfoBo(0,0);
}
if (fire2 == null){
fire2 = new FireInfoBo(0,0);
}
if (fire3 == null){
fire3 = new FireInfoBo(0,0);
}
if (fire4 == null){
fire4 = new FireInfoBo(0,0);
}
newfires.put("fire1rel",fire1.getRealNum());
newfires.put("fire1thr",fire1.getThreshold());
newfires.put("fire2rel",fire2.getRealNum());
newfires.put("fire2thr",fire2.getThreshold());
newfires.put("fire3rel",fire3.getRealNum());
newfires.put("fire3thr",fire3.getThreshold());
newfires.put("fire4rel",fire4.getRealNum());
newfires.put("fire4thr",fire4.getThreshold());
if (fire1.getRealNum()<fire1.getThreshold() && fire1.getRealNum()!=fire1.getThreshold()){
backResult = backResult+"消防应急预案";
}
if (fire2.getRealNum()<fire2.getThreshold() && fire2.getRealNum()!=fire2.getThreshold()){
if(!backResult.equals(",需加强")){
backResult = backResult+",";
}
backResult = backResult+"消防安全教育培训";
}
if (fire3.getRealNum()<fire3.getThreshold() && fire3.getRealNum()!=fire3.getThreshold()){
if(!backResult.equals(",需加强")){
backResult = backResult+",";
}
backResult = backResult+"消防日常训练";
}
if ( fire4.getRealNum()<fire4.getThreshold() && fire4.getRealNum()!=fire4.getThreshold()){
if(!backResult.equals(",需加强")){
backResult = backResult+",";
}
backResult = backResult+"消防器材保养";
}
if (backResult.equals(",需加强")){
backResult = "。";
}else {
backResult = backResult+"工作。";
}
result.put("fires", newfires);
result.put("backResult", backResult);
return result;
}
}
package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.business.bo.FireParamBo;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* 安全监管-单据管理 服务类
*
* @author 郑嘉伟
*/
public interface FireRectificationService {
/**
* 按条件查询消防整改列表信息
* @param nameLike 单据模糊查询
* @param sDate 起始日
* @param eDate 终止日
* @param states 状态
* @param pageNum 页码
* @return
*/
Map<String, Object> queryFiresAndCount(String nameLike, String sDate, String eDate, int states, int pageNum ,int pageSize);
Map<String ,Object> selectOneById(String billNo);
void downLoadFilesByUrll(String path, HttpServletResponse response );
Map<String, String> updateByid(FireParamBo paramBo);
}
package com.yeejoin.amos.fas.business.util;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
* 文件下载 工具类
*
* @author 郑嘉伟
* @since 2020-08-05
*/
public class FileUtils {
private static final Logger logger = LogManager.getLogger(FileUtils.class);
/**
* 获取压缩好zip——>设置消息头——>输出
* @param response
* @param list
* @param ipUrl
* @throws IOException
*/
public static void downloadZIP(HttpServletResponse response, List<String> list, String ipUrl) throws IOException {
//构建zip
String zipname = "单据相关附件.zip";
String zippath = fileToZip(list, zipname, ipUrl);
OutputStream out = null;
BufferedInputStream br = null;
try {
String fileName = new String(zipname.getBytes("UTF-8"), "iso-8859-1");
br = new BufferedInputStream(new FileInputStream(zippath));
byte[] buf = new byte[1024];
int len = 0;
response.reset();
response.setHeader("Content-Type", "application/octet-stream;charset=utf-8");
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setHeader("Access-Control-Expose-Headers", "access_token");
response.setHeader("Access-Control-Allow-Origin", "*");
response.setContentType("application/zip");
out = response.getOutputStream();
while ((len = br.read(buf)) > 0) {
out.write(buf, 0, len);
out.flush();
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
br.close();
out.close();
}
}
/**
* 通过文件服务器——>获取流——>输出——>压缩
*
* @param list
* @param fileName
* @return
*/
public static String fileToZip(List<String> list, String fileName, String ipUrl) {
InputStream fis = null;
BufferedInputStream bis = null;
FileOutputStream fos = null;
ZipOutputStream zos = null;
// 临时目录
String path = System.getProperty("java.io.tmpdir") + fileName;
try {
File zipFile = new File(path);
zipFile.deleteOnExit();
zipFile.createNewFile();
fos = new FileOutputStream(zipFile);
zos = new ZipOutputStream(new BufferedOutputStream(fos));
byte[] bufs = new byte[1024 * 10];
for (String a : list) {
fis = getInputStreamFromURL(ipUrl + a);
String subFileName = new File(ipUrl + a).getName();
//创建ZIP实体,并添加进压缩包
ZipEntry zipEntry = new ZipEntry(subFileName);
zos.putNextEntry(zipEntry);
bis = new BufferedInputStream(fis, 1024 * 10);
int read = 0;
while ((read = bis.read(bufs, 0, 1024 * 10)) != -1) {
zos.write(bufs, 0, read);
}
}
System.out.println("压缩成功");
} catch (FileNotFoundException e) {
e.printStackTrace();
throw new RuntimeException(e);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
} finally {
try {
if (null != bis) {
bis.close();
}
if (null != zos) {
zos.close();
}
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
return path;
}
/**
* 从URL中读取图片,转换成流形式.
*
* @param destUrl
* @return
*/
public static InputStream getInputStreamFromURL(String destUrl) {
HttpURLConnection httpUrl = null;
URL url = null;
InputStream in = null;
try {
url = new URL(destUrl);
httpUrl = (HttpURLConnection) url.openConnection();
httpUrl.connect();
in = httpUrl.getInputStream();
return in;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
\ No newline at end of file
spring.application.name = Amos-autosys-gdd
spring.application.name = Amos-autosys-zjw
server.port = 8083
......@@ -56,3 +56,7 @@ param.safetyIndexChange.cron = 0 0 2 * * ?
param.weather.url = http://wthrcdn.etouch.cn/weather_mini?citykey=
file.downLoad.url=http://172.16.10.175:8888/
<?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.yeejoin.amos.fas.business.dao.mapper.FireRectificationMapper">
<select id="queryFiresAndCount" resultType="com.yeejoin.amos.fas.business.bo.FireRectificationBo">
SELECT * FROM (
SELECT
BILL_NO AS billno,
STATION_SEQ AS stationNum,
STATION_NAME AS stationName,
( SELECT COUNT(1) FROM ELEC_BILLS_ALARM_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS warnning,
( SELECT COUNT(1) FROM ELEC_BILLS_RISK_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR) AS danger,
( SELECT COUNT(1) FROM ELEC_BILLS_DANGER_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS hiddenTrouble,
( SELECT COUNT(1) FROM ELEC_BILLS_FIRE_SAFETY_CONTROL WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS adminOfFire,
SAFETY_CHARGE_PERSON AS chargePerson,
SAFETY_PERSON_PHONE AS chargePersonTel,
date_format(REQUIREMENT_DATE,'%Y / %m / %d') AS completionDate,
REQUIREMENT_DATE,
date_format(ACTUAL_FINISH_DATE,'%Y / %m / %d') AS reCompletionDate,
STATUS AS statuscode,
if(STATUS=1,'未处理','已完成') AS status
FROM
ELEC_BILLS_BASIC_INFO EBD
where STATUS = 1 or STATUS = 2
ORDER BY REQUIREMENT_DATE) BDATA
where 1=1
<if test="nameLike != null ">
and billno like CONCAT('%',#{nameLike},'%')
</if>
<if test="sDate != 'null' and sDate != '1970-1-1' ">
and STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d') >= STR_TO_DATE(#{sDate},'%Y-%m-%d')
</if>
<if test="eDate != 'null' and eDate != '1970-1-1' ">
and STR_TO_DATE(#{eDate},'%Y-%m-%d') >=STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d')
</if>
<if test="states != 0 ">
and statuscode = #{states}
</if>
LIMIT #{spage},#{pageSize}
</select>
<select id="countQueryFireList" resultType="long">
SELECT COUNT(1) FROM (
SELECT
BILL_NO AS billno,
REQUIREMENT_DATE,
STATUS
FROM
ELEC_BILLS_BASIC_INFO EBD
where STATUS = 1 or STATUS = 2
ORDER BY REQUIREMENT_DATE) BDATA
where 1=1
<if test="nameLike != null ">
and billno like CONCAT('%',#{nameLike},'%')
</if>
<if test="sDate != 'null' and sDate != '1970-1-1' ">
and STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d') >= STR_TO_DATE(#{sDate},'%Y-%m-%d')
</if>
<if test="eDate != 'null' and eDate != '1970-1-1' ">
and STR_TO_DATE(#{eDate},'%Y-%m-%d') >=STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d')
</if>
<if test="states != 0 ">
and STATUS = #{states}
</if>
</select>
<select id="selectOneForBase" resultType="com.yeejoin.amos.fas.business.bo.FireRectificationBo">
select
BILL_NO AS billNo,
STATION_NAME AS stationName,
DISTRIBUTION_USER_NAME AS disUser,
DISTRIBUTION_DATE AS disDate,
STATION_CHARGE_PERSON AS stationUser,
CHARGE_PERSON_PHONE AS stationUserTel,
SAFETY_CHARGE_PERSON AS safeUser,
SAFETY_PERSON_PHONE AS safeUserTel,
REQUIREMENT_DATE AS reqDate,
if(ACTUAL_FINISH_DATE is null, date_format(sysdate(),'%Y-%m-%d') ,ACTUAL_FINISH_DATE) AS finishDate,
REFORM_RESULT AS refResult,
VIEWS_AND_SUGGESTIONS AS viewsAndSuggestions,
FEEDBACK_RESULT AS backResult,
STATUS AS status
from
elec_bills_basic_info EBD
where BILL_NO = #{billNo}
</select>
<select id="selectOneForEmergency" resultType="com.yeejoin.amos.fas.business.bo.FireMoreDataBo">
select
SEQUENCE_NBR as req,
FIRE_EQUIPMENT_NAME AS name,
ALARM_DESC AS persent,
HANDLE_STATE AS doneResult,
FILE_PATH as filePath
from
elec_bills_alarm_info
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
</select>
<select id="selectOneForDanger" resultType="com.yeejoin.amos.fas.business.bo.FireMoreDataBo">
select
SEQUENCE_NBR as req,
LEVEL_NAME AS lvl,
POINT_NAME AS persent,
RISK_FACTOR_NAME AS affect,
FEEDBACK AS backResult
from
elec_bills_risk_info
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
</select>
<select id="selectOneForHidden" resultType="com.yeejoin.amos.fas.business.bo.FireMoreDataBo">
select
SEQUENCE_NBR as req,
if(DANGER_LEVEL=1,'一般隐患','重大隐患') AS lvl,
DANGER_NAME AS persent,
INPUT_ITEM_NAME AS affect,
HANDLE_STATE AS doneResult,
FILE_PATH as filePath
from
elec_bills_danger_info
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
</select>
<select id="selectOneForfire" resultType="com.yeejoin.amos.fas.business.bo.FireInfoBo">
select
TYPE AS type,
ACTUAL_NUMBER AS realNum,
THRESHOLD AS threshold
from
elec_bills_fire_safety_control
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
and type =${id}
</select>
<update id="updateBill">
UPDATE
ELEC_BILLS_BASIC_INFO
SET STATUS = 2,
REFORM_RESULT =#{refResult} ,
FEEDBACK_RESULT =#{backResult}
where BILL_NO = #{billNo}
</update>
<update id="updateWarnning">
UPDATE
ELEC_BILLS_ALARM_INFO
SET
HANDLE_STATE =#{doneResult} ,
FILE_PATH =#{filePath}
where SEQUENCE_NBR = #{req}
</update>
<update id="updateHidden">
UPDATE
ELEC_BILLS_DANGER_INFO
SET
HANDLE_STATE =#{doneResult} ,
FILE_PATH =#{filePath}
where SEQUENCE_NBR = #{req}
</update>
<update id="updateDanger">
UPDATE
ELEC_BILLS_RISK_INFO
SET
FEEDBACK =#{backResult}
where SEQUENCE_NBR = #{req}
</update>
</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