| | |
| | | public interface MonitorMapper extends BaseMapper<Monitor> { |
| | | List<Monitor> listMonitorByKeyword(String keyword, int equipmentState1, int equipmentState2, |
| | | int bindingState1, int bindingState2); |
| | | |
| | | List<Monitor> listMonitorByKeyword1(String keyword, int bindingState1, int bindingState2); |
| | | } |
| | | |
| | | |
| | |
| | | </resultMap> |
| | | <select id="listMonitorByKeyword" resultType="com.sandu.ximon.dao.domain.Monitor"> |
| | | SELECT * FROM (SELECT * FROM (SELECT * FROM monitor AS table1 |
| | | WHERE serial_number LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR belong_to LIKE CONCAT(CONCAT('%', #{keyword}), '%')) AS table2 |
| | | WHERE equipment_state = #{equipmentState1} |
| | | OR equipment_state = #{equipmentState2}) AS table3 |
| | | WHERE device_serial LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | ) AS table2 |
| | | WHERE equipment_status = #{equipmentState1} |
| | | OR equipment_status = #{equipmentState2}) AS table3 |
| | | WHERE binding_state = #{bindingState1} OR binding_state = #{bindingState2}; |
| | | </select> |
| | | <select id="listMonitorByKeyword1" resultType="com.sandu.ximon.dao.domain.Monitor"> |
| | | SELECT |
| | | t1.*, t2.pole_id, |
| | | t3.pole_name |
| | | FROM |
| | | monitor t1 |
| | | LEFT JOIN pole_binding t2 ON t1.device_serial = t2.device_code |
| | | AND t2.device_type = 7 |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | WHERE |
| | | t1.device_serial LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t2.pole_id LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | OR t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') |
| | | AND binding_state = #{bindingState1} |
| | | OR binding_state = #{bindingState2}) |
| | | ORDER BY |
| | | t1.id DESC |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | | <!-- SELECT * FROM (SELECT * FROM (SELECT * FROM monitor AS table1--> |
| | | <!-- WHERE device_serial LIKE CONCAT(CONCAT('%', #{keyword}), '%')--> |
| | | <!-- OR belong_to LIKE CONCAT(CONCAT('%', #{keyword}), '%')) AS table2--> |
| | | <!-- WHERE equipment_status = #{equipmentState1}--> |
| | | <!-- OR equipment_status = #{equipmentState2}) AS table3--> |
| | | <!-- WHERE binding_state = #{bindingState1} OR binding_state = #{bindingState2};--> |
| | |
| | | bindingState1 = monitorParam.getBindingState(); |
| | | bindingState2 = monitorParam.getBindingState(); |
| | | } |
| | | return monitorMapper.listMonitorByKeyword(monitorParam.getKeyword(), equipmentState1, equipmentState2, bindingState1, bindingState2); |
| | | // return monitorMapper.listMonitorByKeyword(monitorParam.getKeyword(), equipmentState1, equipmentState2, bindingState1, bindingState2); |
| | | return monitorMapper.listMonitorByKeyword1(monitorParam.getKeyword(), bindingState1, bindingState2); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.param.PoleBindingParam; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | |
| | | Integer deviceType = param.getDeviceType(); |
| | | // if (PoleBindingEnums.LIGHT.getCode().equals(deviceType)) { |
| | | // } |
| | | |
| | | PoleBinding one = getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, param.getDeviceCode())); |
| | | if (one == null) { |
| | | PoleBinding poleBinding = new PoleBinding(); |
| | | poleBinding.setPoleId(poleId); |
| | | poleBinding.setDeviceType(deviceType); |
| | | poleBinding.setDeviceName(param.getDeviceName()); |
| | | poleBinding.setDeviceCode(param.getDeviceCode()); |
| | | return save(poleBinding); |
| | | } else { |
| | | throw new BusinessException("该设备已绑定过"); |
| | | } |
| | | |
| | | |
| | | // return false; |
| | | |
| | | } |
| | | } |
| | |
| | | password: chenjiantian1992 # Redis服务器连接密码(默认为空) |
| | | timeout: 300ms # 连接超时时间(毫秒) |
| | | server: |
| | | port: 20017 |
| | | port: 8080 |
| | | sandu: |
| | | jwt: |
| | | header: Authorization |