| | |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
| | | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; |
| | |
| | | @SpringBootApplication |
| | | @EnableWebMvc |
| | | @MapperScan(basePackages = "com.fgkj.mapper.impl") |
| | | @EnableTransactionManagement |
| | | public class Application extends WebMvcConfigurerAdapter { |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | public ServiceModel add(@RequestBody BattMap_information binfo){ |
| | | // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class); |
| | | ServiceModel model = service.add(binfo); |
| | | if (model.getCode()==1) |
| | | { |
| | | String msg="设置"+binfo.getStationName()+"在"+binfo.getAddress(); |
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg); |
| | |
| | | @Resource |
| | | private User_logService uservice; |
| | | |
| | | @PostMapping("/add") |
| | | @PostMapping("/") |
| | | public ServiceModel add(@RequestBody Batt_Devdischarge bd){ |
| | | // Batt_Devdischarge bd = getGson("yyyy-MM-dd").fromJson(json, Batt_Devdischarge.class); |
| | | ServiceModel model = service.add(bd); |
| | |
| | | return model; |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @PutMapping("/") |
| | | public ServiceModel update(@RequestBody Batt_Devdischarge bd){ |
| | | // Batt_Devdischarge bd = getGson("yyyy-MM-dd").fromJson(json, Batt_Devdischarge.class); |
| | | ServiceModel model = service.update(bd); |
| | |
| | | return model; |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @DeleteMapping("/") |
| | | public ServiceModel del(@RequestBody Batt_Devdischarge bd){ |
| | | // Batt_Devdischarge bd = getGson("yyyy-MM-dd").fromJson(json, Batt_Devdischarge.class); |
| | | ServiceModel model = service.del(bd); |
| | |
| | | import com.fgkj.dto.Batt_history; |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.services.Batt_historyService; |
| | | import com.fgkj.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | private Batt_historyService service; |
| | | |
| | | //查询所有的历史实时数据 |
| | | //TODO 数据库不同,使用这个表名测试 db_batt_history.tb_batt_910000001_2017_12 |
| | | @GetMapping("serchByCondition") |
| | | public ServiceModel serchByCondition(@RequestBody Batt_history batt_his){ |
| | | // Batt_history batt_his=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_history.class); |
| | | // Batt_history batt_his= ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_history.class); |
| | | ServiceModel model=service.serchByCondition(batt_his); |
| | | |
| | | return model; |
| | |
| | | |
| | | @GetMapping("all") |
| | | public ServiceModel searchAll(){ |
| | | model=service.searchAll(); |
| | | ServiceModel model=service.searchAll(); |
| | | //System.out.println(result); |
| | | return model; |
| | | } |
| | |
| | | Gson gson=new Gson(); |
| | | UserRole u=new UserRole(); |
| | | // List<Batt_param_low> list = gson.fromJson(blowstr, new TypeToken<List<Batt_param_low>>(){}.getType()); |
| | | for(int i=0;i<list.size();i++){ |
| | | model=service.update(list.get(i)); |
| | | } |
| | | ServiceModel model=service.update(list); |
| | | return model; |
| | | } |
| | | } |
| | |
| | | //电池组实时情况+实时电池续航能力查询 |
| | | @GetMapping("battLife") |
| | | public ServiceModel serchBattLife(@RequestBody Batt_Maint_Dealarm bmd){ |
| | | System.out.println("bmd = " + bmd); |
| | | // Batt_Maint_Dealarm bmd = ActionUtil.getGson().fromJson(json, Batt_Maint_Dealarm.class); |
| | | User_inf uinf=(User_inf) ActionUtil.getUser(); |
| | | bmd.setUinf(uinf); |
| | |
| | | //4.2作业参数(重命名操作) |
| | | @PutMapping("/") |
| | | public ServiceModel update(@RequestBody User_task_param utp) { |
| | | // System.out.println("utp = " + utp); |
| | | ServiceModel model=service.update(utp); |
| | | |
| | | return model; |
| | |
| | | private Integer BattGroupid; |
| | | private Integer mon_num; |
| | | private Integer record_num; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date test_starttime; |
| | | private Float group_vol; |
| | | private Float test_curr; |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.apache.ibatis.type.Alias; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Table; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | @Alias("Batt_history") |
| | | public class Batt_history implements Serializable{ |
| | | private String tbname; |
| | | private Integer num; |
| | | private Integer dev_id; |
| | | private Integer BattGroupId; |
| | |
| | | private String mon_conn_ress; |
| | | private String mon_caps; |
| | | private String note; |
| | | |
| | | public String getTbname() { |
| | | return tbname; |
| | | } |
| | | |
| | | public void setTbname(String tbname) { |
| | | this.tbname = tbname; |
| | | } |
| | | |
| | | public Integer getNum() { |
| | | return num; |
| | | } |
| | |
| | | public void setNote(String note) { |
| | | this.note = note; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Batt_history [num=" + num + ", dev_id=" + dev_id |
| | | + ", BattGroupId=" + BattGroupId + ", batt_count=" + batt_count |
| | | + ", rec_datetime=" + rec_datetime + ", rec_datetime1=" |
| | | + rec_datetime1 + ", online_vol=" + online_vol + ", group_vol=" |
| | | + group_vol + ", group_tmp=" + group_tmp + ", group_curr=" |
| | | + group_curr + ", batt_state=" + batt_state + ", mon_vols=" |
| | | + mon_vols + ", mon_tmps=" + mon_tmps + ", mon_ress=" |
| | | + mon_ress + ", mon_sers=" + mon_sers + ", mon_conn_ress=" |
| | | + mon_conn_ress + ", mon_caps=" + mon_caps + ", note=" + note |
| | | + "]"; |
| | | return "Batt_history{" + |
| | | "tbname='" + tbname + '\'' + |
| | | ", num=" + num + |
| | | ", dev_id=" + dev_id + |
| | | ", BattGroupId=" + BattGroupId + |
| | | ", batt_count=" + batt_count + |
| | | ", rec_datetime=" + rec_datetime + |
| | | ", rec_datetime1=" + rec_datetime1 + |
| | | ", online_vol=" + online_vol + |
| | | ", group_vol=" + group_vol + |
| | | ", group_tmp=" + group_tmp + |
| | | ", group_curr=" + group_curr + |
| | | ", batt_state=" + batt_state + |
| | | ", mon_vols='" + mon_vols + '\'' + |
| | | ", mon_tmps='" + mon_tmps + '\'' + |
| | | ", mon_ress='" + mon_ress + '\'' + |
| | | ", mon_sers='" + mon_sers + '\'' + |
| | | ", mon_conn_ress='" + mon_conn_ress + '\'' + |
| | | ", mon_caps='" + mon_caps + '\'' + |
| | | ", note='" + note + '\'' + |
| | | '}'; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.fgkj.mapper.impl; |
| | | |
| | | import com.fgkj.dto.Batt_Maint_Dealarm; |
| | | import com.fgkj.dto.User_inf; |
| | | import com.fgkj.dto.*; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | |
| | | public interface BadBatt_monMapper{ |
| | | |
| | | //9.1根据stationid查询机房的落后单体总数 |
| | | public int serchByStationId(Object obj); |
| | | @Select("select count(num) as nums from web_site.tb_badbatt_mon " + |
| | | "where battgroupid in (select distinct battgroupid from db_battinf.tb_battinf where stationid=#{StationId} ) limit 1 ") |
| | | public int serchByStationId(BattMap_information obj); |
| | | |
| | | //9.1根据stationName3查询站点的落后单体总数 |
| | | public int serchBystationName3(Object obj); |
| | | |
| | | //9.1根据机房stationid查询机房下电池组单体落后情况 |
| | | public String serchMonBad(Object obj); |
| | | @Select("select battgroupid,group_concat(distinct mon_num) as mon_nums from web_site.tb_badbatt_mon " + |
| | | " where battgroupid =#{battGroupId} group by battgroupid limit 1") |
| | | public List<BadBatt_mon> serchMonBad(BattInf obj); |
| | | |
| | | @Select("select count(distinct num,battgroupid,mon_num) " + |
| | | " from web_site.tb_badbatt_mon " + |
| | |
| | | import java.util.List; |
| | | |
| | | import com.fgkj.dto.BattDischarge_plan; |
| | | import com.fgkj.dto.BattMap_information; |
| | | import com.fgkj.mapper.BattTestData; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | |
| | | //9.1查询机房放电计划中存在放电延时的总数 |
| | | //地图上所有的放电延时机房 |
| | | public int serchByStationId(Object obj); |
| | | @Select("select count(num) as nums from web_site.tb_battdischarge_plan " + |
| | | "where battgroupid in (select distinct battgroupid from db_battinf.tb_battinf where stationid=#{StationId} ) " + |
| | | "and discharge_state=${@com.fgkj.mapper.BattTestData@test_plan1} limit 1 ") |
| | | public int serchByStationId(BattMap_information obj); |
| | | |
| | | //9.1查询机房放电计划中存在放电延时的总数 |
| | | //地图上所有的放电延时机房 |
| | |
| | | package com.fgkj.mapper.impl; |
| | | |
| | | import com.fgkj.dto.BattInf; |
| | | import com.fgkj.dto.BattMap_information; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | |
| | | public List serchByBattInUseDateGroup(Object obj); |
| | | |
| | | //9.1根据stationid查询机房电池组数和每组电池组中单体的个数(机房信息内容画图) |
| | | public List serchMonNum(Object obj); |
| | | @Select(" select distinct db_battinf.tb_battinf.battgroupid,db_battinf.tb_battinf.battgroupname ,db_battinf.tb_battinf.moncount,db_battinf.tb_battinf.stationid,db_battinf.tb_battinf.moncapstd," + |
| | | " db_battinf.tb_battinf.battproductdate,db_battinf.tb_battinf.battinusedate " + |
| | | " from db_battinf.tb_battinf " + |
| | | " where db_battinf.tb_battinf.stationid=#{StationId}") |
| | | public List<BattInf> serchMonNum(BattMap_information obj); |
| | | |
| | | //9.1根据电池组stationid查询电池组的信息(电池寿命管理) |
| | | public List serchByStationid(Object obj); |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.fgkj.dto.BattInf; |
| | | import com.fgkj.dto.BattMap_information; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | public interface BattMap_informationMapper{ |
| | | |
| | | //9.1录入站点下所有设备的信息 |
| | | public boolean add(Object obj) ; |
| | | @Insert("insert into web_site.tb_battmap_information(StationId,StationName,address,longitude,latitude,StationName3) " + |
| | | "select StationId,StationName,#{Address},#{longitude},#{latitude},StationName3 from db_battinf.tb_battinf where StationName3=#{StationName3} and StationName1=#{StationName1} and StationName2=#{StationName2} and StationName5=#{StationName5}") |
| | | public int add(BattMap_information obj) ; |
| | | |
| | | //9.1录入机房信息(站点存在,设备新建) |
| | | public boolean addDev(Object obj); |
| | | @Insert(" insert into web_site.tb_battmap_information(StationId,StationName,address,longitude,latitude,StationName3) " |
| | | + " select distinct #{StationId},#{StationName},address,longitude,latitude,#{StationName3} from db_battinf.tb_battinf,web_site.tb_battmap_information " |
| | | + " where web_site.tb_battmap_information.StationName3=db_battinf.tb_battinf.StationName3 and StationName1=#{StationName1} and StationName2=#{StationName2} and StationName5=#{StationName5} and web_site.tb_battmap_information.StationName3=#{StationName3}") |
| | | public int addDev(BattMap_information obj); |
| | | |
| | | public boolean update(Object obj); |
| | | @Update("update web_site.tb_battmap_information set StationId=#{StationId},StationName=#{StationName},address=#{address},longitude=#{longitude},latitude=#{latitude},information=#{information} where num=#{num}") |
| | | public int update(BattMap_information obj); |
| | | |
| | | //删除 |
| | | public boolean del(Object obj) ; |
| | | @Delete("delete from web_site.tb_battmap_information where StationName3=#{StationName3} and longitude=#{longitude} and latitude=#{latitude} ") |
| | | public int del(BattMap_information obj) ; |
| | | |
| | | //9.1百度地图定位查询电池组信息 |
| | | public List searchAll() ; |
| | | @Select("select num,StationId,StationName,address,longitude,latitude,information from web_site.tb_battmap_information ") |
| | | public List<BattMap_information> searchAll() ; |
| | | |
| | | //9.1查询未添加物理信息的机房 |
| | | public List serchNotInBattMap(); |
| | | @Select("select distinct tb_battinf.stationid,tb_battinf.stationname from db_battinf.tb_battinf " + |
| | | "where tb_battinf.stationId not in(select web_site.tb_battmap_information.stationId from web_site.tb_battmap_information )") |
| | | public List<BattInf> serchNotInBattMap(); |
| | | |
| | | //9.1查询未添加物理信息的机房(用户管理的) |
| | | public List serchNotInBattMapByUid(Object obj); |
| | |
| | | public List serchStationName(Object obj); |
| | | |
| | | //9.1地图上根据维护区查询机房经纬度 |
| | | public List serchByInfo(Object obj) ; |
| | | @Select("select num, StationId,StationName,address,longitude,latitude,information from web_site.tb_battmap_information " + |
| | | " where StationId=#{StationId}") |
| | | public List<BattMap_information> serchByInfo(BattMap_information obj) ; |
| | | |
| | | //查询站点的经纬度 |
| | | public List serchAddressByStationName3(Object obj); |
| | | |
| | | //9.1百度地图定位根据省份查询所有该区域的机房 |
| | | public List serchByCondition(Object obj) ; |
| | | @Select("select num,StationId,StationName,address,longitude,latitude,information from web_site.tb_battmap_information " + |
| | | " where address like '%${Address}%' ") |
| | | public List<BattMap_information> serchByCondition(BattMap_information obj) ; |
| | | |
| | | //根据省/市/区县查询所有的站点 |
| | | public List serchStationName3(Object obj); |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.fgkj.dto.BattInf; |
| | | import com.fgkj.dto.Batt_Devdischarge; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | public interface Batt_DevdischargeMapper{ |
| | | |
| | | //TODO 1211 |
| | | @Insert("INSERT INTO `web_site`.`tb_batt_discharge` (`num`, `uid`, `dev_id`, `record_time`, `note`) VALUES (NULL, #{dev_vol}, #{dev_curr}, #{dev_power}, #{note})") |
| | | @Insert("insert into web_site.tb_batt_devdischarge_cm(dev_id,dev_name,dev_recordtime,dev_vol,dev_curr,dev_power,note) " + |
| | | "VALUES (#{dev_id},#{dev_name},#{dev_recordtime}, #{dev_vol}, #{dev_curr}, #{dev_power}, #{note})") |
| | | public int add(Batt_Devdischarge devdischarge); |
| | | |
| | | public boolean update(Batt_Devdischarge devdischarge); |
| | | @Update("update web_site.tb_batt_devdischarge_cm set dev_id=#{dev_id},dev_name=#{dev_name},dev_recordtime=#{dev_recordtime},dev_vol=#{dev_vol},dev_curr=#{dev_curr},dev_power=#{dev_power},note=#{note} where num=#{num}") |
| | | public int update(Batt_Devdischarge devdischarge); |
| | | |
| | | // @Select("delete from web_site.tb_batt_devdischarge where num=#{num}") |
| | | @Select("delete from web_site.tb_batt_discharge where num=#{num}") |
| | | public boolean del(Batt_Devdischarge devdischarge); |
| | | @Delete("delete from web_site.tb_batt_devdischarge_cm where num=#{num}") |
| | | public int del(Batt_Devdischarge devdischarge); |
| | | |
| | | |
| | | //TODO tb_batt_devdischarge_cm tb_batt_devdischarge不存在 |
| | | @Select("select num,dev_id,dev_name,dev_recordtime,dev_vol,dev_curr,dev_power,note from web_site.tb_batt_devdischarge_cm") |
| | | public List<Batt_Devdischarge> searchAll() ; |
| | | |
| | | |
| | | /*** |
| | | * 待测试-数据库数据不足 |
| | | SELECT |
| | | web_site.tb_batt_devdischarge_CM.num, |
| | | web_site.tb_batt_devdischarge_CM.dev_id, |
| | | web_site.tb_batt_devdischarge_CM.dev_name, |
| | | web_site.tb_batt_devdischarge_CM.dev_recordtime, |
| | | web_site.tb_batt_devdischarge_CM.dev_vol, |
| | | web_site.tb_batt_devdischarge_CM.dev_curr, |
| | | web_site.tb_batt_devdischarge_CM.dev_power, |
| | | web_site.tb_batt_devdischarge_CM.note, |
| | | web_site.tb_batt_devdischarge_CT.num, |
| | | web_site.tb_batt_devdischarge_CT.dev_id, |
| | | web_site.tb_batt_devdischarge_CT.dev_name, |
| | | web_site.tb_batt_devdischarge_CT.dev_recordtime, |
| | | web_site.tb_batt_devdischarge_CT.dev_vol, |
| | | web_site.tb_batt_devdischarge_CT.dev_curr, |
| | | web_site.tb_batt_devdischarge_CT.dev_power, |
| | | web_site.tb_batt_devdischarge_CT.note, |
| | | web_site.tb_batt_devdischarge_CU.num, |
| | | web_site.tb_batt_devdischarge_CU.dev_id, |
| | | web_site.tb_batt_devdischarge_CU.dev_name, |
| | | web_site.tb_batt_devdischarge_CU.dev_recordtime, |
| | | web_site.tb_batt_devdischarge_CU.dev_vol, |
| | | web_site.tb_batt_devdischarge_CU.dev_curr, |
| | | web_site.tb_batt_devdischarge_CU.dev_power, |
| | | web_site.tb_batt_devdischarge_CU.note, |
| | | DISTINCTbattinf.FBSDeviceName "" |
| | | FROM |
| | | web_site.tb_batt_devdischarge_CM, |
| | | ( |
| | | SELECT DISTINCT |
| | | (FBSdeviceid), |
| | | FBSDeviceName |
| | | FROM |
| | | db_battinf.tb_battinf |
| | | WHERE |
| | | stationid LIKE concat('%1%') |
| | | ) AS DISTINCTbattinf, |
| | | web_site.tb_batt_devdischarge_CT, |
| | | web_site.tb_batt_devdischarge_CU |
| | | WHERE |
| | | DISTINCTbattinf.FBSdeviceid = tb_batt_devdischarge_CM.dev_id |
| | | AND tb_batt_devdischarge_CT.dev_id = tb_batt_devdischarge_CM.dev_id |
| | | AND tb_batt_devdischarge_CU.dev_id = tb_batt_devdischarge_CM.dev_id |
| | | AND tb_batt_devdischarge_CT.record_num = web_site.tb_batt_devdischarge_CM.record_num |
| | | AND tb_batt_devdischarge_CU.record_num = web_site.tb_batt_devdischarge_CM.record_num |
| | | AND web_site.tb_batt_devdischarge_CM.dev_recordtime >= '2017-05-16 19:48:32' |
| | | AND web_site.tb_batt_devdischarge_CM.dev_recordtime <= ('2017-05-16 19:48:32') |
| | | AND ( |
| | | tb_batt_devdischarge_CM.record_num % 1 = 0 |
| | | OR tb_batt_devdischarge_CM.record_num =1 |
| | | OR tb_batt_devdischarge_CM.record_num =1 |
| | | ) |
| | | ORDER BY |
| | | web_site.tb_batt_devdischarge_CM.dev_id, |
| | | web_site.tb_batt_devdischarge_CM.dev_recordtime; |
| | | * |
| | | */ |
| | | //10.1根据设备id连battinf和batt_devdischarge表 |
| | | /* |
| | | * 记录时间放在battinf的battproducer |
| | | **/ |
| | | public List serchByCondition(Object obj); |
| | | public List serchByCondition(BattInf obj); |
| | | |
| | | //查询tb_batt_devdischarge_CM最大最小num和总num |
| | | public List serchMaxAndMinNum(Object obj); |
| | | @Select(" SELECT COUNT(tb_batt_devdischarge_CM.record_num) AS number,MAX(tb_batt_devdischarge_CM.record_num) AS maxnum,MIN(tb_batt_devdischarge_CM.record_num) AS minnum " + |
| | | "FROM web_site.tb_batt_devdischarge_CM,(select DISTINCT(FBSdeviceid),FBSDeviceName from db_battinf.tb_battinf where stationid=#{stationId}) as DISTINCTbattinf "+ |
| | | " WHERE DISTINCTbattinf.FBSdeviceid=tb_batt_devdischarge_CM.dev_id and web_site.tb_batt_devdischarge_CM.dev_recordtime >= #{battProductDate} and web_site.tb_batt_devdischarge_CM.dev_recordtime <= #{battProductDate} LIMIT 1") |
| | | public List<Batt_Devdischarge> serchMaxAndMinNum(BattInf obj); |
| | | |
| | | /*public static void main(String[] args) throws ParseException { |
| | | Batt_DevdischargeImpl bimpl=new Batt_DevdischargeImpl(); |
| | |
| | | /* |
| | | * 记录时间放在battinf的battproducer |
| | | * 统计方式放在SignalName*/ |
| | | public List serchByCondition(BattInf obj); |
| | | |
| | | // @Select("select num,dev_id,dev_name,dev_recordtime,dev_electricity_CM,dev_electricity_CT,dev_electricity_CU,note from web_site.tb_batt_electricity limit 10 ") |
| | | @Select("select num,dev_id,dev_name,dev_recordtime,dev_electricity_CM,dev_electricity_CT,dev_electricity_CU,note " + |
| | | "from web_site.tb_batt_electricity ,(select DISTINCT(FBSdeviceid) from db_battinf.tb_battinf where stationid=#{stationId} ) as DISTINCTbattinf " + |
| | | "where DISTINCTbattinf.FBSdeviceid=tb_batt_electricity.dev_id and to_days(tb_batt_electricity.dev_recordtime)>=to_days(#{battProductDate}) and to_days(tb_batt_electricity.dev_recordtime)<=to_days(#{battProductDate1}) ORDER BY dev_id ,dev_recordtime ") |
| | | public List<Batt_electricity> serchByCondition(BattInf obj); |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.fgkj.dto.Batt_history; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | public interface Batt_historyMapper{ |
| | |
| | | public List searchAll(); |
| | | |
| | | //查询所有的历史实时数据 |
| | | public List serchByCondition(Object obj); |
| | | |
| | | public List<Batt_history> serchByCondition(Batt_history obj); |
| | | } |
| | |
| | | |
| | | import com.fgkj.dto.Batt_param_low; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | public interface Batt_param_lowMapper{ |
| | | |
| | | public boolean add(Object obj); |
| | | |
| | | public boolean update(Object obj); |
| | | @Update("update web_site.tb_batt_param_low set low_value=#{low_value},low_method=#{low_method} where low_type=#{low_type} and low_nametype=#{low_nametype}") |
| | | public int update(Batt_param_low obj); |
| | | |
| | | //修改 |
| | | public boolean del(Object obj); |
| | |
| | | |
| | | |
| | | //实时监测<-------跨域-----------> |
| | | public List<Batt_rtdata> serchByCondition_ky(Batt_rtdata obj); |
| | | public List serchByCondition_ky(Batt_rtdata obj); |
| | | |
| | | /*public static void main(String[] args) { |
| | | Batt_rtdataMapper bimpl=new Batt_rtdataMapper(); |
| | |
| | | |
| | | //测试数据——实时查询中左下角的充放电统计(旧) |
| | | public List serchDisOrChargr(); |
| | | |
| | | |
| | | // @Select(" SELECT distinct db_ram_db.tb_batt_rtstate.battgroupid " |
| | | // + ",batt_test_type,stationid,fbsdeviceid,stationName,stationName1,stationName2,stationName3,stationName4,stationName5 " + |
| | | // " from db_ram_db.tb_batt_rtstate,db_battinf.tb_battinf ") |
| | | //测试数据——实时查询中左下角的充放电统计(用户管理的机房) |
| | | public List serchDisOrChargrNew(User_inf obj); |
| | | @Select(" SELECT distinct db_ram_db.tb_batt_rtstate.battgroupid " |
| | | + ",batt_test_type,stationid,fbsdeviceid,stationName,stationName1,stationName2,stationName3,stationName4,stationName5 " + |
| | | " from db_ram_db.tb_batt_rtstate,db_battinf.tb_battinf " + |
| | | " where batt_test_type IN(2,3) " + |
| | | " and db_ram_db.tb_batt_rtstate.battgroupid=db_battinf.tb_battinf.BattGroupId " + |
| | | " and db_ram_db.tb_batt_rtstate.BattGroupId in(select distinct db_battinf.tb_battinf.battgroupid " + |
| | | " from db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf " + |
| | | " where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " + |
| | | " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + |
| | | " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " + |
| | | " and db_user.tb_user_inf.uid=#{UId} ) " + |
| | | " ORDER BY db_ram_db.tb_batt_rtstate.battgroupid") |
| | | public List<Batt_rtstate> serchDisOrChargrNew(User_inf obj); |
| | | |
| | | //根据电池组id查询该电池组(电池续航能力) |
| | | public List<Batt_State> serchByInfo(BattInf obj); |
| | |
| | | package com.fgkj.mapper.impl; |
| | | |
| | | import com.fgkj.dto.BattInf; |
| | | import com.fgkj.dto.BattMap_information; |
| | | import com.fgkj.dto.Battalarm_data; |
| | | import com.fgkj.mapper.AlarmDaoFactory; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | |
| | | public boolean addPro(Object obj); |
| | | |
| | | //9.1根据机房信息查询该机房实时告警总数 |
| | | public int serchByStationId(Object obj); |
| | | @Select("select count(num) as nums from db_alarm.tb_battalarm_data " + |
| | | "where battgroupid in (select distinct battgroupid from db_battinf.tb_battinf where stationid=#{StationId} ) " + |
| | | "and alm_cleared_type=0 and alm_id not in(${@com.fgkj.mapper.AlarmDaoFactory@Alarm_CapAlarm},${@com.fgkj.mapper.AlarmDaoFactory@Alarm_CapChange},${@com.fgkj.mapper.AlarmDaoFactory@Alarm_res_Conn},${@com.fgkj.mapper.AlarmDaoFactory@ALM_TYPE_DisChargeMonVol_ID}) limit 1 ") |
| | | public int serchByStationId(BattMap_information obj); |
| | | |
| | | //9.1根据站点信息(stationName3)查询该机房实时告警总数 |
| | | public int serchBystationName3(Object obj); |
| | | |
| | | //9.1根据机房stationid查询机房下电池组单体告警情况 |
| | | public String serchMonAlarm(Object obj); |
| | | @Select(" select battgroupid,GROUP_CONCAT(DISTINCT monnum) as monnums from db_alarm.tb_battalarm_data " + |
| | | " where battgroupid =#{battGroupId} and alm_cleared_type=0 GROUP BY battgroupid limit 1") |
| | | public List<Battalarm_data> serchMonAlarm(BattInf obj); |
| | | |
| | | //7.2落后单体筛选出来后,往告警表添加前的判断 |
| | | public int judge(Object obj); |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.fgkj.dto.Task_Batt_Test; |
| | | import com.fgkj.dto.User_task_change; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | public interface User_task_changeMapper{ |
| | | |
| | | //4.1作业变更申请 |
| | | public boolean add(Object obj) ; |
| | | public boolean add(User_task_change obj) ; |
| | | //4.5作业变更查询(审批) |
| | | public boolean update(Object obj) ; |
| | | public boolean update(User_task_change obj) ; |
| | | //4.5作业变更查询(删除记录) |
| | | public boolean del(Object obj) ; |
| | | public boolean del(User_task_change obj) ; |
| | | |
| | | public List searchAll() ; |
| | | //4.5作业变更查询 |
| | | public List serchByCondition1(Object obj) ; |
| | | //4.5作业变更查询 |
| | | @SuppressWarnings("unchecked") |
| | | public List serchByCondition(Object obj) ; |
| | | } |
| | | public List serchByCondition(Task_Batt_Test obj) ; |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.fgkj.dto.User_task_param; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | public interface User_task_paramMapper{ |
| | | |
| | | //4.2作业参数(新增作业参数) |
| | | public boolean add(Object obj) ; |
| | | public boolean add(User_task_param obj) ; |
| | | //4.2作业参数(修改操作/重命名操作) |
| | | public boolean update(Object obj) ; |
| | | |
| | | public String updatePro(Object obj); |
| | | |
| | | //4.2作业参数(删除) |
| | | public boolean del(Object obj) ; |
| | | public boolean update(User_task_param obj) ; |
| | | |
| | | @Update("update db_user.tb_user_task_param set tp_name=#{tp_name},tp_taskname=#{tp_name},tp_tasktype=#{tp_tasktype},tp_autoinc_daycount=#{tp_autoinc_daycount}," + |
| | | "tp_taskdelay_daycount=#{tp_taskdelay_daycount},tp_pass_saturday=#{tp_pass_saturday},tp_pass_sunday=#{tp_pass_sunday},tp_pass_jiejiari=#{tp_pass_jiejiari},tp_task_notice_count=#{tp_task_notice_count}," + |
| | | "tp_task_notice_time_interval=#{tp_task_notice_time_interval},tp_task_notice_starttime=#{tp_task_notice_starttime},tp_task_notice_endtime=#{tp_task_notice_endtime},tp_task_enabled=#{tp_task_enabled}," + |
| | | "tp_master_id=#{tp_master_id},tp_notice_master_enabled=#{tp_notice_master_enabled},tp_task_battlife_var=#{tp_task_battlife_var},tp_task_battyong_test80_month=#{tp_task_battyong_test80_month}," + |
| | | "tp_task_battold_test80_month=#{tp_task_battold_test80_month},tp_task_battyong_test40_month=#{tp_task_battyong_test40_month},tp_task_battold_test40_month=#{tp_task_battold_test40_month}," + |
| | | "tp_task_batt_checkcircle_month=#{tp_task_batt_checkcircle_month},tp_task_batt_checklimit_month=#{tp_task_batt_checklimit_month},tp_task_batt_lazhacircle_month=#{tp_task_batt_lazhacircle_month}," + |
| | | "tp_task_batt_lazhalimit_month=#{tp_task_batt_lazhalimit_month} where tp_num=#{tp_num}") |
| | | public int updatePro(User_task_param obj); |
| | | /*4.2作业参数(删除)*/ |
| | | @Delete("delete from db_user.tb_user_task_param where tp_num=#{tp_num}") |
| | | public int del(User_task_param obj) ; |
| | | //4.2查询所有参数种类 |
| | | public List searchAll() ; |
| | | @Select("select tp_num,tp_name,tp_taskname,tp_tasktype,tp_autoinc_daycount,tp_taskdelay_daycount," + |
| | | "tp_pass_saturday,tp_pass_sunday,tp_pass_jiejiari,tp_task_notice_count,tp_task_notice_time_interval,tp_task_notice_starttime," + |
| | | "tp_task_notice_endtime,tp_task_enabled,tp_master_id,tp_notice_master_enabled,tp_task_battlife_var,tp_task_battyong_test80_month," + |
| | | "tp_task_battold_test80_month,tp_task_battyong_test40_month,tp_task_battold_test40_month,tp_task_batt_checkcircle_month,tp_task_batt_checklimit_month," + |
| | | "tp_task_batt_lazhacircle_month,tp_task_batt_lazhalimit_month from db_user.tb_user_task_param order by tp_num") |
| | | public List<User_task_param> searchAll() ; |
| | | //4.2根据参数id查基本参数和模板参数 |
| | | public List serchByCondition(Object obj); |
| | | @Select("select tp_num,tp_name,tp_taskname,tp_tasktype,tp_autoinc_daycount,tp_taskdelay_daycount," + |
| | | "tp_pass_saturday,tp_pass_sunday,tp_pass_jiejiari,tp_task_notice_count,tp_task_notice_time_interval,tp_task_notice_starttime," + |
| | | "tp_task_notice_endtime,tp_task_enabled,tp_master_id,tp_notice_master_enabled,tp_task_battlife_var,tp_task_battyong_test80_month," + |
| | | "tp_task_battold_test80_month,tp_task_battyong_test40_month,tp_task_battold_test40_month,tp_task_batt_checkcircle_month,tp_task_batt_checklimit_month," + |
| | | "tp_task_batt_lazhacircle_month,tp_task_batt_lazhalimit_month from db_user.tb_user_task_param where tp_num=#{tp_num}") |
| | | public List<User_task_param> serchByCondition(User_task_param obj); |
| | | |
| | | public List serchByInfo(Object obj) ; |
| | | |
| | |
| | | } |
| | | //删除电池组 |
| | | public ServiceModel delete(List<BattInf> list) { |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | ServiceModel model = new ServiceModel(); |
| | | boolean flag = true; |
| | | if(list!=null&&list.size()>0){ |
| | | for (int i = 0; i < list.size(); i++) { |
| | | BattInf binf=list.get(i); |
| | | if (mapper.del(binf)>0) { |
| | | flag = !false; |
| | | flag = true; |
| | | }else{ |
| | | flag = false; |
| | | } |
| | |
| | | } |
| | | |
| | | if(flag){ |
| | | dataSourceTransactionManager.commit(transactionStatus); |
| | | /*//将主程序的服务设为重启 |
| | | Process_survey process=new Process_survey(); |
| | | process.setProcessName(ProcessServerDao.BMS_FBSDEV); |
| | |
| | | model.setMsg("删除成功!"); |
| | | } |
| | | else{ |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | model.setCode(0); |
| | | model.setMsg("删除失败!"); |
| | | } |
| | |
| | | package com.fgkj.services; |
| | | |
| | | import com.fgkj.dto.BattInf; |
| | | import com.fgkj.dto.BattMap_information; |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.dto.User_inf; |
| | | import com.fgkj.dto.*; |
| | | import com.fgkj.mapper.impl.*; |
| | | import com.fgkj.mapper.impl.ram.Fbs9100_stateMapper; |
| | | import com.fgkj.util.ActionUtil; |
| | |
| | | ServiceModel model = new ServiceModel(); |
| | | |
| | | //9.1录入机房信息 |
| | | public ServiceModel add(Object obj){ |
| | | Boolean bl=mapper.add(obj); |
| | | public ServiceModel add(BattMap_information obj){ |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.add(obj)>0; |
| | | if(bl){ |
| | | model.setCode(1); |
| | | model.setMsg("添加成功!"); |
| | |
| | | } |
| | | |
| | | //9.1录入机房信息 |
| | | public ServiceModel addDev(Object obj){ |
| | | Boolean bl=mapper.addDev(obj); |
| | | public ServiceModel addDev(BattMap_information obj){ |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.addDev(obj)>0; |
| | | if(bl){ |
| | | model.setCode(1); |
| | | model.setMsg("添加成功!"); |
| | |
| | | } |
| | | return model; |
| | | } |
| | | public ServiceModel update(Object obj){ |
| | | Boolean bl=mapper.update(obj); |
| | | public ServiceModel update(BattMap_information obj){ |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.update(obj)>0; |
| | | if(bl){ |
| | | model.setCode(1); |
| | | model.setMsg("修改成功!"); |
| | |
| | | } |
| | | |
| | | //从地图上删除定位信息 |
| | | public ServiceModel del(Object obj){ |
| | | Boolean bl=mapper.del(obj); |
| | | public ServiceModel del(BattMap_information obj){ |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.del(obj)>0; |
| | | if(bl){ |
| | | model.setCode(1); |
| | | model.setMsg("删除成功!"); |
| | |
| | | List listAll=new ArrayList();//存放最后的结果 |
| | | if(list!=null&&list.size()>0){ |
| | | for(int i=0;i<list.size();i++){ |
| | | ServiceModel model=new ServiceModel(); |
| | | ServiceModelElectri model = new ServiceModelElectri(); |
| | | BattMap_information binformation=list.get(i); |
| | | int numAlarm=battAlarmDataMapper.serchByStationId(binformation); |
| | | int numBadBatt=badBattMonMapper.serchByStationId(binformation); |
| | | int numPlan=battDischargePlanMapper.serchByStationId(binformation); |
| | | model.setData(list.get(i)); |
| | | //TODO perry |
| | | // model.setCode(numAlarm); //告警总数 |
| | | // model.setSum(numBadBatt); //落后总数 |
| | | // model.setNewsum(numPlan); //延时总数 |
| | | model.setCode(numAlarm); //告警总数 |
| | | model.setSum(numBadBatt); //落后总数 |
| | | model.setNewsum(numPlan); //延时总数 |
| | | listAll.add(model); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //9.1百度地图定位根据省份查询所有该区域的机房 |
| | | public List serchByCondition(Object obj){ |
| | | public List serchByCondition(BattMap_information obj){ |
| | | List<BattMap_information> list =mapper.serchByCondition(obj); |
| | | System.out.println("list = " + list); |
| | | |
| | | List listAll=new ArrayList();//存放最后的结果 |
| | | if(list!=null&&list.size()>0){ |
| | | for(int i=0;i<list.size();i++){ |
| | | ServiceModel model=new ServiceModel(); |
| | | ServiceModelElectri model=new ServiceModelElectri(); |
| | | BattMap_information binformation=list.get(i); |
| | | System.out.println("binformation = " + binformation); |
| | | int numAlarm=battAlarmDataMapper.serchByStationId(binformation); |
| | | int numBadBatt=badBattMonMapper.serchByStationId(binformation); |
| | | int numPlan=battDischargePlanMapper.serchByStationId(binformation); |
| | | //TODO perry |
| | | // model.setData(list.get(i)); |
| | | // model.setCode(numAlarm); //告警总数 |
| | | // model.setSum(numBadBatt); //落后总数 |
| | | // model.setNewsum(numPlan); //延时总数 |
| | | model.setData(list.get(i)); |
| | | model.setCode(numAlarm); //告警总数 |
| | | model.setSum(numBadBatt); //落后总数 |
| | | model.setNewsum(numPlan); //延时总数 |
| | | listAll.add(model); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //9.1机房详情显示机房具体落后和告警的信息(机房信息内容画图) |
| | | public List serchMonNum(Object obj){ |
| | | List<BattInf> list=battInfMapper.serchMonNum(obj); |
| | | List listAll=new ArrayList();//存放指定机房的信息 |
| | | if(list!=null&&list.size()>0){ |
| | | for(int i=0;i<list.size();i++){ |
| | | BattInf binf=list.get(i); |
| | | ServiceModel model=new ServiceModel(); |
| | | public List serchMonNum(BattMap_information obj) { |
| | | List<BattInf> list = battInfMapper.serchMonNum(obj); |
| | | List listAll = new ArrayList();//存放指定机房的信息 |
| | | if (list != null && list.size() > 0) { |
| | | for (int i = 0; i < list.size(); i++) { |
| | | BattInf binf = list.get(i); |
| | | ServiceModelElectri model = new ServiceModelElectri(); |
| | | model.setCode(binf.getMonCount());//电池组单体个数 |
| | | //TODO perry |
| | | // model.setNewsum(binf.getBattGroupId()); |
| | | // model.setMsg(binf.getBattGroupName());//电池组名称 |
| | | // String monBads=badBattMonMapper.serchMonBad(binf); |
| | | // String monAlarms=battAlarmDataMapper.serchMonAlarm(binf); |
| | | // model.setMsgN(monBads); |
| | | // model.setMsgO(monAlarms); |
| | | listAll.add(model); |
| | | model.setNewsum(binf.getBattGroupId()); |
| | | model.setMsg(binf.getBattGroupName());//电池组名称 |
| | | List<BadBatt_mon> listb = badBattMonMapper.serchMonBad(binf); |
| | | |
| | | String monBads = "";//存放指定电池组落后单体信息 |
| | | if (listb != null && listb.size() > 0) { |
| | | monBads = listb.get(listb.size() - 1).getNote(); |
| | | } |
| | | List<Battalarm_data> listbd = battAlarmDataMapper.serchMonAlarm(binf); |
| | | |
| | | String monAlarms = "";//存放指定电池组告警单体信息 |
| | | if (listbd != null && listbd.size() > 0) { |
| | | monAlarms = listbd.get(listbd.size() - 1).getNote(); |
| | | } |
| | | model.setMsgN(monBads); |
| | | model.setMsgO(monAlarms); |
| | | listAll.add(model); |
| | | } |
| | | } |
| | | return listAll; |
| | |
| | | return model; |
| | | } |
| | | //9.1地图上根据维护区查询机房经纬度 |
| | | public ServiceModel serchByInfo(Object obj) { |
| | | public ServiceModel serchByInfo(BattMap_information obj) { |
| | | ServiceModel model = new ServiceModel(); |
| | | List list=mapper.serchByInfo(obj); |
| | | if(list!=null&&list.size()>0){ |
| | | model.setCode(1); |
| | |
| | | @Resource |
| | | private Batt_DevdischargeMapper mapper;; |
| | | |
| | | //TODO 数据库名未找到 |
| | | public ServiceModel add(Batt_Devdischarge bd){ |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.add(bd)>0; |
| | |
| | | } |
| | | public ServiceModel update(Batt_Devdischarge obj){ |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.update(obj); |
| | | Boolean bl=mapper.update(obj)>0; |
| | | if(bl){ |
| | | model.setCode(1); |
| | | model.setMsg("修改成功!"); |
| | |
| | | } |
| | | public ServiceModel del(Batt_Devdischarge obj){ |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.del(obj); |
| | | Boolean bl=mapper.del(obj)>0; |
| | | if(bl){ |
| | | model.setCode(1); |
| | | model.setMsg("删除成功!"); |
| | |
| | | * MonCount:当前页 |
| | | * MonNum :页面的大小 |
| | | */ |
| | | public ServiceModel serchByCondition(Object obj){ |
| | | public ServiceModel serchByCondition(BattInf obj){ |
| | | ServiceModel model = new ServiceModel(); |
| | | BattInf binf=(BattInf) obj; |
| | | binf.setNum(0); |
| | | binf.setMonCount(0); |
| | | binf.setMonNum(0); |
| | | List<Batt_Devdischarge> listN=mapper.serchMaxAndMinNum(binf); |
| | | System.out.println("listN = " + listN); |
| | | //TODO 待测试-数据库数据不足 |
| | | if(listN!=null&&listN.size()>0){ |
| | | float number=listN.get(listN.size()-1).getDev_curr(); |
| | | float maxnum=listN.get(listN.size()-1).getDev_power(); |
| | |
| | | binf.setNum((int) number); |
| | | binf.setMonCount((int) maxnum); |
| | | binf.setMonNum((int) minnum); |
| | | } |
| | | }//LIMIT 1 只有一条数据 |
| | | List<Batt_Devdischarge_all> list=mapper.serchByCondition(binf); |
| | | //System.out.println(list.size()); |
| | | if(list!=null && list.size()>0){ |
| | |
| | | package com.fgkj.services; |
| | | |
| | | import com.fgkj.dto.BattInf; |
| | | import com.fgkj.dto.Batt_electricity; |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.dto.*; |
| | | import com.fgkj.mapper.impl.Batt_electricityMapper; |
| | | import com.fgkj.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | |
| | |
| | | //10.1根据设备id连battinf和batt_devdischarge表 |
| | | /* |
| | | * 统计方式放在battinf的signalname中*/ |
| | | public List serchByCondition(BattInf obj){ |
| | | List<Batt_electricity> list=mapper.serchByCondition(obj); |
| | | List<ServiceModel> listmodel=new ArrayList<ServiceModel>(); |
| | | List<ServiceModel> last = new LinkedList<>(); |
| | | public List serchByCondition(BattInf obj) { |
| | | List<Batt_electricity> list = mapper.serchByCondition(obj); |
| | | ServiceModelElectri model = new ServiceModelElectri(); |
| | | List<ServiceModelElectri> listmodel = new ArrayList<>(); |
| | | //TODO perry |
| | | /*if (list != null && list.size() > 0) { |
| | | if (list != null && list.size() > 0) { |
| | | for (int i = 0; i < list.size(); i++) { |
| | | // 时间段 |
| | | String perid_Time = ""; |
| | |
| | | perid_Time = ActionUtil.getFirstDayOfMonth(year, 0); |
| | | perid_Time += " "; |
| | | perid_Time += ActionUtil.getLastDayOfMonth(year, 11); |
| | | month=0; |
| | | month = 0; |
| | | } |
| | | model = new ServiceModel(); |
| | | model.setCode(year); |
| | | model.setMsgN(perid_Time); // 时间段 |
| | | model.setSum(month); // 所有的电度统计次数 |
| | | |
| | | |
| | | |
| | | |
| | | model.setNewsum(list.get(i).getDev_id());//设备id |
| | | model.setMsg(list.get(i).getDev_name());//设备名称 |
| | | |
| | | |
| | | model.setLowCA(list.get(i).getDev_electricity_CM()); |
| | | model.setLowCH(list.get(i).getDev_electricity_CT()); |
| | | model.setLowRA(list.get(i).getDev_electricity_CU()); |
| | | |
| | | |
| | | model.setMsgO("");// |
| | | model.setMsgV("");// |
| | | listmodel.add(model); |
| | |
| | | model.setMsgN("0"); |
| | | listmodel.add(model); |
| | | } |
| | | |
| | | ServiceModel lastModel=new ServiceModel(); |
| | | |
| | | ServiceModelElectri lastModel = new ServiceModelElectri(); |
| | | lastModel.setMsgN("0"); |
| | | lastModel.setCode(model.getCode()); |
| | | lastModel.setMsg(model.getMsg()); |
| | |
| | | lastModel.setMsgO(model.getMsgO()); |
| | | lastModel.setMsgV(model.getMsgV()); |
| | | listmodel.add(lastModel);//补全第一次一次时间改变 |
| | | float numCA=0f;//移动电度 |
| | | float numCH=0f;//联通电度 |
| | | float numRA=0f;//电信电度 |
| | | String time="";//时间段统计 |
| | | int dev_id=0;//设备id |
| | | ServiceModel sumModel=null; |
| | | float numCA = 0f;//移动电度 |
| | | float numCH = 0f;//联通电度 |
| | | float numRA = 0f;//电信电度 |
| | | String time = "";//时间段统计 |
| | | int dev_id = 0;//设备id |
| | | ServiceModel sumModel = null; |
| | | // for (ServiceModel m : listmodel) { |
| | | // System.out.println(m.getMsgN()+" "+m.getNewsum()+" "+m.getLowCA()+" "+m.getLowCH()+" "+m.getLowRA()); |
| | | // } |
| | | List<ServiceModel> last=new ArrayList<ServiceModel>(); |
| | | for (int i=0;i<listmodel.size();i++) { |
| | | time=listmodel.get(i).getMsgN(); |
| | | dev_id=listmodel.get(i).getNewsum(); |
| | | numCA+=listmodel.get(i).getLowCA(); |
| | | numCH+=listmodel.get(i).getLowCH(); |
| | | numRA+=listmodel.get(i).getLowRA(); |
| | | if((i+1)<listmodel.size()){ |
| | | if(listmodel.get(i+1).getNewsum()==dev_id){ |
| | | if(!listmodel.get(i+1).getMsgN().equals(time)){ |
| | | ServiceModel newModel=new ServiceModel(); |
| | | newModel.setCode(listmodel.get(i).getCode()); |
| | | newModel.setMsgN(listmodel.get(i).getMsgN()); |
| | | newModel.setMsg(listmodel.get(i).getMsg()); |
| | | newModel.setNewsum(listmodel.get(i).getNewsum()); |
| | | newModel.setSum(listmodel.get(i).getSum()); |
| | | newModel.setLowCA(numCA); |
| | | newModel.setLowCH(numCH); |
| | | newModel.setLowRA(numRA); |
| | | numCA=0f; |
| | | numCH=0f; |
| | | numRA=0f; |
| | | last.add(newModel); |
| | | } |
| | | }else{ |
| | | ServiceModel newModel=new ServiceModel(); |
| | | newModel.setCode(listmodel.get(i).getCode()); |
| | | newModel.setMsgN(listmodel.get(i).getMsgN()); |
| | | newModel.setMsg(listmodel.get(i).getMsg()); |
| | | newModel.setNewsum(listmodel.get(i).getNewsum()); |
| | | newModel.setSum(listmodel.get(i).getSum()); |
| | | newModel.setLowCA(numCA); |
| | | newModel.setLowCH(numCH); |
| | | newModel.setLowRA(numRA); |
| | | numCA=0f; |
| | | numCH=0f; |
| | | numRA=0f; |
| | | last.add(newModel); |
| | | } |
| | | |
| | | } |
| | | |
| | | }*/ |
| | | List<ServiceModelElectri> last=new ArrayList<>(); |
| | | for (int i = 0; i < listmodel.size(); i++) { |
| | | time = listmodel.get(i).getMsgN(); |
| | | dev_id = listmodel.get(i).getNewsum(); |
| | | numCA += listmodel.get(i).getLowCA(); |
| | | numCH += listmodel.get(i).getLowCH(); |
| | | numRA += listmodel.get(i).getLowRA(); |
| | | if ((i + 1) < listmodel.size()) { |
| | | if (listmodel.get(i + 1).getNewsum() == dev_id) { |
| | | if (!listmodel.get(i + 1).getMsgN().equals(time)) { |
| | | ServiceModelElectri newModel = new ServiceModelElectri(); |
| | | newModel.setCode(listmodel.get(i).getCode()); |
| | | newModel.setMsgN(listmodel.get(i).getMsgN()); |
| | | newModel.setMsg(listmodel.get(i).getMsg()); |
| | | newModel.setNewsum(listmodel.get(i).getNewsum()); |
| | | newModel.setSum(listmodel.get(i).getSum()); |
| | | newModel.setLowCA(numCA); |
| | | newModel.setLowCH(numCH); |
| | | newModel.setLowRA(numRA); |
| | | numCA = 0f; |
| | | numCH = 0f; |
| | | numRA = 0f; |
| | | last.add(newModel); |
| | | } |
| | | } else { |
| | | ServiceModelElectri newModel = new ServiceModelElectri(); |
| | | newModel.setCode(listmodel.get(i).getCode()); |
| | | newModel.setMsgN(listmodel.get(i).getMsgN()); |
| | | newModel.setMsg(listmodel.get(i).getMsg()); |
| | | newModel.setNewsum(listmodel.get(i).getNewsum()); |
| | | newModel.setSum(listmodel.get(i).getSum()); |
| | | newModel.setLowCA(numCA); |
| | | newModel.setLowCH(numCH); |
| | | newModel.setLowRA(numRA); |
| | | numCA = 0f; |
| | | numCH = 0f; |
| | | numRA = 0f; |
| | | last.add(newModel); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | return last; |
| | | } |
| | | } |
| | | |
| | | /*public static void main(String[] args) throws ParseException { |
| | | Batt_electricityImpl bimpl=new Batt_electricityImpl(); |
| | |
| | | import com.fgkj.dto.Batt_history; |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.mapper.impl.Batt_historyMapper; |
| | | import com.fgkj.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | return model; |
| | | } |
| | | //查询所有的历史实时数据 |
| | | public ServiceModel serchByCondition(Object obj){ |
| | | // TODO tb_batt_realdata_1000003_2020_09 ip222 参数对不上 |
| | | // tb_batt_910000001_2017_12 |
| | | |
| | | //TODO 数据库表格字段不一致 使用这个表名测试 db_batt_history.tb_batt_910000001_2017_12 |
| | | |
| | | /** |
| | | * { |
| | | * "dev_id": 910000001, |
| | | * "battGroupId": 1005059, |
| | | * "rec_datetime": "2017-12-29 09:28:31", |
| | | * "rec_datetime1": "2018-12-29 09:28:31" |
| | | * } |
| | | * @param obj |
| | | * @return |
| | | */ |
| | | public ServiceModel serchByCondition(Batt_history obj){ |
| | | int year= ActionUtil.getDateYear(obj.getRec_datetime()); |
| | | int month=ActionUtil.getDateMonth(obj.getRec_datetime()); |
| | | // String tbname = "tb_batt_"; |
| | | String tbnamesuffix = ""; |
| | | tbnamesuffix+=obj.getDev_id()+"_"+year+"_"+month; |
| | | System.out.println("tbnamesuffix = " + tbnamesuffix); |
| | | obj.setTbname(tbnamesuffix); |
| | | // obj.setTbname("910000001_2017_12");//TODO 测试用表名后缀 |
| | | List list=mapper.serchByCondition(obj); |
| | | if(list!=null && list.size()>0){ |
| | | model.setCode(1); |
| | |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.mapper.impl.Batt_param_lowMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.TransactionDefinition; |
| | | import org.springframework.transaction.TransactionStatus; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private Batt_param_lowMapper mapper;; |
| | | @Autowired |
| | | DataSourceTransactionManager dataSourceTransactionManager; |
| | | @Autowired |
| | | TransactionDefinition transactionDefinition; |
| | | |
| | | public ServiceModel add(Object obj) { |
| | | Boolean bl=mapper.add(obj); |
| | |
| | | return model; |
| | | |
| | | } |
| | | public ServiceModel update(Object obj) { |
| | | Boolean bl=mapper.update(obj); |
| | | if(bl){ |
| | | public ServiceModel update(List<Batt_param_low> list) { |
| | | ServiceModel model = new ServiceModel(); |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | Boolean bl = true; |
| | | for (int i = 0; i < list.size(); i++) { |
| | | if (!(mapper.update(list.get(i)) > 0)) { |
| | | bl = false; |
| | | } |
| | | } |
| | | if (bl) { |
| | | dataSourceTransactionManager.commit(transactionStatus); |
| | | model.setCode(1); |
| | | model.setMsg("修改成功!"); |
| | | } |
| | | else{ |
| | | } else { |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | model.setMsg("修改失败!"); |
| | | } |
| | | return model; |
| | | return model; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | public ServiceModel searchAll(){ |
| | | ServiceModel model = new ServiceModel(); |
| | | List<Batt_param_low> list=mapper.searchAll(); |
| | | //System.out.println(list); |
| | | if(list!=null && list.size()>0){ |
| | |
| | | //电池组实时情况+实时电池续航能力查询 |
| | | public ServiceModel serchBattLife(Batt_Maint_Dealarm obj){ |
| | | ServiceModel model = new ServiceModel(); |
| | | PageBean pageBean = obj.getPageBean(); |
| | | pageBean.setPageAll((pageBean.getPageCurr()-1)*pageBean.getPageSize());//使用临时变量存储limit x,x 第二个参数 |
| | | System.out.println("pageBean.getPageAll = " + pageBean.getPageAll()); |
| | | obj.setPageBean(pageBean); |
| | | List<Batt_State> list=mapper.serchBattLife(obj); |
| | | if(list!=null&&list.size()>0){ |
| | | model.setCode(1); |
| | |
| | | |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.dto.Task_Batt_Test; |
| | | import com.fgkj.dto.User_task_change; |
| | | import com.fgkj.mapper.TestDaoFactory; |
| | | import com.fgkj.mapper.UtilityFactory; |
| | | import com.fgkj.mapper.impl.User_task_changeMapper; |
| | |
| | | private User_task_changeMapper mapper; |
| | | |
| | | //4.1作业变更申请 |
| | | public ServiceModel add(Object obj) { |
| | | public ServiceModel add(User_task_change obj) { |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.add(obj); |
| | | if(bl){ |
| | |
| | | |
| | | } |
| | | //4.5作业变更查询(审批) |
| | | public ServiceModel update(Object obj) { |
| | | public ServiceModel update(User_task_change obj) { |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.update(obj); |
| | | if(bl){ |
| | |
| | | return model; |
| | | } |
| | | //4.5作业变更查询(删除记录) |
| | | public ServiceModel delete(Object obj) { |
| | | public ServiceModel delete(User_task_change obj) { |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.del(obj); |
| | | if(bl){ |
| | |
| | | return model; |
| | | } |
| | | //4.5作业变更查询 |
| | | public ServiceModel serchByCondition(Object obj){ |
| | | public ServiceModel serchByCondition(Task_Batt_Test obj) { |
| | | ServiceModel model = new ServiceModel(); |
| | | List<Task_Batt_Test> list=mapper.serchByCondition(obj); |
| | | if(list!=null&&list.size()>0){ |
| | | for(int i=0;i<list.size();i++){ |
| | | |
| | | String Uname=UtilityFactory.UidsToUnames(list.get(i).getUchange().getUsr_id().toString()); |
| | | list.get(i).getBinf().setStationName2(Uname); |
| | | |
| | | String Cname=UtilityFactory.UidsToUnames(list.get(i).getUchange().getCopy_uids()); |
| | | list.get(i).getBinf().setStationName3(Cname); |
| | | |
| | | String Aname=UtilityFactory.UidsToUnames(list.get(i).getUchange().getAppoint_uid().toString()); |
| | | list.get(i).getBinf().setStationName4(Aname); |
| | | // System.out.println(Uname+" "+Cname+" "+Aname); |
| | | String task_type= TestDaoFactory.getTaskType(list.get(i).getUchange().getTask_type_id()); |
| | | list.get(i).getBinf().setStationName5(task_type); |
| | | |
| | | String change_type=TestDaoFactory.getChangeType(list.get(i).getUchange().getChange_type_id()); |
| | | list.get(i).getBinf().setStationName6(change_type); |
| | | |
| | | String Oname=UtilityFactory.UidsToUnames(list.get(i).getUchange().getOld_executor_ids()); |
| | | list.get(i).getBinf().setStationName7(Oname); |
| | | |
| | | String Nname=UtilityFactory.UidsToUnames(list.get(i).getUchange().getNew_executor_ids()); |
| | | list.get(i).getBinf().setStationName8(Nname); |
| | | |
| | | String approve_res=TestDaoFactory.getApprove_res(list.get(i).getUchange().getTask_change_approve_res()); |
| | | list.get(i).getBinf().setStationName9(approve_res); |
| | | } |
| | | List<Task_Batt_Test> list = mapper.serchByCondition(obj); |
| | | if (list != null && list.size() > 0) { |
| | | for (int i = 0; i < list.size(); i++) { |
| | | System.out.println("list = " + list.get(i)); |
| | | /*** |
| | | * { |
| | | * utask=null, |
| | | * utest=null, |
| | | * ulist=null, |
| | | * binf=BattInf{ |
| | | * num=null, |
| | | * stationId='null', |
| | | * stationName='山西省-太原市-迎泽区-局机房119-局机房站-1', |
| | | * stationName1='null', |
| | | * stationName2='null', |
| | | * stationName3='null', |
| | | * stationName4='null', |
| | | * stationName5='null', |
| | | * stationName6='null', |
| | | * stationName7='null', |
| | | * stationName8='null', |
| | | * stationName9='null', |
| | | * stationIp='null', |
| | | * fbsDeviceId=null, |
| | | * fbsDeviceIp='null', |
| | | * fbsDeviceIp_YM='null', |
| | | * fbsDeviceIp_WG='null', |
| | | * fbsDeviceIp_old='null', |
| | | * fbsDeviceIp_YM_old='null', |
| | | * fbsDeviceIp_WG_old='null', |
| | | * fbsDeviceName='null', |
| | | * groupIndexInFBSDevice=null, |
| | | * battModel='null', |
| | | * battGroupId=1000001, |
| | | * battGroupNum=null, |
| | | * battGroupName='电池组1', |
| | | * battGroupName1='null', |
| | | * battGroupName2='null', |
| | | * battGroupName3='null', |
| | | * battGroupName4='null', |
| | | * battGroupName5='null', |
| | | * battGroupName6='null', |
| | | * floatVolLevel=null, |
| | | * offlineVolLevel=null, |
| | | * battFloatCurrent=null, |
| | | * deviceId='null', |
| | | * deviceName='null', |
| | | * monCount=null, |
| | | * monCapStd=null, |
| | | * monResStd=null, |
| | | * monSerStd=null, |
| | | * monTmpStd=null, |
| | | * monVolStd=null, |
| | | * monVolLowToAvg=null, |
| | | * monNum=null, |
| | | * battProducer='null', |
| | | * battProductDate=null, |
| | | * battProductDate1=null, |
| | | * battInUseDate=null, |
| | | * battInUseDate1=null, |
| | | * battGuarantDayCount=null, |
| | | * signalId='null', |
| | | * cInterFaceId=null, |
| | | * load_curr=null, |
| | | * disCurrMax=null, |
| | | * signalName='null', |
| | | * startNum=null, |
| | | * size=null, |
| | | * station_phone='null', |
| | | * install_user='null', |
| | | * station_install=null, |
| | | * stationId_ex='null', |
| | | * videoOrImage='null', |
| | | * vol_grade=null, |
| | | * manufacturers='null', |
| | | * assetequipment='null', |
| | | * deviceclasspath='null', |
| | | * deviceoperationdepartment='null', |
| | | * propertyRightUnit='null', |
| | | * propertyAttribute='null', |
| | | * factoryNumber='null', |
| | | * operationTeam='null', |
| | | * deviceIdentityCode='null', |
| | | * projectType='null', |
| | | * batteryApplicationType='null', |
| | | * singleRatedVoltage=null, |
| | | * remoteMonitor='null', |
| | | * batttIndependentPlaced='null', |
| | | * junChargeVoltageValue=null |
| | | * }, |
| | | * ucheck=null, |
| | | * mcheck=null, |
| | | * uchange=User_task_change[ |
| | | * num=1, |
| | | * usr_id=1001, |
| | | * master_id=0, |
| | | * appoint_uid=1001, |
| | | * copy_uids=1001, |
| | | * change_type_id=0, |
| | | * task_type_id=0, |
| | | * task_rc_num=10580, |
| | | * BattgroupId=1000001, |
| | | * change_reason=有新的任务, |
| | | * old_executor_ids=1001, |
| | | * old_task_exe_time=ThuSep0800: 00: 00CST2016, |
| | | * new_executor_ids=0, |
| | | * new_task_exe_time=TueSep0600: 00: 00CST2016, |
| | | * change_ask_time=ThuSep0811: 32: 02CST2016, |
| | | * change_ask_time1=null, |
| | | * change_ask_time_limit=ThuSep0811: 32: 02CST2016, |
| | | * task_change_approve_time=SatOct2217: 13: 55CST2016, |
| | | * task_change_approve_time1=null, |
| | | * task_change_approve_res=1, |
| | | * remark=通过 |
| | | * ], |
| | | * uinf=null, |
| | | * pageBean=null |
| | | * } |
| | | */ |
| | | String Uname = UtilityFactory.UidsToUnames(list.get(i).getUchange().getUsr_id().toString());//TODO 待完成 |
| | | list.get(i).getBinf().setStationName2(Uname); |
| | | |
| | | String Cname = UtilityFactory.UidsToUnames(list.get(i).getUchange().getCopy_uids()); |
| | | list.get(i).getBinf().setStationName3(Cname); |
| | | |
| | | String Aname = UtilityFactory.UidsToUnames(list.get(i).getUchange().getAppoint_uid().toString()); |
| | | list.get(i).getBinf().setStationName4(Aname); |
| | | // System.out.println(Uname+" "+Cname+" "+Aname); |
| | | String task_type = TestDaoFactory.getTaskType(list.get(i).getUchange().getTask_type_id()); |
| | | list.get(i).getBinf().setStationName5(task_type); |
| | | |
| | | String change_type = TestDaoFactory.getChangeType(list.get(i).getUchange().getChange_type_id()); |
| | | list.get(i).getBinf().setStationName6(change_type); |
| | | |
| | | String Oname = UtilityFactory.UidsToUnames(list.get(i).getUchange().getOld_executor_ids()); |
| | | list.get(i).getBinf().setStationName7(Oname); |
| | | |
| | | String Nname = UtilityFactory.UidsToUnames(list.get(i).getUchange().getNew_executor_ids()); |
| | | list.get(i).getBinf().setStationName8(Nname); |
| | | |
| | | String approve_res = TestDaoFactory.getApprove_res(list.get(i).getUchange().getTask_change_approve_res()); |
| | | list.get(i).getBinf().setStationName9(approve_res); |
| | | } |
| | | } |
| | | // for (Task_Batt_Test t : list) { |
| | | // System.out.println(t.getBinf()); |
| | | // } |
| | | if(list!=null && list.size()>0){ |
| | | if (list != null && list.size() > 0) { |
| | | model.setCode(1); |
| | | model.setData(list); |
| | | } |
| | | // System.out.println(model); |
| | | // System.out.println(model); |
| | | return model; |
| | | } |
| | | |
| | |
| | | import com.fgkj.mapper.impl.User_infMapper; |
| | | import com.fgkj.mapper.impl.User_task_paramMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.TransactionDefinition; |
| | | import org.springframework.transaction.TransactionStatus; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | private User_task_paramMapper mapper; |
| | | @Resource |
| | | private User_infMapper userInfMapper; |
| | | @Autowired |
| | | DataSourceTransactionManager dataSourceTransactionManager; |
| | | @Autowired |
| | | TransactionDefinition transactionDefinition; |
| | | |
| | | //4.2作业参数(新增作业参数) |
| | | public ServiceModel add(Object obj) { |
| | | public ServiceModel add(User_task_param obj) { |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.add(obj); |
| | | if(bl){ |
| | |
| | | |
| | | } |
| | | //4.2作业参数(修改操作/重命名操作) |
| | | public ServiceModel update(Object obj) { |
| | | public ServiceModel update(User_task_param obj) { |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.update(obj); |
| | | if(bl){ |
| | |
| | | } |
| | | |
| | | //4.2作业参数(一次修改多个作业参数) |
| | | public ServiceModel updatePro(Object obj){ |
| | | public ServiceModel updatePro(List<User_task_param> list){ |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | ServiceModel model = new ServiceModel(); |
| | | List<User_task_param> list=(List<User_task_param>) obj; |
| | | ArrayList<String> sql_str = new ArrayList<String>();//存放所有的sql语句 |
| | | if(list!=null && list.size()>0){ |
| | | for(int i=0;i<list.size();i++){ |
| | | sql_str.add(mapper.updatePro(list.get(i))); |
| | | } |
| | | } |
| | | //TODO perry待查 |
| | | boolean flag=true; |
| | | //boolean flag= DateUtil.makeManualCommit(DBUtil.getConn(), sql_str); |
| | | if(list!=null && list.size()>0){ |
| | | for(int i=0;i<list.size();i++){ |
| | | if (!(mapper.updatePro(list.get(i))>0)){ |
| | | flag=false; |
| | | } |
| | | } |
| | | } |
| | | if(flag){ |
| | | dataSourceTransactionManager.commit(transactionStatus); |
| | | model.setCode(1); |
| | | model.setMsg("修改成功"); |
| | | }else{ |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | model.setCode(0); |
| | | model.setMsg("修改失败"); |
| | | } |
| | |
| | | } |
| | | |
| | | //4.2作业参数(删除) |
| | | public ServiceModel delete(Object obj) { |
| | | public ServiceModel delete(User_task_param obj) { |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.del(obj); |
| | | Boolean bl=mapper.del(obj)>0; |
| | | if(bl){ |
| | | model.setCode(1); |
| | | model.setMsg("删除成功!"); |
| | |
| | | return model; |
| | | } |
| | | //4.2根据参数id查基本参数和模板参数 |
| | | public ServiceModel serchByCondition(Object obj){ |
| | | public ServiceModel serchByCondition(User_task_param obj){ |
| | | ServiceModel model = new ServiceModel(); |
| | | User_inf uinf=new User_inf(); |
| | | List<User_task_param> list=mapper.serchByCondition(obj); |
| | | for (int i=0;i<list.size();i++) { |
| | | String uids=list.get(i).getTp_master_id(); |
| | | if (uids.length()<1) uids="0"; |
| | | int uid=Integer.parseInt(uids); |
| | | uinf.setUId(uid); |
| | | List<User_inf> listu=userInfMapper.serchUname(uinf); |
| | |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <select id="serchByStationId" resultType="java.lang.Integer"></select> |
| | | <!-- <select id="serchByStationId" resultType="java.lang.Integer"></select>--> |
| | | <select id="serchBystationName3" resultType="java.lang.Integer"></select> |
| | | <select id="serchMonBad" resultType="java.lang.String"></select> |
| | | <!-- <select id="serchMonBad" resultType="java.lang.String"></select>--> |
| | | <select id="serchByInfo" resultMap="Map_Maint_Dealarm"> |
| | | SELECT distinct web_site.tb_badbatt_mon.battgroupid,web_site.tb_badbatt_mon.mon_num,web_site.tb_badbatt_mon.real_cap,web_site.tb_badbatt_mon.stdcap,web_site.tb_badbatt_mon.note |
| | | ,db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.stationname,db_battinf.tb_battinf.battproducer,db_battinf.tb_battinf.battinusedate |
| | |
| | | <select id="serchRealTime" resultType="java.util.List"></select> |
| | | <select id="serchByBatt" resultType="java.util.List"></select> |
| | | <select id="serchByAlmType" resultType="java.util.List"></select> |
| | | <select id="serchByStationId" resultType="java.lang.Integer"></select> |
| | | <!-- <select id="serchByStationId" resultType="java.lang.Integer"></select>--> |
| | | <select id="serchBystationName3" resultType="java.lang.Integer"></select> |
| | | <select id="serchMonAlarm" resultType="java.lang.String"></select> |
| | | <!-- <select id="serchMonAlarm" resultType="java.lang.String"></select>--> |
| | | <select id="serchGood" resultType="java.util.List"></select> |
| | | <select id="serchTopAlmInBatt" resultType="java.util.List"></select> |
| | | <select id="serchTopBattTen" resultType="java.util.List"></select> |
| | |
| | | <?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.fgkj.mapper.impl.Batt_DevdischargeMapper" > |
| | | <resultMap id="BaseResultMap" type="Batt_Devdischarge_all"> |
| | | <association property="bd_CM" javaType="Batt_Devdischarge"> |
| | | <result column="num" property="num"></result> |
| | | <result column="dev_id" property="dev_id"></result> |
| | | <result column="FBSDeviceName" property="dev_name"></result> |
| | | <result column="tb_batt_devdischarge_CM.dev_recordtime" property="dev_recordtime"></result> |
| | | <result column="tb_batt_devdischarge_CM.dev_vol" property="dev_vol"></result> |
| | | <result column="tb_batt_devdischarge_CM.dev_curr" property="dev_curr"></result> |
| | | <result column="tb_batt_devdischarge_CM.note" property="note"></result> |
| | | </association> |
| | | <!-- 待完成--> |
| | | <!-- <association property="bd_CM" javaType="Batt_Devdischarge">--> |
| | | |
| | | <!-- </association>--> |
| | | <!-- <association property="bd_CM" javaType="Batt_Devdischarge">--> |
| | | |
| | | <!-- </association>--> |
| | | </resultMap> |
| | | <!-- |
| | | public List getResults(ResultSet rs) { |
| | | List list=new ArrayList(); |
| | |
| | | } |
| | | --> |
| | | |
| | | <update id="update"></update> |
| | | <!-- <update id="update"></update>--> |
| | | <!-- <delete id="del"></delete>--> |
| | | <!-- <select id="searchAll" resultType="java.util.List"></select>--> |
| | | <select id="serchByCondition" resultType="java.util.List"></select> |
| | | <select id="serchMaxAndMinNum" resultType="java.util.List"></select> |
| | | <select id="serchByCondition" resultMap="BaseResultMap"> |
| | | select web_site.tb_batt_devdischarge_CM.num, |
| | | web_site.tb_batt_devdischarge_CM.dev_id, |
| | | web_site.tb_batt_devdischarge_CM.dev_name, |
| | | web_site.tb_batt_devdischarge_CM.dev_recordtime, |
| | | web_site.tb_batt_devdischarge_CM.dev_vol, |
| | | web_site.tb_batt_devdischarge_CM.dev_curr, |
| | | web_site.tb_batt_devdischarge_CM.dev_power, |
| | | web_site.tb_batt_devdischarge_CM.note, |
| | | web_site.tb_batt_devdischarge_CT.num, |
| | | web_site.tb_batt_devdischarge_CT.dev_id, |
| | | web_site.tb_batt_devdischarge_CT.dev_name, |
| | | web_site.tb_batt_devdischarge_CT.dev_recordtime, |
| | | web_site.tb_batt_devdischarge_CT.dev_vol, |
| | | web_site.tb_batt_devdischarge_CT.dev_curr, |
| | | web_site.tb_batt_devdischarge_CT.dev_power, |
| | | web_site.tb_batt_devdischarge_CT.note, |
| | | web_site.tb_batt_devdischarge_CU.num, |
| | | web_site.tb_batt_devdischarge_CU.dev_id, |
| | | web_site.tb_batt_devdischarge_CU.dev_name, |
| | | web_site.tb_batt_devdischarge_CU.dev_recordtime, |
| | | web_site.tb_batt_devdischarge_CU.dev_vol, |
| | | web_site.tb_batt_devdischarge_CU.dev_curr, |
| | | web_site.tb_batt_devdischarge_CU.dev_power, |
| | | web_site.tb_batt_devdischarge_CU.note, |
| | | DISTINCTbattinf.FBSDeviceName "" |
| | | from web_site.tb_batt_devdischarge_CM, |
| | | (select DISTINCT(FBSdeviceid), |
| | | FBSDeviceName |
| | | from db_battinf.tb_battinf |
| | | where stationid like concat('%',#{stationId},'%')) as DISTINCTbattinf, |
| | | web_site.tb_batt_devdischarge_CT, |
| | | web_site.tb_batt_devdischarge_CU |
| | | where DISTINCTbattinf.FBSdeviceid = tb_batt_devdischarge_CM.dev_id |
| | | and tb_batt_devdischarge_CT.dev_id = tb_batt_devdischarge_CM.dev_id |
| | | and tb_batt_devdischarge_CU.dev_id = tb_batt_devdischarge_CM.dev_id |
| | | and tb_batt_devdischarge_CT.record_num = web_site.tb_batt_devdischarge_CM.record_num |
| | | and tb_batt_devdischarge_CU.record_num = web_site.tb_batt_devdischarge_CM.record_num |
| | | and web_site.tb_batt_devdischarge_CM.dev_recordtime >= #{battProductDate} |
| | | and web_site.tb_batt_devdischarge_CM.dev_recordtime<![CDATA[<=]]> (#{battProductDate1}) |
| | | <choose> |
| | | <when test="num>1000"> |
| | | <if test="num==0"> |
| | | and (tb_batt_devdischarge_CM.record_num%(#{num}/1000)=0 or |
| | | tb_batt_devdischarge_CM.record_num=#{num} or |
| | | tb_batt_devdischarge_CM.record_num=#{num}) |
| | | </if> |
| | | <if test="num!=0"> |
| | | and (tb_batt_devdischarge_CM.record_num%(#{num}/1000+1)=0 or |
| | | tb_batt_devdischarge_CM.record_num=#{num} or |
| | | tb_batt_devdischarge_CM.record_num=#{num}) |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | and (tb_batt_devdischarge_CM.record_num%1=0 or tb_batt_devdischarge_CM.record_num=#{num} |
| | | or tb_batt_devdischarge_CM.record_num=#{num}) |
| | | </otherwise> |
| | | </choose> |
| | | ORDER BY web_site.tb_batt_devdischarge_CM.dev_id, web_site.tb_batt_devdischarge_CM.dev_recordtime |
| | | </select> |
| | | <!-- <select id="serchMaxAndMinNum" resultType="java.util.List"></select>--> |
| | | </mapper> |
| | |
| | | <select id="judgePlan" resultType="java.lang.Integer"></select> |
| | | <!-- <select id="searchAll" resultType="java.util.List"></select>--> |
| | | <select id="serchByCondition" resultType="java.util.List"></select> |
| | | <select id="serchByStationId" resultType="java.lang.Integer"></select> |
| | | <!-- <select id="serchByStationId" resultType="java.lang.Integer"></select>--> |
| | | <select id="serchBystationName3" resultType="java.lang.Integer"></select> |
| | | <select id="searchNums" resultType="java.lang.Integer"></select> |
| | | <select id="searchState" resultType="java.util.List"></select> |
| | |
| | | } |
| | | --> |
| | | |
| | | <select id="serchByCondition" resultMap="BaseResultMap"></select> |
| | | <!-- <select id="serchByCondition" resultMap="BaseResultMap"></select>--> |
| | | <select id="serchByInfo" resultMap="BaseResultMap"> |
| | | SELECT |
| | | dev_id,dev_name,dev_recordtime,dev_electricity_cm,dev_electricity_ct,dev_electricity_cu |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.fgkj.mapper.impl.Batt_historyMapper" > |
| | | |
| | | <resultMap id="BaseResultMap" type="Batt_history"> |
| | | <result column="num" property="num" /> |
| | | <result column="dev_id" property="dev_id" /> |
| | | <result column="BattGroupId" property="battGroupId" /> |
| | | <result column="batt_count" property="batt_count" /> |
| | | <result column="batt_state" property="batt_state" /> |
| | | <result column="rec_datetime" property="rec_datetime" /> |
| | | <result column="online_vol" property="online_vol" /> |
| | | <result column="group_vol" property="group_vol" /> |
| | | <result column="group_tmp" property="group_tmp" /> |
| | | <result column="group_curr" property="group_curr" /> |
| | | <result column="mon_vols" property="mon_vols" /> |
| | | <result column="mon_tmps" property="mon_tmps" /> |
| | | <result column="mon_ress" property="mon_ress" /> |
| | | <result column="mon_conn_ress" property="mon_conn_ress" /> |
| | | <result column="mon_caps" property="mon_caps" /> |
| | | <result column="note" property="note" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <!-- |
| | | public List getResults(ResultSet rs) { |
| | | List list=new ArrayList(); |
| | |
| | | --> |
| | | |
| | | <select id="searchAll" resultType="java.util.List"></select> |
| | | <select id="serchByCondition" resultType="java.util.List"></select> |
| | | <select id="serchByCondition" resultMap="BaseResultMap"> |
| | | select distinct(num),dev_id,BattGroupId,batt_count,batt_state,rec_datetime |
| | | ,online_vol,group_vol,group_tmp,group_curr,mon_vols,mon_tmps,mon_ress,mon_sers |
| | | ,mon_conn_ress,mon_caps,note |
| | | from db_batt_history.tb_batt_${tbname} |
| | | where BattGroupId=#{battGroupId} |
| | | and rec_datetime <![CDATA[>=]]>#{rec_datetime} and rec_datetime <![CDATA[<=]]>#{rec_datetime1} |
| | | order by rec_datetime asc |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="serchByIdLow" resultType="java.util.List"></select> |
| | | <select id="serchByBattProducerGroup" resultType="java.util.List"></select> |
| | | <select id="serchByBattInUseDateGroup" resultType="java.util.List"></select> |
| | | <select id="serchMonNum" resultType="java.util.List"></select> |
| | | <!-- <select id="serchMonNum" resultType="java.util.List"></select>--> |
| | | <select id="serchByStationid" resultType="java.util.List"></select> |
| | | <select id="searchBattByStationId" resultType="java.util.List"></select> |
| | | <select id="serchMonAll" resultType="java.lang.Integer"></select> |
| | |
| | | } |
| | | --> |
| | | |
| | | <insert id="add"></insert> |
| | | <insert id="addDev"></insert> |
| | | <update id="update"></update> |
| | | <delete id="del"></delete> |
| | | <select id="searchAll" resultType="java.util.List"></select> |
| | | <select id="serchNotInBattMap" resultType="java.util.List"></select> |
| | | <!-- <insert id="add"></insert>--> |
| | | <!-- <insert id="addDev"></insert>--> |
| | | <!-- <update id="update"></update>--> |
| | | <!-- <delete id="del"></delete>--> |
| | | <!-- <select id="searchAll" resultType="java.util.List"></select>--> |
| | | <!-- <select id="serchNotInBattMap" resultType="java.util.List"></select>--> |
| | | <select id="serchNotInBattMapByUid" resultType="java.util.List"></select> |
| | | <select id="serchInBattMapByUid" resultType="java.util.List"></select> |
| | | <select id="serchStationName1" resultType="java.util.List"></select> |
| | | <select id="serchStationName2" resultType="java.util.List"></select> |
| | | <select id="serchStationName" resultType="java.util.List"></select> |
| | | <select id="serchByInfo" resultType="java.util.List"></select> |
| | | <!-- <select id="serchByInfo" resultType="java.util.List"></select>--> |
| | | <select id="serchAddressByStationName3" resultType="java.util.List"></select> |
| | | <select id="serchByCondition" resultType="java.util.List"></select> |
| | | <!-- <select id="serchByCondition" resultType="java.util.List"></select>--> |
| | | <select id="serchStationName3" resultType="java.util.List"></select> |
| | | </mapper> |
| | |
| | | --> |
| | | |
| | | <insert id="add"></insert> |
| | | <update id="update"></update> |
| | | <!-- <update id="update"></update>--> |
| | | <delete id="del"></delete> |
| | | <!-- <select id="searchAll" resultType="java.util.List"></select>--> |
| | | <select id="serchByCondition" resultType="java.util.List"></select> |
| | |
| | | <select id="serchResById" resultMap="BaseResultMap"> |
| | | select BattGroupId,mon_num,mon_res,mon_JH_curr |
| | | from db_ram_db.tb_batt_rtdata |
| | | where BattGroupId= #{mon_num} order by mon_num |
| | | where BattGroupId= #{battGroupId} order by mon_num |
| | | </select> |
| | | |
| | | <select id="serchByCondition_ky" resultMap="BaseResultMap"> |
| | |
| | | where BattGroupId=#{battGroupId} order by mon_num |
| | | </select> |
| | | <select id="serchDisOrChargr" resultType="java.util.List"></select> |
| | | <select id="serchDisOrChargrNew" resultType="java.util.List"></select> |
| | | <!-- <select id="serchDisOrChargrNew" resultType="java.util.List"></select>--> |
| | | <select id="serchByInfo" resultMap="BaseResultMap2"> |
| | | select tb_batt_rtstate.BattGroupId,batt_count,tb_batt_rtstate.rec_datetime,group_vol,group_curr,batt_state, |
| | | batt_test_type,batt_test_starttime,batt_test_recordtime,batt_test_tlong, |
| | |
| | | |
| | | <!-- TODO --> |
| | | <select id="serchBattLife" resultMap="BaseResultMap4"> |
| | | select SQL_CALC_FOUND_ROWS tb_batt_rtstate.BattGroupId,batt_count,tb_batt_rtstate.rec_datetime,online_vol,group_vol,group_curr,batt_state, |
| | | batt_test_type,batt_test_starttime,batt_test_recordtime,batt_test_tlong, |
| | | batt_test_cap,batt_real_cap,batt_rest_cap,batt_rest_power1_time,batt_rest_power2_time |
| | | ,tb_batt_rtdata.BattGroupId,tb_batt_rtdata.rec_datetime,mon_num,mon_vol,mon_tmp, |
| | | mon_res,mon_ser,mon_conn_res,mon_cap |
| | | ,db_battinf.tb_battinf.moncapstd,db_battinf.tb_battinf.monvolstd |
| | | ,db_battinf.tb_battinf.stationname,db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.BattGroupName,db_battinf.tb_battinf.deviceName |
| | | ,max(binary tb_batt_rtdata.mon_vol) as maxmonvol,min(binary tb_batt_rtdata.mon_vol) as minmonvol |
| | | FROM db_ram_db.tb_batt_rtstate |
| | | LEFT OUTER JOIN db_ram_db.tb_batt_rtdata ON tb_batt_rtstate.BattGroupId = tb_batt_rtdata.BattGroupId |
| | | LEFT OUTER JOIN db_battinf.tb_battinf ON tb_batt_rtstate.BattGroupId = db_battinf.tb_battinf.BattGroupId |
| | | WHERE |
| | | <if test="binf.BattGroupId==0">tb_batt_rtstate.BattGroupId=#{binf.battGroupId}</if> |
| | | <if test="binf.BattGroupId!=0">tb_batt_rtstate.BattGroupId!=#{binf.battGroupId}</if> |
| | | and tb_batt_rtstate.BattGroupId in(select distinct db_battinf.tb_battinf.battgroupid |
| | | from db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf |
| | | where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId |
| | | and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id |
| | | and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid |
| | | and db_user.tb_user_inf.uid=#{uinf.UId} ) |
| | | AND db_battinf.tb_battinf.stationname like concat('%',#{binf.stationName},'%') AND db_battinf.tb_battinf.stationname1 like concat('%',#{binf.stationName},'%') |
| | | <if test="binf.num==100">AND batt_state=#{binf.num}</if> |
| | | <if test="binf.num!=100">AND batt_state!=#{binf.num}</if> |
| | | GROUP BY tb_batt_rtstate.BattGroupId limit #{(pageBean.pageCurr-1)*pageBean.pageSize},#{pageBean.pageSize}? |
| | | select SQL_CALC_FOUND_ROWS tb_batt_rtstate.BattGroupId,batt_count,tb_batt_rtstate.rec_datetime,online_vol,group_vol,group_curr,batt_state, |
| | | batt_test_type,batt_test_starttime,batt_test_recordtime,batt_test_tlong, |
| | | batt_test_cap,batt_real_cap,batt_rest_cap,batt_rest_power1_time,batt_rest_power2_time |
| | | ,tb_batt_rtdata.BattGroupId,tb_batt_rtdata.rec_datetime,mon_num,mon_vol,mon_tmp, |
| | | mon_res,mon_ser,mon_conn_res,mon_cap |
| | | ,db_battinf.tb_battinf.moncapstd,db_battinf.tb_battinf.monvolstd |
| | | ,db_battinf.tb_battinf.stationname,db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.BattGroupName,db_battinf.tb_battinf.deviceName |
| | | ,max(binary tb_batt_rtdata.mon_vol) as maxmonvol,min(binary tb_batt_rtdata.mon_vol) as minmonvol |
| | | FROM db_ram_db.tb_batt_rtstate |
| | | LEFT OUTER JOIN db_ram_db.tb_batt_rtdata ON tb_batt_rtstate.BattGroupId = tb_batt_rtdata.BattGroupId |
| | | LEFT OUTER JOIN db_battinf.tb_battinf ON tb_batt_rtstate.BattGroupId = db_battinf.tb_battinf.BattGroupId |
| | | WHERE |
| | | <if test="binf.BattGroupId==0">tb_batt_rtstate.BattGroupId=#{binf.battGroupId}</if> |
| | | <if test="binf.BattGroupId!=0">tb_batt_rtstate.BattGroupId!=#{binf.battGroupId}</if> |
| | | and tb_batt_rtstate.BattGroupId in(select distinct db_battinf.tb_battinf.battgroupid |
| | | from db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf |
| | | where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId |
| | | and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id |
| | | and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid |
| | | and db_user.tb_user_inf.uid=#{uinf.UId} ) |
| | | AND db_battinf.tb_battinf.stationname like concat('%',#{binf.stationName},'%') AND db_battinf.tb_battinf.stationname1 like concat('%',#{binf.stationName1},'%') |
| | | <if test="binf.num==100">AND batt_state=#{binf.num}</if> |
| | | <if test="binf.num!=100">AND batt_state!=#{binf.num}</if> |
| | | GROUP BY tb_batt_rtstate.BattGroupId limit #{binf.num},#{pageBean.pageAll}; |
| | | </select> |
| | | <select id="searchMaxBattgroupId" resultType="java.lang.Integer"></select> |
| | | <!-- <select id="serchByCondition_ky" resultType="java.util.List"></select>--> |
| | |
| | | <?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.fgkj.mapper.impl.User_task_changeMapper" > |
| | | |
| | | <resultMap id="BaseResultMap" type="Task_Batt_Test"> |
| | | <association property="uchange" javaType="User_task_change"> |
| | | <result column="num" property="num"></result> |
| | | <result column="usr_id" property="usr_id"></result> |
| | | <result column="master_id" property="master_id"></result> |
| | | <result column="appoint_uid" property="appoint_uid"></result> |
| | | <result column="copy_uids" property="copy_uids"></result> |
| | | <result column="change_type_id" property="change_type_id"></result> |
| | | <result column="task_type_id" property="task_type_id"></result> |
| | | <result column="task_rc_num" property="task_rc_num"></result> |
| | | <result column="battgroupId" property="battgroupId"></result> |
| | | <result column="change_reason" property="change_reason"></result> |
| | | <result column="old_executor_ids" property="old_executor_ids"></result> |
| | | <result column="old_task_exe_time" property="old_task_exe_time"></result> |
| | | <result column="new_executor_ids" property="new_executor_ids"></result> |
| | | <result column="new_task_exe_time" property="new_task_exe_time"></result> |
| | | <result column="change_ask_time" property="change_ask_time"></result> |
| | | <result column="change_ask_time_limit" property="change_ask_time_limit"></result> |
| | | <result column="task_change_approve_time" property="task_change_approve_time"></result> |
| | | <result column="task_change_approve_res" property="task_change_approve_res"></result> |
| | | <result column="remark" property="remark"></result> |
| | | </association> |
| | | <association property="binf" javaType="BattInf"> |
| | | <result column="battGroupId" property="battGroupId"></result> |
| | | <result column="battGroupName" property="battGroupName"></result> |
| | | <result column="stationName" property="stationName"></result> |
| | | </association> |
| | | <association property="pageBean" javaType="Page"> |
| | | </association> |
| | | </resultMap> |
| | | <!-- |
| | | public List getResults(ResultSet rs) { |
| | | List list=new ArrayList(); |
| | |
| | | } |
| | | --> |
| | | |
| | | <insert id="add"></insert> |
| | | <update id="update"></update> |
| | | <delete id="del"></delete> |
| | | <insert id="add"> |
| | | insert into db_user.tb_user_task_change(usr_id, master_id, appoint_uid, copy_uids, change_type_id, task_type_id, |
| | | task_rc_num, battgroupid, change_reason, old_executor_ids, |
| | | old_task_exe_time, new_executor_ids, new_task_exe_time, change_ask_time, |
| | | change_ask_time_limit, task_change_approve_time, |
| | | task_change_approve_res, remark) |
| | | values (#{usr_id}, #{master_id}, #{appoint_uid}, #{copy_uids}, #{change_type_id}, #{task_type_id}, |
| | | #{task_rc_num}, #{BattgroupId}, #{change_reason}, #{old_executor_ids}, |
| | | #{old_task_exe_time}, #{new_executor_ids}, #{new_task_exe_time}, #{change_ask_time}, |
| | | #{change_ask_time_limit}, #{task_change_approve_time}, |
| | | #{task_change_approve_res}, #{remark}) |
| | | </insert> |
| | | <update id="update"> |
| | | update db_user.tb_user_task_change |
| | | set task_change_approve_res=#{task_change_approve_res}, |
| | | remark=#{remark}, |
| | | task_change_approve_time=#{task_change_approve_time} |
| | | where num = #{num} |
| | | </update> |
| | | <delete id="del"> |
| | | delete from db_user.tb_user_task_change where num = #{num} |
| | | </delete> |
| | | <select id="searchAll" resultType="java.util.List"></select> |
| | | <select id="serchByCondition1" resultType="java.util.List"></select> |
| | | <select id="serchByCondition" resultType="java.util.List"></select> |
| | | <select id="serchByCondition" resultMap="BaseResultMap"> |
| | | select SQL_CALC_FOUND_ROWS distinct(tb_user_task_change.battgroupid),battgroupname,stationname,tb_user_task_change.num,usr_id,master_id,appoint_uid,copy_uids,change_type_id,task_type_id,task_rc_num,change_reason,old_executor_ids,old_task_exe_time,new_executor_ids,new_task_exe_time,change_ask_time,change_ask_time_limit,task_change_approve_time,task_change_approve_res,remark |
| | | from db_user.tb_user_task_change, db_battinf.tb_battinf |
| | | where |
| | | tb_user_task_change.BattGroupId=db_battinf.tb_battinf.BattGroupId |
| | | and (change_ask_time)<![CDATA[>=]]>(#{uchange.change_ask_time}) |
| | | and |
| | | (change_ask_time)<![CDATA[<=]]>(#{uchange.change_ask_time1}) |
| | | <!-- <choose> |
| | | <when test="binf.tationname1==‘’"> |
| | | and stationname1!=#{binf.stationname1} |
| | | </when> |
| | | <otherwise> |
| | | and stationname1=#{binf.stationname1} |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="binf.stationname==‘’"> |
| | | and stationname!=#{binf.stationname} |
| | | </when> |
| | | <otherwise> |
| | | and stationname=#{binf.stationname} |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="binf.BattProducer==‘’"> |
| | | and battproducer!=#{binf.battproducer} |
| | | </when> |
| | | <otherwise> |
| | | and battproducer=#{binf.battproducer} |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="binf.BattGroupId==0"> |
| | | and db_battinf.tb_battinf.battgroupid!=#{binf.battgroupid} |
| | | </when> |
| | | <otherwise> |
| | | and db_battinf.tb_battinf.battgroupid=#{binf.battgroupid} |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="BattGroupName1==‘其他’"> |
| | | and BattGroupName1 like #{binf.BattGroupName1} |
| | | </when> |
| | | <otherwise> |
| | | and BattGroupName1 not like '%开关电源系统%' and BattGroupName1 not like '%UPS系统%' and BattGroupName1 not like #{binf.BattGroupName1} |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="monVolStd==0"> |
| | | and monVolStd!=#{binf.monVolStd} |
| | | </when> |
| | | <otherwise> |
| | | and monVolStd=#{binf.monVolStd} |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="monCapStd==0"> |
| | | and monCapStd!=#{binf.monCapStd} |
| | | </when> |
| | | <otherwise> |
| | | and monCapStd=#{binf.monCapStd} |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="task_type_id==100"> |
| | | and task_type_id!=#{uchange.task_type_id} |
| | | </when> |
| | | <otherwise> |
| | | and task_type_id=#{uchange.task_type_id} |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="usr_id==0"> |
| | | and usr_id!=#{uchange.usr_id} |
| | | </when> |
| | | <otherwise> |
| | | and usr_id=#{uchange.usr_id} |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="change_type_id==100"> |
| | | and change_type_id!=#{uchange.change_type_id} |
| | | </when> |
| | | <otherwise> |
| | | and change_type_id=#{uchange.change_type_id} |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="change_type_id==100"> |
| | | and task_change_approve_res!=#{uchange.task_change_approve_res} |
| | | </when> |
| | | <otherwise> |
| | | <if test="change_type_id==2">and task_change_approve_res=#{uchange.task_change_approve_res}</if> |
| | | <if test="change_type_id!=2">and task_change_approve_res in (0,#{uchange.task_change_approve_res})</if> |
| | | </otherwise> |
| | | </choose> |
| | | order by tb_user_task_change.battgroupid limit (#{pageCurr}-1)*#{pageSize},#{pageSize}--> |
| | | </select> |
| | | </mapper> |
| | |
| | | } |
| | | --> |
| | | |
| | | <insert id="add"></insert> |
| | | <update id="update"></update> |
| | | <update id="updatePro"></update> |
| | | <delete id="del"></delete> |
| | | <select id="searchAll" resultType="java.util.List"></select> |
| | | <select id="serchByCondition" resultType="java.util.List"></select> |
| | | <insert id="add"> |
| | | insert into db_user.tb_user_task_param(tp_name, tp_taskname, tp_tasktype, tp_autoinc_daycount, |
| | | tp_taskdelay_daycount, tp_pass_saturday, tp_pass_sunday, |
| | | tp_pass_jiejiari, tp_task_notice_count, tp_task_notice_time_interval, |
| | | tp_task_notice_starttime, tp_task_notice_endtime, tp_task_enabled, |
| | | tp_master_id, tp_notice_master_enabled, tp_task_battlife_var, |
| | | tp_task_battyong_test80_month, tp_task_battold_test80_month, |
| | | tp_task_battyong_test40_month, tp_task_battold_test40_month, |
| | | tp_task_batt_checkcircle_month, tp_task_batt_checklimit_month, |
| | | tp_task_batt_lazhacircle_month, tp_task_batt_lazhalimit_month) |
| | | values (#{tp_name}, #{tp_taskname}, #{tp_tasktype}, #{tp_autoinc_daycount}, |
| | | #{tp_taskdelay_daycount}, #{tp_pass_saturday}, #{tp_pass_sunday}, |
| | | #{tp_pass_jiejiari}, #{tp_task_notice_count}, #{tp_task_notice_time_interval}, |
| | | #{tp_task_notice_starttime}, #{tp_task_notice_endtime}, #{tp_task_enabled}, |
| | | #{tp_master_id}, #{tp_notice_master_enabled}, #{tp_task_battlife_var}, |
| | | #{tp_task_battyong_test80_month}, #{tp_task_battold_test80_month}, #{tp_task_battyong_test40_month}, #{tp_task_battold_test40_month}, #{tp_task_batt_checkcircle_month}, #{tp_task_batt_checklimit_month}, |
| | | #{tp_task_batt_lazhacircle_month}, #{tp_task_batt_lazhalimit_month}) |
| | | </insert> |
| | | <update id="update"> |
| | | update db_user.tb_user_task_param |
| | | set tp_name=#{tp_name}, |
| | | tp_taskname=#{tp_taskname}, |
| | | tp_tasktype=#{tp_tasktype}, |
| | | tp_autoinc_daycount=#{tp_autoinc_daycount}, |
| | | tp_taskdelay_daycount=#{tp_taskdelay_daycount}, |
| | | tp_pass_saturday=#{tp_pass_saturday}, |
| | | tp_pass_sunday=#{tp_pass_sunday}, |
| | | tp_pass_jiejiari=#{tp_pass_jiejiari}, |
| | | tp_task_notice_count=#{tp_task_notice_count}, |
| | | tp_task_notice_time_interval=#{tp_task_notice_time_interval}, |
| | | tp_task_notice_starttime=#{tp_task_notice_starttime}, |
| | | tp_task_notice_endtime=#{tp_task_notice_endtime}, |
| | | tp_task_enabled=#{tp_task_enabled}, |
| | | tp_master_id=#{tp_master_id}, |
| | | tp_notice_master_enabled=#{tp_notice_master_enabled}, |
| | | tp_task_battlife_var=#{tp_task_battlife_var}, |
| | | tp_task_battyong_test80_month=#{tp_task_battyong_test80_month}, |
| | | tp_task_battold_test80_month=#{tp_task_battold_test80_month}, |
| | | tp_task_battyong_test40_month=#{tp_task_battyong_test40_month}, |
| | | tp_task_battold_test40_month=#{tp_task_battold_test40_month}, |
| | | tp_task_batt_checkcircle_month=#{tp_task_batt_checkcircle_month}, |
| | | tp_task_batt_checklimit_month=#{tp_task_batt_checklimit_month}, |
| | | tp_task_batt_lazhacircle_month=#{tp_task_batt_lazhacircle_month}, |
| | | tp_task_batt_lazhalimit_month=#{tp_task_batt_lazhalimit_month} |
| | | where tp_num = #{tp_num} |
| | | </update> |
| | | <!-- <update id="updatePro"></update>--> |
| | | <!-- <delete id="del"></delete>--> |
| | | <!-- <select id="searchAll" resultType="java.util.List"></select>--> |
| | | <!-- <select id="serchByCondition" resultType="java.util.List"></select>--> |
| | | <select id="serchByInfo" resultType="java.util.List"></select> |
| | | </mapper> |