| | |
| | | List<Map<String, Object>> getDeviceVersionIdByMonitorPoint(Integer monitorPointId);
|
| | |
|
| | | List<Device> selectByOrgIdAndDevName(@Param("orgId")Integer orgId,@Param("devName")String devName);
|
| | |
|
| | | /**
|
| | | *
|
| | | * @param orgId
|
| | | * @param mpId
|
| | | * @return 返回未删除结果
|
| | | */
|
| | | List<Device> selectByOrgIdAndMpId(@Param("orgId")Integer orgId,@Param("mpId")Integer mpId);
|
| | | List<Device> selectByMap(Map<String, Object> params);
|
| | | Device selectWithOrgIdsByMac(String mac);
|
| | |
| | | *
|
| | | * @param map
|
| | | * map里 包括 组织id和4个坐标点
|
| | | * @return
|
| | | * @return 返回未删除结果集
|
| | | */
|
| | | @Override
|
| | | public List<Device> query(Map<String, Object> map) {
|
| | |
| | | * @param deviceName
|
| | | * @param pageSize
|
| | | * @param pageNo
|
| | | * @return
|
| | | * @return 返回未删除结果
|
| | | */
|
| | | @Override
|
| | | public PageResult query(Integer orgId, String deviceName, Integer pageSize, Integer pageNo) {
|
| | |
| | | * @param mpId
|
| | | * @param pageSize
|
| | | * @param pageNo
|
| | | * @return
|
| | | * @return 返回未删除结果
|
| | | */
|
| | | @Override
|
| | | public PageResult query(Integer orgId, Integer mpId, Integer pageSize, Integer pageNo) {
|
| | |
| | | Device device = new Device();
|
| | | device.setIsDelete(Constants.IS_DELETE_TRUE);
|
| | | if(ids!=null&&ids.length>0){
|
| | | Example example = new Example(ENTITY_CLASS);
|
| | | example.or().andIn("id", Arrays.asList(ids));
|
| | | if(ids.length==1){
|
| | | device.setId(ids[0]);
|
| | | deviceMapper.updateByPrimaryKeySelective(device);
|
| | | }else{
|
| | | Example example = new Example(ENTITY_CLASS);
|
| | | example.or().andIn("id", Arrays.asList(ids));
|
| | | deviceMapper.updateByExampleSelective(device,example);
|
| | | }
|
| | |
|
| | | List<Device> deviceList = deviceMapper.selectByExample(example);
|
| | | List<String> adjustAndDeviceKeys = deviceList.stream().collect(
|
| | | ArrayList<String>::new,
|
| | | (list,dev) -> {
|
| | | if(!StringUtils.isBlank(dev.getMac())){
|
| | | list.add("device_"+dev.getMac());
|
| | | list.add("adjust_"+dev.getMac());
|
| | | }
|
| | | },
|
| | | (oList,nList)-> {
|
| | | oList.addAll(nList);
|
| | | }
|
| | | );
|
| | | redisUtils.remove(adjustAndDeviceKeys.toArray(new String [adjustAndDeviceKeys.size()]));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | <if test="devName!=null and ''!=devName"> |
| | | and dev.name like CONCAT('%',#{devName},'%') |
| | | </if> |
| | | and dev.is_delete = 0 |
| | | </where> |
| | | </select> |
| | | <select id="selectByOrgIdAndMpId" resultMap="BaseResultMap"> |
| | |
| | | mpt.organization_id = #{orgId} |
| | | </if> |
| | | and dev.monitor_point_id = #{mpId} |
| | | and dev.is_delete = 0 |
| | | </where> |
| | | </select> |
| | | <select id="selectByMap" parameterType="java.util.Map" resultMap="BaseResultMap"> |
| | |
| | | AND dev.latitude < #{mapBounds.Fe,jdbcType=NUMERIC} |
| | | AND dev.latitude > #{mapBounds.Ke,jdbcType=NUMERIC} |
| | | ]]> |
| | | AND dev.is_delete =0 |
| | | </where> |
| | | </select> |
| | | <resultMap id="BaseResultWithOrgIdsMap" type="com.moral.entity.Device" extends="BaseResultMap"> |
| | |
| | | left join monitor_point mpt on dev.monitor_point_id = mpt.id |
| | | left join profession pro on pro.id = dev.profession_id |
| | | where dev.mac = #{mac,jdbcType=VARCHAR} |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | <select id="getDeviceCountByRegion" resultType="java.lang.Integer"> |
| | |
| | | "increment": [ |
| | | 25, |
| | | 30, |
| | | 40 |
| | | 60 |
| | | ], |
| | | "degressEnable": 0, |
| | | "degression": [0,0,0] |