| | |
| | | */ |
| | | private LocalDateTime updateTime; |
| | | |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | |
| | | * 诺瓦-节目列表 |
| | | */ |
| | | //创建时间 |
| | | LED_N_PROGRAM_CREATE_TIME("create_date"), |
| | | LED_N_PROGRAM_CREATE_TIME("create_time"), |
| | | |
| | | |
| | | /** |
| | | * 诺瓦-播放计划列表 |
| | | */ |
| | | //创建时间 |
| | | LED_N_PLAY_PLAN_CREATE_TIME("create_date"), |
| | | LED_N_PLAY_PLAN_CREATE_TIME("create_time"), |
| | | |
| | | /** |
| | | * 熙迅-列表 |
| | |
| | | //绑定灯杆名称 |
| | | LED_S_POLE_NAME("t3.pole_name"), |
| | | //创建时间 |
| | | LED_S_CREATE_TIME("t1.create_date"), |
| | | LED_S_CREATE_TIME("t1.create_time"), |
| | | |
| | | |
| | | /** |
| | | * 熙迅-节目列表 |
| | | */ |
| | | LED_S_PROGRAM_CREATE_TIME("create_date"), |
| | | LED_S_PROGRAM_CREATE_TIME("create_time"), |
| | | |
| | | /** |
| | | * 路灯任务列表 |
| | |
| | | ASC("ASC"), |
| | | //倒序 |
| | | DESC("DESC"), |
| | | |
| | | |
| | | /** |
| | | * 单灯数据列表 |
| | | */ |
| | | LIGHT_DATA_CREATE_TIME("t1.create_time"), |
| | | |
| | | /** |
| | | * 充电桩列表 |
| | | */ |
| | | CHARGE_POLE_CREATE_TIME("t1.create_time"), |
| | | ; |
| | | |
| | | private final String code; |
| | |
| | | C3mCharging getAllByC3Mac(String c3Mac); |
| | | |
| | | |
| | | List<C3ChargingBo> listC3mChargingDto(String keyword, Long userid); |
| | | List<C3ChargingBo> listC3mChargingDto(String keyword, Long userid,String orderBy); |
| | | |
| | | |
| | | } |
| | |
| | | <mapper namespace="com.sandu.ximon.dao.mapper.C3mChargingMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.C3mCharging"> |
| | | <id property="c3Id" column="c3_id" jdbcType="BIGINT"/> |
| | | <result property="mcuUdid" column="mcu_udid" jdbcType="VARCHAR"/> |
| | | <result property="c3Name" column="c3_name" jdbcType="VARCHAR"/> |
| | | <result property="c3Mac" column="c3_mac" jdbcType="VARCHAR"/> |
| | | <result property="statusBit" column="status_bit" jdbcType="INTEGER"/> |
| | | <result property="deviceTemperature" column="device_temperature" jdbcType="VARCHAR"/> |
| | | <result property="poleDevicesCode" column="pole_devices_code" jdbcType="VARCHAR"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <id property="c3Id" column="c3_id" jdbcType="BIGINT"/> |
| | | <result property="mcuUdid" column="mcu_udid" jdbcType="VARCHAR"/> |
| | | <result property="c3Name" column="c3_name" jdbcType="VARCHAR"/> |
| | | <result property="c3Mac" column="c3_mac" jdbcType="VARCHAR"/> |
| | | <result property="statusBit" column="status_bit" jdbcType="INTEGER"/> |
| | | <result property="deviceTemperature" column="device_temperature" jdbcType="VARCHAR"/> |
| | | <result property="poleDevicesCode" column="pole_devices_code" jdbcType="VARCHAR"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | c3_id,mcu_udid,c3_name, |
| | | c3_id |
| | | ,mcu_udid,c3_name, |
| | | c3_mac,status_bit,device_temperature, |
| | | pole_devices_code,update_time |
| | | </sql> |
| | |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | <where> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND (t1.c3_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') OR (t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%'))) |
| | | AND (t1.c3_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') OR (t3.pole_name LIKE CONCAT(CONCAT('%', |
| | | #{keyword}), '%'))) |
| | | </if> |
| | | <if test="userid != null"> |
| | | AND (t3.user_id = #{userid} OR t3.client_id = #{userid}) |
| | | </if> |
| | | </where> |
| | | ORDER BY ${orderBy} |
| | | </select> |
| | | </mapper> |
| | | |
| | |
| | | |
| | | |
| | | @PostMapping("/C3ChargingList") |
| | | public ResponseVO<Object> C3ChargingList(BaseConditionVO baseConditionVO, @RequestBody(required = false) C3ChargingParam c3ChargingParam) { |
| | | public ResponseVO<Object> C3ChargingList(BaseConditionVO baseConditionVO, @RequestBody(required = false) C3ChargingParam c3ChargingParam |
| | | , @RequestParam(value = "order", required = false) Integer order |
| | | ,@RequestParam(value = "seq", required = false) Integer seq) { |
| | | if (!permissionConfig.check(MenuEnum.C3_CHARGING_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(c3ChargingService.getC3ChargingListByKeyword(baseConditionVO, c3ChargingParam)); |
| | | return ResponseUtil.success(c3ChargingService.getC3ChargingListByKeyword(baseConditionVO, c3ChargingParam, order, seq)); |
| | | } |
| | | |
| | | @AnonymousAccess |
| | |
| | | */ |
| | | @GetMapping("/report/list") |
| | | public ResponseVO<Object> listReportData(BaseConditionVO conditionVO |
| | | , @RequestParam(value = "keyword", required = false) String keyword, @RequestParam(value = "deviceCode", required = false) String deviceCode) { |
| | | , @RequestParam(value = "keyword", required = false) String keyword |
| | | , @RequestParam(value = "deviceCode", required = false) String deviceCode |
| | | , @RequestParam(value = "order", required = false) Integer order |
| | | ,@RequestParam(value = "seq", required = false) Integer seq) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_DATA.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | CommonPage commonPage = lightReportDataService.listReportData(conditionVO.getPageNo(), conditionVO.getPageSize(), keyword, deviceCode); |
| | | CommonPage commonPage = lightReportDataService.listReportData(conditionVO.getPageNo(), conditionVO.getPageSize(), keyword, deviceCode,order,seq); |
| | | List<LightReportDataBo> lightReportDataBos = (List<LightReportDataBo>) commonPage.getList(); |
| | | |
| | | if (lightReportDataBos == null) { |
| | |
| | | import com.sandu.ximon.admin.vo.EquipmentInfomation; |
| | | import com.sandu.ximon.dao.bo.C3ChargingBo; |
| | | import com.sandu.ximon.dao.domain.*; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.enums.OrderStatus; |
| | | import com.sandu.ximon.dao.mapper.C3mChargingMapper; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | public Map getC3ChargingListByKeyword(BaseConditionVO baseConditionVO, C3ChargingParam c3ChargingParam) { |
| | | public Map getC3ChargingListByKeyword(BaseConditionVO baseConditionVO, C3ChargingParam c3ChargingParam, Integer order, Integer seq) { |
| | | if (c3ChargingParam == null) { |
| | | c3ChargingParam = new C3ChargingParam(); |
| | | } |
| | |
| | | if (c3ChargingParam.getKeyword() != null) { |
| | | c3ChargingParam.setKeyword(c3ChargingParam.getKeyword().trim()); |
| | | } |
| | | //排序字段 |
| | | String orderByResult = "t1.c3_id"; |
| | | //正序、倒叙 |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.CHARGE_POLE_CREATE_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = " ASC"; |
| | | break; |
| | | case 2: |
| | | orderBySeq = " DESC"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | //排序方式 |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | |
| | | List<C3ChargingBo> c3ChargingBoList; |
| | | if (SecurityUtils.getClientId() == null) { |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(c3ChargingParam.getKeyword(), null); |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(c3ChargingParam.getKeyword(), null, orderBy); |
| | | } else { |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(c3ChargingParam.getKeyword(), SecurityUtils.getUserId()); |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(c3ChargingParam.getKeyword(), SecurityUtils.getUserId(), orderBy); |
| | | } |
| | | //在线数量 |
| | | int onlineNumber = 0; |
| | |
| | | |
| | | List<C3ChargingBo> c3ChargingBoList; |
| | | if (SecurityUtils.getClientId() == null) { |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(null, null); |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(null, null, "c3_id ASC"); |
| | | } else { |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(null, SecurityUtils.getUserId()); |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(null, SecurityUtils.getUserId(), "c3_id ASC"); |
| | | } |
| | | return c3ChargingBoList; |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | //大气故障数据 |
| | | //大气故障数据 todo 暂无 |
| | | |
| | | //对errorMsgDtos按创建时间倒叙 |
| | | errorMsgDtos.sort((a, b) -> b.getErrorTime().compareTo(a.getErrorTime())); |
| | |
| | | import com.sandu.ximon.dao.domain.LightReportData; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.mapper.LightReportDataMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | |
| | | * @param keyword 关键词 |
| | | * @param deviceCode 设备码 |
| | | */ |
| | | public CommonPage listReportData(int pageNo, int pageSize, String keyword, String deviceCode) { |
| | | public CommonPage listReportData(int pageNo, int pageSize, String keyword, String deviceCode,Integer order,Integer seq) { |
| | | |
| | | List<LightReportDataBo> lightReportDataBos = new ArrayList<>(pageSize); |
| | | |
| | | CommonPage<String> stringCommonPage = SpringContextHolder.getBean(LightService.class).listDeviceCode(pageNo, pageSize, keyword, deviceCode); |
| | | //排序字段 |
| | | String orderByResult = "t1.create_time"; |
| | | //正序、倒叙 |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.LIGHT_DATA_CREATE_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = " ASC"; |
| | | break; |
| | | case 2: |
| | | orderBySeq = " DESC"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | //排序方式 |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | CommonPage<String> stringCommonPage = SpringContextHolder.getBean(LightService.class).listDeviceCode(pageNo, pageSize, keyword, deviceCode,orderBy); |
| | | List<String> macList = stringCommonPage.getList(); |
| | | if (CollUtil.isEmpty(macList)) { |
| | | return new CommonPage(); |
| | |
| | | /** |
| | | * 获取用户所有的设备码 |
| | | */ |
| | | public CommonPage<String> listDeviceCode(int pageNo, int pageSize, String keyword, String deviceCode) { |
| | | public CommonPage<String> listDeviceCode(int pageNo, int pageSize, String keyword, String deviceCode,String orderBy) { |
| | | List<String> list; |
| | | if (SecurityUtils.getClientId() != null) { |
| | | PageHelper.startPage(pageNo, pageSize); |
| | | list = baseMapper.listCode(SecurityUtils.getUserId(), keyword, deviceCode); |
| | | } else { |
| | | |
| | | PageHelper.startPage(pageNo, pageSize); |
| | | PageHelper.startPage(pageNo, pageSize,orderBy); |
| | | list = baseMapper.listCode(null, keyword, deviceCode); |
| | | } |
| | | |