| | |
| | | public Response updateUpdateFile(@RequestBody Ld9UpdateStatus ld9UpdateStatus){ |
| | | return service.updateUpdateFile(ld9UpdateStatus); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询Ld9状态",notes = "返回值类型为Fbs9100state类型") |
| | | @GetMapping("/searchByCondition") |
| | | public Response searchByCondition(int pageNum,int pageSize,int devErrcommcount){ |
| | | UserInf user = ActionUtil.getUser(); |
| | | return service.searchByCondition(pageNum,pageSize,devErrcommcount,user.getUId().intValue()); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.Fbs9100State; |
| | | import com.whyc.pojo.Ld9State; |
| | | import com.whyc.pojo.Ld9UpdateStatus; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface Ld9StateMapper extends CustomMapper<Ld9State>{ |
| | | List<Ld9UpdateStatus> getLd9(String stationName1, String stationName2, String stationName5, int uId); |
| | | |
| | | //原serchByCondition接口 |
| | | List<Fbs9100State> getLd9State(@Param("devErrcommcount") int devErrcommcount, @Param("uId") int uId); |
| | | } |
| | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.Ld9StateMapper; |
| | | import com.whyc.mapper.Ld9UpdateStatusMapper; |
| | | import com.whyc.pojo.Fbs9100State; |
| | | import com.whyc.pojo.Ld9State; |
| | | import com.whyc.pojo.Ld9UpdateStatus; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | return new Response().set(1,true,"更新成功"); |
| | | } |
| | | |
| | | //webSocket使用(FbsStateSocket) |
| | | public Response searchByCondition(int pageNum,int pageSize,int devErrcommcount,int uId){ |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<Fbs9100State> list = mapper.getLd9State(devErrcommcount,uId); |
| | | PageInfo<Fbs9100State> pageInfo = new PageInfo<>(list); |
| | | return new Response().set(1,pageInfo,"查询成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.paramter.FbsStatePar; |
| | | import com.whyc.dto.paramter.RealTimePar; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.service.Fbs9100StateService; |
| | | import com.whyc.service.Fbs9600StateService; |
| | | import com.whyc.service.Ld9StateService; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | private static Fbs9600StateService fbs9600StateService; |
| | | |
| | | private static Ld9StateService ld9StateService; |
| | | |
| | | private Session session; |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | public void setService(Fbs9600StateService fbs9600StateService) { |
| | | FbsStateSocket.fbs9600StateService = fbs9600StateService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setService(Ld9StateService ld9StateService) { |
| | | FbsStateSocket.ld9StateService = ld9StateService; |
| | | } |
| | | |
| | | @OnMessage |
| | |
| | | Response f9600StateRes=fbs9600StateService.searchByCondition(fbsStatePar.getPageNum(),fbsStatePar.getPageSize(),fbsStatePar.getDevErrcommcount(),fbsStatePar.getUserId()); |
| | | res.put("f9600state",f9600StateRes); |
| | | |
| | | Response ld9stateRes=ld9StateService.searchByCondition(fbsStatePar.getPageNum(),fbsStatePar.getPageSize(),fbsStatePar.getDevErrcommcount(),fbsStatePar.getUserId()); |
| | | res.put("ld9state",ld9stateRes); |
| | | |
| | | if (session.isOpen()) { |
| | | //推送信息 |
| | | synchronized (session) { |
| | |
| | | and db_user.tb_user_battgroup_baojigroup_usr.uId=#{uId} |
| | | ) |
| | | </select> |
| | | <select id="getLd9State" resultType="com.whyc.pojo.Fbs9100State"> |
| | | select distinct db_ram_db.tb_ld9_state.num as id,db_ram_db.tb_ld9_state.dev_ip,db_ram_db.tb_ld9_state.dev_id,db_ram_db.tb_ld9_state.dev_version, |
| | | db_ram_db.tb_ld9_state.sys_state,db_ram_db.tb_ld9_state.sys_stop_reason as devAlarmstate,db_ram_db.tb_ld9_state.dev_commcount,db_ram_db.tb_ld9_state.dev_errcommcount,db_ram_db.tb_ld9_state.timelong as devCaptestTimelong,db_ram_db.tb_ld9_state.record_datetime , |
| | | db_battinf.tb_battinf.StationName,db_battinf.tb_battinf.FbsDeviceName as deviceName, |
| | | COUNT(DISTINCT db_battinf.tb_battinf.BattGroupId) as num, |
| | | group_CONCAT(db_ram_db.tb_batt_rtstate.online_vol ORDER BY db_ram_db.tb_batt_rtstate.BattGroupId separator '/') as online_vols,group_CONCAT(db_ram_db.tb_batt_rtstate.group_vol ORDER BY db_ram_db.tb_batt_rtstate.BattGroupId separator '/') as group_vols,group_CONCAT(db_ram_db.tb_batt_rtstate.group_curr ORDER BY db_ram_db.tb_batt_rtstate.BattGroupId separator '/') as group_currs |
| | | from db_ram_db.tb_ld9_state |
| | | left outer join db_battinf.tb_battinf ON db_ram_db.tb_ld9_state.dev_id=db_battinf.tb_battinf.FBSDeviceId |
| | | LEFT OUTER JOIN db_ram_db.tb_batt_rtstate ON db_battinf.tb_battinf.battgroupid=db_ram_db.tb_batt_rtstate.battgroupid |
| | | <where> |
| | | <if test="devErrcommcount==0"> |
| | | dev_errcommcount=0 |
| | | </if> |
| | | <if test="devErrcommcount==1"> |
| | | dev_errcommcount>0 |
| | | </if> |
| | | <if test="devErrcommcount==100"> |
| | | dev_errcommcount>-1 |
| | | </if> |
| | | <if test="uId!=null and uId!=0"> |
| | | and db_battinf.tb_battinf.StationId in(select distinct db_battinf.tb_battinf.StationId |
| | | 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} ) |
| | | </if> |
| | | </where> |
| | | GROUP BY db_ram_db.tb_ld9_state.dev_id |
| | | |
| | | </select> |
| | | </mapper> |