| | |
| | | <project version="4"> |
| | | <component name="Encoding"> |
| | | <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" /> |
| | | </component> |
| | | </project> |
| | |
| | | <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" /> |
| | | </remote-repository> |
| | | <remote-repository> |
| | | <option name="id" value="central" /> |
| | | <option name="name" value="Central Repository" /> |
| | | <option name="url" value="https://repo.maven.apache.org/maven2" /> |
| | | </remote-repository> |
| | | <remote-repository> |
| | | <option name="id" value="spring-snapshots" /> |
| | | <option name="name" value="Spring Snapshots" /> |
| | | <option name="url" value="http://repo.spring.io/libs-snapshot-local" /> |
| | |
| | | "src/main/java/api/dao/LampDao.java,d\0\d0d1e8f47438a32015e088e692535feeed269aef |
| | | ] |
| | | -src/main/java/api/service/WeatherService.java,9\3\93a9bd117cced6b9c7148662c8fd3c4c897df38c |
| | | U |
| | | %src/main/java/api/APIApplication.java,b\a\ba3268bafd7e0ebaede0ee9191f3fb1e1c429db1 |
| | | 7 |
| | | pom.xml,4\4\442292b8a7efeabbe4cc176709b833b1792140ec |
| | | \ |
| | | ,src/main/java/api/dao/SinglelampDataDao.java,c\e\ce4a830e5e4def64dc852bb018931e75b6adb0a2 |
| | | c |
| | | 3src/main/java/api/service/SinglelampDataServer.java,c\7\c72fbd54d77e074dc19b9a2f8657b608014f95ab |
| | | ` |
| | | 0src/main/java/api/bean/PoleSensorV2VOEntity.java,d\4\d4cc4e15977bad28854c14d8c280f689febe6570 |
| | | U |
| | | %src/main/java/api/utils/HttpUtil.java,0\0\0097a929f7209d0ce32de24604bdd3ce8e365117 |
| | | %src/main/java/api/APIApplication.java,b\a\ba3268bafd7e0ebaede0ee9191f3fb1e1c429db1 |
| | | e |
| | | 5src/main/java/api/controller/WeatherV2Controller.java,c\6\c6f2cda030094ab71d90caeaf0d3a6d607ca19c4 |
| | | \ |
| | | ,src/main/java/api/dao/SinglelampDataDao.java,c\e\ce4a830e5e4def64dc852bb018931e75b6adb0a2 |
| | | j |
| | | :src/main/java/api/controller/OldSystemLoginController.java,0\c\0cd175614b2b4167efc66fd7bf6676af1f646c09 |
| | | Z |
| | | *src/main/java/api/service/PoleService.java,f\6\f664ae3a66d4021886879267708e49b9d5e82048 |
| | |
| | | <artifactId>spring-boot-configuration-processor</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-generator</artifactId> |
| | | <version>3.2.0</version> |
| | | </dependency> |
| | | <!--MPä¾èµ--> |
| | | <!-- <dependency> |
| | | <groupId>com.baomidou</groupId> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | //package api; |
| | | // |
| | | // |
| | | //import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | //import com.github.pagehelper.PageInfo; |
| | | //import io.machine.common.utils.R; |
| | | //import io.machine.modules.photovoltaic.entity.PhotovoltaicEntity; |
| | | //import io.machine.modules.photovoltaic.service.PhotovoltaicEntityService; |
| | | //import org.springframework.web.bind.annotation.*; |
| | | // |
| | | //import javax.annotation.Resource; |
| | | //import java.io.Serializable; |
| | | //import java.util.*; |
| | | //import java.util.stream.Collectors; |
| | | // |
| | | //import static io.machine.common.utils.ShiroUtils.getUserId; |
| | | // |
| | | ///** |
| | | // * (PhotovoltaicEntity)表æ§å¶å± |
| | | // * |
| | | // * @author makejava |
| | | // * @since 2022-09-28 17:35:48 |
| | | // */ |
| | | //@RestController |
| | | //@RequestMapping("photovoltaic") |
| | | //public class PhotovoltaicEntityController extends ApiController { |
| | | // /** |
| | | // * æå¡å¯¹è±¡ |
| | | // */ |
| | | // @Resource |
| | | // private PhotovoltaicEntityService photovoltaicEntityService; |
| | | // |
| | | // /** |
| | | // * å页æ¥è¯¢æææ°æ® |
| | | // * |
| | | // * @return æææ°æ® |
| | | // */ |
| | | // @RequestMapping("/list") |
| | | // public R selectAll(@RequestBody Map map) { |
| | | // PageInfo<PhotovoltaicEntity> pageInfo = photovoltaicEntityService.list( |
| | | // (Integer) map.get("page"), |
| | | // (Integer) map.get("size"), |
| | | // (String) map.get("key"), |
| | | // getUserId() |
| | | // ); |
| | | // return R.ok().put("page", pageInfo); |
| | | // } |
| | | // |
| | | // /** |
| | | // * éè¿ä¸»é®æ¥è¯¢åæ¡æ°æ® |
| | | // * |
| | | // * @param id ä¸»é® |
| | | // * @return åæ¡æ°æ® |
| | | // */ |
| | | // @PostMapping("{id}") |
| | | // public R selectOne(@PathVariable Serializable id) { |
| | | // return R.ok().put("data",this.photovoltaicEntityService.getById(id)); |
| | | // } |
| | | // |
| | | // /** |
| | | // * æ°å¢æ°æ® |
| | | // * |
| | | // * @param photovoltaicEntity å®ä½å¯¹è±¡ |
| | | // * @return æ°å¢ç»æ |
| | | // */ |
| | | // @PostMapping("save") |
| | | // public R insert(@RequestBody PhotovoltaicEntity photovoltaicEntity) { |
| | | // photovoltaicEntity.setCreateTime(new Date()); |
| | | // photovoltaicEntity.setUpdateTime(new Date()); |
| | | // |
| | | // photovoltaicEntity.setCreateUserId(getUserId()); |
| | | // String result = "ä¿å失败"; |
| | | // if (this.photovoltaicEntityService.save(photovoltaicEntity)){ |
| | | // result = "ä¿åæå"; |
| | | // } |
| | | // return R.ok().put("data",result); |
| | | // } |
| | | // |
| | | // /** |
| | | // * ä¿®æ¹æ°æ® |
| | | // * |
| | | // * @param photovoltaicEntity å®ä½å¯¹è±¡ |
| | | // * @return ä¿®æ¹ç»æ |
| | | // */ |
| | | // @PostMapping("update") |
| | | // public R update(@RequestBody PhotovoltaicEntity photovoltaicEntity) { |
| | | // |
| | | // photovoltaicEntity.setUpdateTime(new Date()); |
| | | // String result = "ä¿®æ¹å¤±è´¥"; |
| | | // |
| | | // PageInfo<PhotovoltaicEntity> list = photovoltaicEntityService.list( |
| | | // 1, |
| | | // 1000, |
| | | // null, |
| | | // getUserId() |
| | | // ); |
| | | // List<Integer> haslist = list.getList().stream().map(PhotovoltaicEntity::getPhotovoltaicId).collect(Collectors.toList()); |
| | | // |
| | | // |
| | | // if (!haslist.containsAll(Collections.singleton(photovoltaicEntity.getPhotovoltaicId()))){ |
| | | // result = "è¯·æ£æ¥PhotovoltaicIdæ¯å¦åæ³"; |
| | | // } |
| | | // if (this.photovoltaicEntityService.updateById(photovoltaicEntity)){ |
| | | // result = "ä¿®æ¹æå"; |
| | | // } |
| | | // return R.ok().put("data",result); |
| | | // } |
| | | // |
| | | // /** |
| | | // * å 餿°æ® |
| | | // * |
| | | // * @param ids 主é®ç»å |
| | | // * @return å é¤ç»æ |
| | | // */ |
| | | // @PostMapping("delete") |
| | | // public R delete(@RequestBody Long[] ids) { |
| | | // |
| | | // String result = "å é¤å¤±è´¥"; |
| | | // |
| | | // PageInfo<PhotovoltaicEntity> list = photovoltaicEntityService.list( |
| | | // 1, |
| | | // 1000, |
| | | // null, |
| | | // getUserId() |
| | | // ); |
| | | // List<Integer> haslist = list.getList().stream().map(PhotovoltaicEntity::getPhotovoltaicId).collect(Collectors.toList()); |
| | | // |
| | | // |
| | | // if (!haslist.containsAll(Arrays.asList(ids))){ |
| | | // result = "è¯·æ£æ¥idsæ¯å¦åæ³"; |
| | | // } |
| | | // if (this.photovoltaicEntityService.removeByIds(Arrays.asList(ids))){ |
| | | // result = ids.clone().toString()+"å 餿å"; |
| | | // } |
| | | // return R.ok().put("data",result); |
| | | // } |
| | | //} |
| | | // |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | //package api; |
| | | // |
| | | //import com.github.pagehelper.PageInfo; |
| | | //import io.machine.common.bean.Pages; |
| | | //import io.machine.common.utils.R; |
| | | //import io.machine.modules.photovoltaic.entity.PhotovoltaicHeartData; |
| | | //import io.machine.modules.photovoltaic.service.PhotovoltaicHeartDataService; |
| | | //import org.springframework.web.bind.annotation.RequestBody; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RestController; |
| | | // |
| | | //import javax.annotation.Resource; |
| | | // |
| | | ///** |
| | | // * å
ä¼å¿è·³æ°æ®è¡¨(PhotovoltaicHeartData)表æ§å¶å± |
| | | // * |
| | | // * @author makejava |
| | | // * @since 2022-09-29 17:36:34 |
| | | // */ |
| | | //@RestController |
| | | //@RequestMapping("photovoltaicHeartData") |
| | | //public class PhotovoltaicHeartDataController { |
| | | // /** |
| | | // * æå¡å¯¹è±¡ |
| | | // */ |
| | | // @Resource |
| | | // private PhotovoltaicHeartDataService photovoltaicHeartDataService; |
| | | // |
| | | // @RequestMapping("/list") |
| | | // public R list(@RequestBody Pages pages) { |
| | | // PageInfo<PhotovoltaicHeartData> page = photovoltaicHeartDataService.list(pages); |
| | | // return R.ok().put("page",page); |
| | | // } |
| | | //} |
| | | // |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.bean; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (HuinengMachineError)表å®ä½ç±» |
| | | * |
| | | * å
å«éªä¸ºå¥ç¨æ¼é³ï¼å°±ç¥éå®å«huinengjiï¼æ²¡å«çä¿¡æ¯äº |
| | | * @author makejava |
| | | * @since 2022-10-22 17:52:06 |
| | | */ |
| | | @SuppressWarnings("serial") |
| | | @Data |
| | | public class HuinengMachineError extends Model<HuinengMachineError> { |
| | | |
| | | @TableId(value = "error_id", type = IdType.AUTO) |
| | | private Long errorId; |
| | | |
| | | private String streetlightMac; |
| | | |
| | | private String errorCode; |
| | | |
| | | private String errorMsg; |
| | | |
| | | // private String destinationAddress; |
| | | |
| | | private Date timestamp; |
| | | |
| | | @TableField(exist = false) |
| | | private String photovoltaicId; |
| | | |
| | | @TableField(exist = false) |
| | | private String photovoltaicName; |
| | | |
| | | /** |
| | | * è·å主é®å¼ |
| | | * |
| | | * @return 主é®å¼ |
| | | */ |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.errorId; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.bean; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class Pages { |
| | | |
| | | private Integer page; |
| | | private Integer size; |
| | | private String key; |
| | | private Integer groupId; |
| | | private List cardIdList; |
| | | private Long streetlightId; |
| | | private String mac; |
| | | |
| | | private String field; |
| | | private String sort; |
| | | private Integer photovoltaicId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.bean; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (PhotovoltaicEntity)表å®ä½ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-28 17:35:50 |
| | | */ |
| | | @Data |
| | | public class PhotovoltaicEntity { |
| | | //å
ä¼ä¸»æºid |
| | | private Integer photovoltaicId; |
| | | //å
ä¼ä¸»æºåç§° |
| | | private String photovoltaicName; |
| | | //å
ä¼ä¸»æºåºåå· |
| | | private String photovoltaicMac; |
| | | //0çµæ± /1å¸çµä¼å
æ¨¡å¼ |
| | | private Integer photovoltaicWorkPattern; |
| | | //å
ä¼ç¡¬ä»¶è¦å |
| | | // private String photovoltaicWorkWaring; |
| | | //ç»å®ç¯æid |
| | | private Long bindPoleStreelightId; |
| | | //å
ä¼ç¡¬ä»¶çæ¬ |
| | | private String hardwareVersion; |
| | | //ä¿®æ¹æ¶é´ |
| | | private Date updateTime; |
| | | //å建è
ID |
| | | private Long createUserId; |
| | | //å建æ¶é´ |
| | | private Date createTime; |
| | | //è½¯ä»¶çæ¬ |
| | | private String softwareVersion; |
| | | |
| | | /** |
| | | * ç¯æmac |
| | | * */ |
| | | @TableField(exist = false) |
| | | private String codeNumber; |
| | | |
| | | // @TableField(exist = false) |
| | | // private Integer onlineStatus; |
| | | |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.bean; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (PhotovoltaicError)表å®ä½ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-30 11:53:07 |
| | | */ |
| | | @Data |
| | | public class PhotovoltaicError { |
| | | |
| | | private Integer errorId; |
| | | |
| | | private String streetlightMac; |
| | | |
| | | private String errorCode; |
| | | |
| | | private String errorMsg; |
| | | |
| | | private String destinationAddress; |
| | | |
| | | private Date timestamp; |
| | | |
| | | @TableField(exist = false) |
| | | private String photovoltaicId; |
| | | |
| | | @TableField(exist = false) |
| | | private String photovoltaicName; |
| | | |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.bean; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | *å
伿
éç |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-30 11:53:07 |
| | | */ |
| | | public class PhotovoltaicErrorCode { |
| | | |
| | | |
| | | |
| | | /* |
| | | bit31 bit30 bit29 bit28 bit27 bit26 bit25 bit24 |
| | | 0 0 0 çµæ± 忥 "çµæ± 使¸©ä¿æ¤ï¼åæ¢å
çµ" "è¿å
ä¿æ¤ï¼åæ¢å
çµ" "çµæ± 使¸©ä¿æ¤ï¼ç¦æ¢æ¾çµ" "çµæ± 髿¸©ä¿æ¤ï¼ç¦æ¢æ¾çµ" |
| | | |
| | | bit23 bit22 bit21 bit20 bit19 bit18 bit17 bit16 |
| | | æªæ£æµå°çµæ± ï¼é
é
¸ï¼ ä¾çµç¶æ 0 0 0 0 0 0 |
| | | |
| | | bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 |
| | | 0 0 0 å
伿¿æ¥å å
ä¼å·¥ä½ç¹è¶
å 0 å
ä¼è¾å
¥è¶
å 0 |
| | | |
| | | bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 |
| | | å
ä¼åçè¿å¤§ "çµæ± 髿¸©ä¿æ¤ï¼ç¦æ¢å
çµ" ä¸»æºæ¸©åº¦è¿é« è´è½½è¿è½½ è´è½½çè·¯ çµæ± æ¬ å çµæ± è¶
å çµæ± è¿æ¾ |
| | | |
| | | */ |
| | | // çµæ± è¿æ¾(0), |
| | | // |
| | | // çµæ± è¶
å(1), |
| | | |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.bean; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import lombok.Data; |
| | | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * å
ä¼å¿è·³æ°æ®è¡¨(PhotovoltaicHeartData)å®ä½ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-29 17:36:34 |
| | | */ |
| | | @Data |
| | | public class PhotovoltaicHeartData implements Serializable { |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String streetlightName; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = -38053934285994098L; |
| | | /** |
| | | * 主é®ID |
| | | */ |
| | | private Long photovoltaicHeartDataId; |
| | | /** |
| | | * è·¯ç¯ID |
| | | */ |
| | | @TableField(exist=false) |
| | | private Integer streetlightId; |
| | | /** |
| | | * è´è½½ç¶æåå
çµç¶æ |
| | | * é« 8 ä½ï¼ |
| | | * b7:è´è½½ç¶æï¼0ï¼è´è½½å·²å
³ï¼1ï¼è´è½½å·²å¼ï¼ |
| | | * b0ï½b6:为亮度å¼ï¼0% ~100%ï¼ |
| | | * ä½ 8 ä½ï¼ |
| | | * 00H:æªå¼å¯å
çµ |
| | | * 01H:å¯å¨å
çµæ¨¡å¼ |
| | | * 02H:mppt å
çµæ¨¡å¼ |
| | | * 03H:åè¡¡å
çµæ¨¡å¼ |
| | | * 04H:æåå
çµæ¨¡å¼ |
| | | * 05H:æµ®å
å
çµæ¨¡å¼ |
| | | * 06H:éæµ(è¶
åç) |
| | | * 1110010000000000 |
| | | */ |
| | | private String chargingStatus; |
| | | /** |
| | | * çµæ± çµéSOC |
| | | */ |
| | | private Integer batteryLevel; |
| | | /** |
| | | * çµæ± çµå |
| | | */ |
| | | private Double batteryVoltage; |
| | | /** |
| | | * çµæ± å
çµçµæµ |
| | | */ |
| | | private Double batteryChargingCurrent; |
| | | /** |
| | | * è®¾å¤æ¸©åº¦/çµæ± 温度 |
| | | */ |
| | | private Double deviceTemperature; |
| | | /** |
| | | * è®¾å¤æ¸©åº¦/çµæ± 温度 |
| | | */ |
| | | private Double batteryTemperature; |
| | | // /** |
| | | // * ç´æµè´è½½çµå |
| | | // */ |
| | | // private Double dcLoadVoltage; |
| | | // /** |
| | | // * ç´æµè´è½½çµæµ |
| | | // */ |
| | | // private Double dcLoadCurrent; |
| | | // /** |
| | | // * ç´æµè´è½½åç |
| | | // */ |
| | | // private Double dcLoadPower; |
| | | /** |
| | | * å
伿¿çµå |
| | | */ |
| | | private Double photovoltaicPanelVoltage; |
| | | /** |
| | | * å
伿¿çµæµ |
| | | */ |
| | | private Double photovoltaicPanelCurrent; |
| | | /** |
| | | * å
伿¿å
çµåç |
| | | */ |
| | | private Double photovoltaicPanelChargingPower; |
| | | // /** |
| | | // * å½å¤©å
çµæ¶é¿ |
| | | // */ |
| | | // private Double samedayChargingDuration; |
| | | // /** |
| | | // * å½å¤©å
çµæå¤§åç |
| | | // */ |
| | | // private Double samedayChargingMaxpower; |
| | | // /** |
| | | // * å½å¤©çµæ± æé«æ¸©åº¦ |
| | | // */ |
| | | // private Double samedayChargingMaxtemp; |
| | | // /** |
| | | // * å½å¤©çµæ± æä½æ¸©åº¦ |
| | | // */ |
| | | // private Double samedayChargingMintemp; |
| | | // /** |
| | | // * å½å¤©æ¾çµæå¤§åç |
| | | // */ |
| | | // private Double samedayDischargingMaxpower; |
| | | // /** |
| | | // * å½å¤©å
çµå®æ¶æ° |
| | | // */ |
| | | // private Double samedayBatteryChargingAh; |
| | | // /** |
| | | // * å½å¤©æ¾çµå®æ¶æ° |
| | | // */ |
| | | // private Double samedayBatteryDischargingAh; |
| | | // /** |
| | | // * å½å¤©åçµé |
| | | // */ |
| | | // private Double samedayGeneratingCapacity; |
| | | // /** |
| | | // * å½å¤©ç¨çµé |
| | | // */ |
| | | // private Double samedayUsedCapacity; |
| | | // /** |
| | | // * æ»è¿è¡å¤©æ° |
| | | // */ |
| | | // private Double totalOperatingDays; |
| | | // /** |
| | | // * èçµæ± æ»å
æ»¡æ¬¡æ° |
| | | // */ |
| | | // private Double batteryFullChargeTimes; |
| | | // /** |
| | | // * 累计åçµé |
| | | // */ |
| | | // private Double allGeneratingCapacity; |
| | | // /** |
| | | // * 累计ç¨çµé |
| | | // */ |
| | | // private Double allUsedCapacity; |
| | | /** |
| | | * æ°æ®æå
¥æ¶é´ |
| | | */ |
| | | private Date dataCreateTime; |
| | | |
| | | private String streetlightMac; |
| | | |
| | | //å
ä¼ä¸»æºid |
| | | @TableField(exist=false) |
| | | private Integer photovoltaicId; |
| | | //å
ä¼ä¸»æºåç§° |
| | | @TableField(exist=false) |
| | | private String photovoltaicName; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | private Integer lightNumber; |
| | | |
| | | private String deviceSerial; |
| | | |
| | | private Integer photovoltaicId; |
| | | public String getApiKey() { |
| | | return "84b5f9d6b37c47edb1adae628aaaf3e5"; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.bean; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @program: machine-fast |
| | | * @description: ç¨æ·ä¸å
¬å¸å¯¹åºå
³ç³» |
| | | * @author: YSS |
| | | * @create: 2019-04-18 11:13 |
| | | **/ |
| | | @Data |
| | | @TableName("sys_user_company") |
| | | public class SysUserCompanyEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @TableId |
| | | private Long id; |
| | | |
| | | /** |
| | | * ç¨æ·ID |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * è§è²ID |
| | | */ |
| | | private Long companyId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * Copyright (c) 2016-2019 äººäººå¼æº All rights reserved. |
| | | * |
| | | * https://www.machine.io |
| | | * |
| | | * çæææï¼ä¾µæå¿
ç©¶ï¼ |
| | | */ |
| | | |
| | | package api.bean; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * ç¨æ·ä¸è§è²å¯¹åºå
³ç³» |
| | | * |
| | | * @author Mark sunlightcs@gmail.com |
| | | */ |
| | | @Data |
| | | @TableName("sys_user_role") |
| | | public class SysUserRoleEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | @TableId |
| | | private Long id; |
| | | |
| | | /** |
| | | * ç¨æ·ID |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * è§è²ID |
| | | */ |
| | | private Long roleId; |
| | | |
| | | |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.common.util.concurrent.RateLimiter; |
| | | import com.google.gson.Gson; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | RateLimiter rateLimiter = RateLimiter.create(10.0); |
| | | |
| | | |
| | | @RequestMapping(value = "/list",method = RequestMethod.POST) |
| | | public Msg listWithNotStatus(@RequestBody ReqParams reqParams){ |
| | | rateLimiter.acquire(1); |
| | | if (reqParams.getLimit()>200){ |
| | | return Msg.error("limit exception!!!"); |
| | | } |
| | | Long userId = accessService.getUserId(reqParams.getAccessToken()); |
| | | |
| | | |
| | | if(userId == null){ |
| | | return Msg.error("accessToken exception!!!"); |
| | | } |
| | | |
| | | reqParams.setApiKey(reqParams.getApiKey()); |
| | | reqParams.setUserId(userId); |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/camera/cameraList", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | | Map msg = JSON.parseObject(result, HashMap.class); |
| | | |
| | | if (msg.get("msg").equals("success")){ |
| | | |
| | | return Msg.ok().put("data",msg.get("data")); |
| | | } |
| | | else { |
| | | return Msg.error(msg.get("msg").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/getToken", method = RequestMethod.POST) |
| | | public Msg getToken(@RequestBody ReqParams reqParams) { |
| | | rateLimiter.acquire(1); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.controller; |
| | | |
| | | import api.bean.*; |
| | | import api.result.Msg; |
| | | import api.service.*; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.google.common.util.concurrent.RateLimiter; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping() |
| | | public class PhotovoltaicController { |
| | | @Autowired |
| | | private AccessService accessService; |
| | | @Autowired |
| | | private HuinengMachineErrorService huinengMachineErrorService; |
| | | @Autowired |
| | | private PhotovoltaicEntityService photovoltaicEntityService; |
| | | @Autowired |
| | | private PhotovoltaicHeartDataService photovoltaicHeartDataService; |
| | | |
| | | RateLimiter rateLimiter = RateLimiter.create(10.0); |
| | | |
| | | |
| | | /** |
| | | * å
ä¼ä¸»æºå表 |
| | | * */ |
| | | @RequestMapping(value = "/photovoltaic/list") |
| | | public Msg photovoltaicList(@RequestBody ReqParams reqParams){ |
| | | rateLimiter.acquire(1); |
| | | if(reqParams.getLimit() > 200){ |
| | | return Msg.error("limit exception!!!"); |
| | | } |
| | | |
| | | Long userId = accessService.getUserId(reqParams.getAccessToken()); |
| | | |
| | | if(userId == null) { |
| | | return Msg.error("server exception"); |
| | | } |
| | | |
| | | PageInfo<PhotovoltaicEntity> info = photovoltaicEntityService.list(reqParams.getPage(), reqParams.getLimit(), reqParams.getKey(), userId); |
| | | |
| | | // Map data = new HashMap(); |
| | | // |
| | | // data.put("total",info.getTotal()); |
| | | // data.put("list",info.getList()); |
| | | |
| | | return Msg.ok().put("data",info); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å
ä¼ä¸»æºå¿è·³å
å表 |
| | | * */ |
| | | @RequestMapping(value = "/photovoltaicHeartData/list") |
| | | public Msg photovoltaicHeartDataList(@RequestBody ReqParams reqParams){ |
| | | rateLimiter.acquire(1); |
| | | if(reqParams.getLimit() > 200){ |
| | | return Msg.error("limit exception!!!"); |
| | | } |
| | | |
| | | Long userId = accessService.getUserId(reqParams.getAccessToken()); |
| | | |
| | | if(userId == null) { |
| | | return Msg.error("server exception"); |
| | | } |
| | | |
| | | Pages pages = new Pages(); |
| | | |
| | | pages.setPage(reqParams.getPage()); |
| | | pages.setSize(reqParams.getLimit()); |
| | | pages.setPhotovoltaicId(reqParams.getPhotovoltaicId()); |
| | | |
| | | PageInfo<PhotovoltaicHeartData> info = photovoltaicHeartDataService.list(pages, userId); |
| | | |
| | | Map data = new HashMap(); |
| | | |
| | | // data.put("total",info.getTotal()); |
| | | // data.put("list",info.getList()); |
| | | |
| | | return Msg.ok().put("data",info); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ
§è½æºæ
éå表 |
| | | * */ |
| | | @RequestMapping(value = "/huinengMachineError/list") |
| | | public Msg soilList(@RequestBody ReqParams reqParams){ |
| | | rateLimiter.acquire(1); |
| | | if(reqParams.getLimit() > 200){ |
| | | return Msg.error("limit exception!!!"); |
| | | } |
| | | |
| | | Long userId = accessService.getUserId(reqParams.getAccessToken()); |
| | | |
| | | if(userId == null) { |
| | | return Msg.error("server exception"); |
| | | } |
| | | |
| | | Pages pages = new Pages(); |
| | | |
| | | pages.setPage(reqParams.getPage()); |
| | | pages.setSize(reqParams.getLimit()); |
| | | pages.setPhotovoltaicId(reqParams.getPhotovoltaicId()); |
| | | |
| | | PageInfo<HuinengMachineError> info = huinengMachineErrorService.list(pages, userId); |
| | | |
| | | |
| | | // Map data = new HashMap(); |
| | | |
| | | // data.put("total",info.getTotal()); |
| | | // data.put("list",info.getList()); |
| | | |
| | | return Msg.ok().put("data",info); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | reqParams.setUserId(userId); |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/pole/polestreetlight/listWithNotStatus", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/pole/polestreetlight/listWithNotStatus", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | reqParams.setUserId(userId); |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/pole/polestreetlight/getStatusById", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/pole/polestreetlight/getStatusById", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/pole/polestreetlight/lightBatch", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/pole/polestreetlight/lightBatch", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | |
| | | @RequestMapping(value = "/list",method = RequestMethod.POST) |
| | | public Msg list(@RequestBody ReqParams reqParams){ |
| | | System.out.println(reqParams.toString()); |
| | | rateLimiter.acquire(1); |
| | | if (reqParams.getLimit()>200){ |
| | | return Msg.error("limit exception!!!"); |
| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/list", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/list", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | reqParams.setTimerRequest(timerRequest); |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/getStreetlightListByTimerId", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/getStreetlightListByTimerId", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/listByTimerId", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/listByTimerId", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/deleteTimerByTimerId", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/deleteTimerByTimerId", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/addTimer", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/addTimer", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| | |
| | | |
| | | |
| | | String result = HttpUtil.Post( |
| | | "http://127.0.0.1:8888/machine-fast/serv/api/timer/updateTimer", |
| | | "http://47.106.172.9:8888/machine-fast/serv/api/timer/updateTimer", |
| | | new Gson().toJson(reqParams) |
| | | ); |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.dao; |
| | | |
| | | import api.bean.HuinengMachineError; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (HuinengMachineError)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author makejava |
| | | * @since 2022-10-22 17:52:05 |
| | | */ |
| | | @Mapper |
| | | public interface HuinengMachineErrorDao extends BaseMapper<HuinengMachineError> { |
| | | |
| | | |
| | | |
| | | List<HuinengMachineError> findAllBySort(int page, int size, String field, String sort); |
| | | |
| | | List<HuinengMachineError> findByCompanyBySort(int page, int size, Long userId, Object o, String field, String sort); |
| | | |
| | | List<HuinengMachineError> findByPhotovoltaicId(Integer photovoltaicId); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.dao; |
| | | |
| | | import api.bean.PhotovoltaicEntity; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (PhotovoltaicEntity)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-28 17:35:49 |
| | | */ |
| | | @Mapper |
| | | public interface PhotovoltaicEntityDao extends BaseMapper<PhotovoltaicEntity> { |
| | | |
| | | /** |
| | | * æ¹éæ°å¢æ°æ®ï¼MyBatisåçforeachæ¹æ³ï¼ |
| | | * |
| | | * @param entities List<PhotovoltaicEntity> å®ä¾å¯¹è±¡å表 |
| | | * @return å½±åè¡æ° |
| | | */ |
| | | int insertBatch(@Param("entities") List<PhotovoltaicEntity> entities); |
| | | |
| | | /** |
| | | * æ¹éæ°å¢ææä¸»é®æ´æ°æ°æ®ï¼MyBatisåçforeachæ¹æ³ï¼ |
| | | * |
| | | * @param entities List<PhotovoltaicEntity> å®ä¾å¯¹è±¡å表 |
| | | * @return å½±åè¡æ° |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException å
¥åæ¯ç©ºListçæ¶å伿SQLè¯å¥é误çå¼å¸¸ï¼è¯·èªè¡æ ¡éªå
¥å |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<PhotovoltaicEntity> entities); |
| | | |
| | | List<PhotovoltaicEntity> listAll(@Param("key") String key); |
| | | |
| | | List<PhotovoltaicEntity> listByCompanyId(@Param("key")String key, Long companyId); |
| | | |
| | | List<PhotovoltaicEntity> listByUserId(@Param("key")String key, Long userId); |
| | | |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.dao; |
| | | |
| | | import api.bean.PhotovoltaicError; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (PhotovoltaicError)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-30 11:53:07 |
| | | */ |
| | | @Mapper |
| | | public interface PhotovoltaicErrorDao extends BaseMapper<PhotovoltaicError> { |
| | | |
| | | |
| | | List<PhotovoltaicError> findAllBySort(int page, int size, String field, String sort); |
| | | |
| | | List<PhotovoltaicError> findByCompanyBySort(int page, int size, Long userId, Object o, String field, String sort); |
| | | |
| | | List<PhotovoltaicError> findByPhotovoltaicId(Integer photovoltaicId); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.dao; |
| | | |
| | | |
| | | import api.bean.PhotovoltaicHeartData; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
ä¼å¿è·³æ°æ®è¡¨(PhotovoltaicHeartData)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-29 17:36:34 |
| | | */ |
| | | @Mapper |
| | | public interface PhotovoltaicHeartDataDao extends BaseMapper<PhotovoltaicHeartData> { |
| | | |
| | | List<PhotovoltaicHeartData> findAllBySort(@Param("page") Integer page,@Param("size") Integer size,@Param("field")String field,@Param("sort") String sort); |
| | | |
| | | List<PhotovoltaicHeartData> findByCompanyBySort(@Param("page") Integer page,@Param("size") Integer size,@Param("userId")Long userId,@Param("groupId") Integer groupId,@Param("field")String field,@Param("sort") String sort); |
| | | |
| | | List<PhotovoltaicHeartData> findByPhotovoltaicId(@Param("photovoltaicId") Integer photovoltaicId); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.dao; |
| | | |
| | | import api.bean.SysUserCompanyEntity; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: machine-fast |
| | | * @description: |
| | | * @author: YSS |
| | | * @create: 2019-04-18 11:21 |
| | | **/ |
| | | @Mapper |
| | | @Repository |
| | | public interface SysUserCompanyDao extends BaseMapper<SysUserCompanyEntity> { |
| | | |
| | | @Select("select company_id from sys_user_company where user_id = #{userId}") |
| | | Long queryCompanyId(@Param("userId") Long userId); |
| | | |
| | | @Select("select * from sys_user_company where company_id = (select company_id from sys_user_company where user_id = #{userId})") |
| | | List<SysUserCompanyEntity> listByCompanyId(@Param("userId") Long userId); |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * Copyright (c) 2016-2019 äººäººå¼æº All rights reserved. |
| | | * |
| | | * https://www.machine.io |
| | | * |
| | | * çæææï¼ä¾µæå¿
ç©¶ï¼ |
| | | */ |
| | | |
| | | package api.dao; |
| | | |
| | | import api.bean.SysUserRoleEntity; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | /** |
| | | * ç¨æ·ä¸è§è²å¯¹åºå
³ç³» |
| | | * |
| | | * @author Mark sunlightcs@gmail.com |
| | | */ |
| | | @Mapper |
| | | public interface SysUserRoleDao extends BaseMapper<SysUserRoleEntity> { |
| | | |
| | | // /** |
| | | // * æ ¹æ®ç¨æ·IDï¼è·åè§è²IDå表 |
| | | // */ |
| | | // List<Long> queryRoleIdList(Long userId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDï¼è·åè§è²IDå表 |
| | | */ |
| | | @Select("select role_id from sys_user_role where user_id = #{userId}") |
| | | Long queryRoleId(@Param("userId")Long userId); |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²IDæ°ç»ï¼æ¹éå é¤ |
| | | */ |
| | | int deleteBatch(Long[] roleIds); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.service; |
| | | |
| | | |
| | | import api.bean.HuinengMachineError; |
| | | import api.bean.Pages; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.pagehelper.PageInfo; |
| | | |
| | | /** |
| | | * (HuinengMachineError)表æå¡æ¥å£ |
| | | * |
| | | * @author makejava |
| | | * @since 2022-10-22 17:52:07 |
| | | */ |
| | | public interface HuinengMachineErrorService extends IService<HuinengMachineError> { |
| | | |
| | | |
| | | PageInfo<HuinengMachineError> list(Pages pages,Long userId); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.service; |
| | | |
| | | import api.bean.PhotovoltaicEntity; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.pagehelper.PageInfo; |
| | | |
| | | /** |
| | | * (PhotovoltaicEntity)表æå¡æ¥å£ |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-28 17:35:51 |
| | | */ |
| | | public interface PhotovoltaicEntityService extends IService<PhotovoltaicEntity> { |
| | | |
| | | PageInfo<PhotovoltaicEntity> list(Integer page, Integer limit, String key, Long userId); |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.service; |
| | | |
| | | import api.bean.Pages; |
| | | import api.bean.PhotovoltaicError; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.pagehelper.PageInfo; |
| | | |
| | | /** |
| | | * (PhotovoltaicError)表æå¡æ¥å£ |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-30 11:53:07 |
| | | */ |
| | | public interface PhotovoltaicErrorService extends IService<PhotovoltaicError> { |
| | | |
| | | |
| | | |
| | | PageInfo<PhotovoltaicError> list(Pages pages, Long userId); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.service; |
| | | |
| | | import api.bean.Pages; |
| | | import api.bean.PhotovoltaicHeartData; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.pagehelper.PageInfo; |
| | | |
| | | /** |
| | | * å
ä¼å¿è·³æ°æ®è¡¨(PhotovoltaicHeartData)表æå¡æ¥å£ |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-29 17:36:34 |
| | | */ |
| | | public interface PhotovoltaicHeartDataService extends IService<PhotovoltaicHeartData> { |
| | | |
| | | |
| | | |
| | | PageInfo<PhotovoltaicHeartData> list(Pages pages,Long userId); |
| | | |
| | | PageInfo<PhotovoltaicHeartData> getPhotovoltaicHeartDataByMac(Integer page, Integer size, String mac); |
| | | } |
| | |
| | | list = singlelampDao.selectAll(); |
| | | } else if (roleId.longValue() == 2 || roleId.longValue() == 3) { |
| | | count = singlelampDao.countByCompany(userId); |
| | | list = singlelampDao.selectByCompany(1, count, userId); |
| | | list = singlelampDao.selectByCompany(0, count, userId); |
| | | |
| | | } |
| | | Integer listLimit = reqParams.getLimit(); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.service; |
| | | |
| | | import api.bean.SysUserCompanyEntity; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: machine-fast |
| | | * @description: |
| | | * @author: YSS |
| | | * @create: 2019-04-18 11:09 |
| | | **/ |
| | | public interface SysUserCompanyService extends IService<SysUserCompanyEntity> { |
| | | |
| | | |
| | | Long queryCompanyId(Long userId); |
| | | |
| | | List<SysUserCompanyEntity> listByCompanyId(Long userId); |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * Copyright (c) 2016-2019 äººäººå¼æº All rights reserved. |
| | | * |
| | | * https://www.machine.io |
| | | * |
| | | * çæææï¼ä¾µæå¿
ç©¶ï¼ |
| | | */ |
| | | |
| | | package api.service; |
| | | |
| | | import api.bean.SysUserRoleEntity; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | |
| | | /** |
| | | * ç¨æ·ä¸è§è²å¯¹åºå
³ç³» |
| | | * |
| | | * @author Mark sunlightcs@gmail.com |
| | | */ |
| | | public interface SysUserRoleService extends IService<SysUserRoleEntity> { |
| | | |
| | | |
| | | // /** |
| | | // * æ ¹æ®ç¨æ·IDï¼è·åè§è²IDå表 |
| | | // */ |
| | | // List<Long> queryRoleIdList(Long userId); |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²IDæ°ç»ï¼æ¹éå é¤ |
| | | */ |
| | | int deleteBatch(Long[] roleIds); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDï¼è·åè§è²ID |
| | | */ |
| | | Long queryRoleId(Long userId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.service.impl; |
| | | |
| | | import api.bean.HuinengMachineError; |
| | | import api.bean.Pages; |
| | | import api.dao.HuinengMachineErrorDao; |
| | | import api.service.HuinengMachineErrorService; |
| | | import api.service.SysUserRoleService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (HuinengMachineError)表æå¡å®ç°ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2022-10-22 17:52:08 |
| | | */ |
| | | @Service("huinengMachineErrorService") |
| | | public class HuinengMachineErrorServiceImpl extends ServiceImpl<HuinengMachineErrorDao, HuinengMachineError> implements HuinengMachineErrorService { |
| | | |
| | | |
| | | @Autowired |
| | | private SysUserRoleService sysUserRoleService; |
| | | |
| | | @Autowired |
| | | private HuinengMachineErrorDao huinengMachineErrorDao; |
| | | |
| | | |
| | | @Override |
| | | public PageInfo<HuinengMachineError> list(Pages pages,Long userId) { |
| | | |
| | | //è·åè§è²å表 |
| | | Long roleId = sysUserRoleService.queryRoleId(userId); |
| | | |
| | | if (roleId == null || roleId == 0) { |
| | | return null; |
| | | } |
| | | |
| | | int page = pages.getPage() - 1; |
| | | int size = pages.getSize(); |
| | | |
| | | List<HuinengMachineError> allList = new ArrayList<>(); |
| | | |
| | | if (pages.getPhotovoltaicId() == null){ |
| | | if (roleId.longValue() == 1) { |
| | | allList = huinengMachineErrorDao.findAllBySort(page, size, pages.getField(), pages.getSort()); |
| | | }else{ |
| | | allList = huinengMachineErrorDao.findByCompanyBySort(page, size,userId, null, pages.getField(), pages.getSort()); |
| | | } |
| | | }else { |
| | | PageHelper.startPage(page, size); |
| | | allList = huinengMachineErrorDao.findByPhotovoltaicId(pages.getPhotovoltaicId()); |
| | | } |
| | | |
| | | PageInfo<HuinengMachineError> pageInfo = new PageInfo<>(allList); |
| | | |
| | | return pageInfo; |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.service.impl; |
| | | |
| | | import api.bean.PhotovoltaicEntity; |
| | | import api.dao.PhotovoltaicEntityDao; |
| | | import api.service.PhotovoltaicEntityService; |
| | | import api.service.SysUserCompanyService; |
| | | import api.service.SysUserRoleService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (PhotovoltaicEntity)表æå¡å®ç°ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-28 17:35:51 |
| | | */ |
| | | @Service("photovoltaicEntityService") |
| | | public class PhotovoltaicEntityServiceImpl extends ServiceImpl<PhotovoltaicEntityDao, PhotovoltaicEntity> implements PhotovoltaicEntityService { |
| | | |
| | | @Autowired |
| | | private SysUserCompanyService sysUserCompanyService; |
| | | @Autowired |
| | | private SysUserRoleService sysUserRoleService; |
| | | |
| | | // @Autowired |
| | | // private MqttService mqttService; |
| | | |
| | | @Autowired |
| | | private PhotovoltaicEntityDao photovoltaicEntityDao; |
| | | |
| | | @Override |
| | | public PageInfo<PhotovoltaicEntity> list(Integer page, Integer limit, String key, Long userId) { |
| | | System.out.println(userId); |
| | | Long roleId = sysUserRoleService.queryRoleId(userId); |
| | | Long companyId = sysUserCompanyService.queryCompanyId(userId); |
| | | |
| | | List<PhotovoltaicEntity> list; |
| | | if (roleId == 1) { |
| | | PageHelper.startPage(page,limit); |
| | | list = photovoltaicEntityDao.listAll(key); |
| | | System.out.println(list.size()); |
| | | }else if (roleId == 2) { |
| | | PageHelper.startPage(page,limit); |
| | | list = photovoltaicEntityDao.listByCompanyId(key, companyId); |
| | | }else { |
| | | PageHelper.startPage(page,limit); |
| | | list = photovoltaicEntityDao.listByUserId(key, userId); |
| | | } |
| | | PageInfo<PhotovoltaicEntity> pageInfo = new PageInfo<>(list); |
| | | |
| | | return pageInfo; |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.service.impl; |
| | | |
| | | import api.bean.Pages; |
| | | import api.bean.PhotovoltaicError; |
| | | import api.dao.PhotovoltaicErrorDao; |
| | | import api.service.PhotovoltaicErrorService; |
| | | import api.service.SysUserRoleService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (PhotovoltaicError)表æå¡å®ç°ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-30 11:53:07 |
| | | */ |
| | | @Service("photovoltaicErrorService") |
| | | public class PhotovoltaicErrorServiceImpl extends ServiceImpl<PhotovoltaicErrorDao, PhotovoltaicError> implements PhotovoltaicErrorService { |
| | | |
| | | @Autowired |
| | | private SysUserRoleService sysUserRoleService; |
| | | |
| | | @Autowired |
| | | private PhotovoltaicErrorDao photovoltaicErrorDao; |
| | | @Override |
| | | public PageInfo<PhotovoltaicError> list(Pages pages,Long userId) { |
| | | //è·åè§è²å表 |
| | | Long roleId = sysUserRoleService.queryRoleId(userId); |
| | | |
| | | if (roleId == null || roleId == 0) { |
| | | return null; |
| | | } |
| | | |
| | | int page = pages.getPage() - 1; |
| | | int size = pages.getSize(); |
| | | |
| | | List<PhotovoltaicError> allList = new ArrayList<>(); |
| | | |
| | | if (pages.getPhotovoltaicId() == null){ |
| | | if (roleId.longValue() == 1) { |
| | | allList = photovoltaicErrorDao.findAllBySort(page, size, pages.getField(), pages.getSort()); |
| | | }else{ |
| | | allList = photovoltaicErrorDao.findByCompanyBySort(page, size,userId, null, pages.getField(), pages.getSort()); |
| | | } |
| | | }else { |
| | | PageHelper.startPage(page, size); |
| | | allList = photovoltaicErrorDao.findByPhotovoltaicId(pages.getPhotovoltaicId()); |
| | | } |
| | | |
| | | PageInfo<PhotovoltaicError> pageInfo = new PageInfo<>(allList); |
| | | |
| | | return pageInfo; |
| | | |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.service.impl; |
| | | |
| | | import api.bean.Pages; |
| | | import api.bean.PhotovoltaicHeartData; |
| | | import api.dao.PhotovoltaicHeartDataDao; |
| | | import api.service.PhotovoltaicHeartDataService; |
| | | import api.service.SysUserRoleService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
ä¼å¿è·³æ°æ®è¡¨(PhotovoltaicHeartData)表æå¡å®ç°ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2022-09-29 17:36:34 |
| | | */ |
| | | @Service("photovoltaicHeartDataService") |
| | | public class PhotovoltaicHeartDataServiceImpl extends ServiceImpl<PhotovoltaicHeartDataDao,PhotovoltaicHeartData> implements PhotovoltaicHeartDataService { |
| | | @Resource |
| | | private PhotovoltaicHeartDataDao photovoltaicHeartDataDao; |
| | | |
| | | @Autowired |
| | | private SysUserRoleService sysUserRoleService; |
| | | |
| | | |
| | | @Override |
| | | public PageInfo<PhotovoltaicHeartData> list(Pages pages,Long userId){ |
| | | //è·åè§è²å表 |
| | | Long roleId = sysUserRoleService.queryRoleId(userId); |
| | | |
| | | if (roleId == null || roleId == 0) { |
| | | return null; |
| | | } |
| | | |
| | | int page = pages.getPage() - 1; |
| | | int size = pages.getSize(); |
| | | |
| | | List<PhotovoltaicHeartData> allList = new ArrayList<>(); |
| | | |
| | | if (pages.getPhotovoltaicId() == null){ |
| | | if (roleId.longValue() == 1) { |
| | | |
| | | |
| | | allList = photovoltaicHeartDataDao.findAllBySort(page, size, pages.getField(), pages.getSort()); |
| | | |
| | | |
| | | }else{ |
| | | |
| | | |
| | | allList = photovoltaicHeartDataDao.findByCompanyBySort(page, size,userId, null, pages.getField(), pages.getSort()); |
| | | |
| | | } |
| | | }else { |
| | | PageHelper.startPage(page, size); |
| | | allList = photovoltaicHeartDataDao.findByPhotovoltaicId(pages.getPhotovoltaicId()); |
| | | } |
| | | |
| | | |
| | | PageInfo<PhotovoltaicHeartData> pageInfo = new PageInfo<>(allList); |
| | | |
| | | return pageInfo; |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<PhotovoltaicHeartData> getPhotovoltaicHeartDataByMac(Integer page, Integer size, String mac) { |
| | | return null; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package api.service.impl; |
| | | |
| | | import api.bean.SysUserCompanyEntity; |
| | | import api.dao.SysUserCompanyDao; |
| | | import api.service.SysUserCompanyService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: machine-fast |
| | | * @description: |
| | | * @author: YSS |
| | | * @create: 2019-04-18 11:19 |
| | | **/ |
| | | |
| | | @Service("sysUserCompanyService") |
| | | public class SysUserCompanyServiceImpl extends ServiceImpl<SysUserCompanyDao, SysUserCompanyEntity> implements SysUserCompanyService { |
| | | |
| | | @Autowired |
| | | private SysUserCompanyDao sysUserCompanyDao; |
| | | |
| | | |
| | | @Override |
| | | public Long queryCompanyId(Long userId) { |
| | | return baseMapper.queryCompanyId(userId); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUserCompanyEntity> listByCompanyId(Long userId) { |
| | | return sysUserCompanyDao.listByCompanyId(userId); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * Copyright (c) 2016-2019 äººäººå¼æº All rights reserved. |
| | | * |
| | | * https://www.machine.io |
| | | * |
| | | * çæææï¼ä¾µæå¿
ç©¶ï¼ |
| | | */ |
| | | |
| | | package api.service.impl; |
| | | |
| | | |
| | | import api.bean.SysUserRoleEntity; |
| | | import api.dao.SysUserRoleDao; |
| | | import api.service.SysUserRoleService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | /** |
| | | * ç¨æ·ä¸è§è²å¯¹åºå
³ç³» |
| | | * |
| | | * @author Mark sunlightcs@gmail.com |
| | | */ |
| | | @Service("sysUserRoleService") |
| | | public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleDao, SysUserRoleEntity> implements SysUserRoleService { |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int deleteBatch(Long[] roleIds){ |
| | | return baseMapper.deleteBatch(roleIds); |
| | | } |
| | | |
| | | @Override |
| | | public Long queryRoleId(Long userId) { |
| | | return baseMapper.queryRoleId(userId); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="api.dao.HuinengMachineErrorDao"> |
| | | |
| | | <select id="findAllBySort" resultType="api.bean.HuinengMachineError"> |
| | | select |
| | | ps.streetlight_name , |
| | | ps.streetlight_id, |
| | | pe.photovoltaic_name, |
| | | pe.photovoltaic_id, |
| | | hme.* |
| | | from |
| | | pole_streetlight ps |
| | | right join |
| | | ( |
| | | select |
| | | * |
| | | from |
| | | huineng_machine_error |
| | | join |
| | | ( |
| | | select |
| | | max(error_id) as id |
| | | from |
| | | huineng_machine_error |
| | | group by |
| | | streetlight_mac |
| | | limit #{page},#{size} |
| | | ) a |
| | | on |
| | | error_id = a.id ) hme |
| | | on |
| | | hme.streetlight_mac = ps.code_number |
| | | join |
| | | photovoltaic_entity pe |
| | | on |
| | | pe.bind_pole_streelight_id = streetlight_id |
| | | </select> |
| | | |
| | | <select id="findByCompanyBySort" |
| | | resultType="api.bean.HuinengMachineError"> |
| | | select |
| | | * |
| | | from |
| | | huineng_machine_error hme |
| | | join |
| | | ( |
| | | select |
| | | * |
| | | from |
| | | ( |
| | | select |
| | | ps.streetlight_id , |
| | | ps.streetlight_name, |
| | | ps.code_number |
| | | from |
| | | pole_streetlight ps |
| | | where |
| | | ps.streetlight_id in ( |
| | | select |
| | | pus.streetlight_id |
| | | from |
| | | pole_user_streetlight pus |
| | | where |
| | | pus.company_id in( |
| | | select |
| | | suc.company_id |
| | | from |
| | | sys_user_company suc |
| | | where |
| | | suc.user_id = |
| | | #{userId} |
| | | |
| | | ) |
| | | ) |
| | | limit #{page},#{size}) streetlight |
| | | join |
| | | ( |
| | | select |
| | | max(error_id) as maxid, |
| | | streetlight_mac |
| | | from |
| | | huineng_machine_error hme2 |
| | | group by |
| | | streetlight_mac |
| | | ) a |
| | | on |
| | | a.streetlight_mac = streetlight.code_number) |
| | | b |
| | | on |
| | | b.maxid = hme.error_id |
| | | join |
| | | photovoltaic_entity pe |
| | | on |
| | | pe.bind_pole_streelight_id = streetlight_id |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="findByPhotovoltaicId" |
| | | resultType="api.bean.HuinengMachineError" |
| | | parameterType="java.lang.Integer"> |
| | | |
| | | select |
| | | ps.streetlight_name , |
| | | ps.streetlight_id, |
| | | hme.*, |
| | | pe.photovoltaic_name, |
| | | pe.photovoltaic_id |
| | | from |
| | | pole_streetlight ps |
| | | right join |
| | | ( |
| | | select |
| | | * |
| | | from |
| | | huineng_machine_error |
| | | ) hme |
| | | on |
| | | hme.streetlight_mac = ps.code_number |
| | | join |
| | | photovoltaic_entity pe |
| | | on |
| | | pe.bind_pole_streelight_id = streetlight_id |
| | | where ps.streetlight_id in ( |
| | | select pe.bind_pole_streelight_id from photovoltaic_entity pe where pe.photovoltaic_id = #{photovoltaicId}) |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="api.dao.PhotovoltaicEntityDao"> |
| | | |
| | | <resultMap type="api.bean.PhotovoltaicEntity" id="PhotovoltaicEntityMap"> |
| | | <result property="photovoltaicId" column="photovoltaic_id" jdbcType="INTEGER"/> |
| | | <result property="photovoltaicName" column="photovoltaic_name" jdbcType="VARCHAR"/> |
| | | <result property="photovoltaicMac" column="photovoltaic_mac" jdbcType="VARCHAR"/> |
| | | <result property="photovoltaicWorkPattern" column="photovoltaic_work_pattern" jdbcType="INTEGER"/> |
| | | <result property="photovoltaicWorkWaring" column="photovoltaic_work_waring" jdbcType="VARCHAR"/> |
| | | <result property="bindPoleStreelightId" column="bind_pole_streelight_id" jdbcType="INTEGER"/> |
| | | <result property="hardwareVersion" column="hardware_version" jdbcType="VARCHAR"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="createUserId" column="create_user_id" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="softwareVersion" column="software_version" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <!-- æ¹éæå
¥ --> |
| | | <insert id="insertBatch" keyProperty="photovoltaicId" useGeneratedKeys="true"> |
| | | insert into machine.photovoltaic_entity(photovoltaic_name, photovoltaic_mac, photovoltaic_work_pattern, photovoltaic_work_waring, bind_pole_streelight_id, hardware_version, update_time, create_user_id, create_time, software_version) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.photovoltaicName}, #{entity.photovoltaicMac}, #{entity.photovoltaicWorkPattern}, #{entity.photovoltaicWorkWaring}, #{entity.bindPoleStreelightId}, #{entity.hardwareVersion}, #{entity.updateTime}, #{entity.createUserId}, #{entity.createTime}, #{entity.softwareVersion}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- æ¹éæå
¥ææä¸»é®æ´æ° --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="photovoltaicId" useGeneratedKeys="true"> |
| | | insert into machine.photovoltaic_entity(photovoltaic_name, photovoltaic_mac, photovoltaic_work_pattern, photovoltaic_work_waring, bind_pole_streelight_id, hardware_version, update_time, create_user_id, create_time, software_version) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.photovoltaicName}, #{entity.photovoltaicMac}, #{entity.photovoltaicWorkPattern}, #{entity.photovoltaicWorkWaring}, #{entity.bindPoleStreelightId}, #{entity.hardwareVersion}, #{entity.updateTime}, #{entity.createUserId}, #{entity.createTime}, #{entity.softwareVersion}) |
| | | </foreach> |
| | | on duplicate key update |
| | | photovoltaic_name = values(photovoltaic_name) , photovoltaic_mac = values(photovoltaic_mac) , photovoltaic_work_pattern = values(photovoltaic_work_pattern) , photovoltaic_work_waring = values(photovoltaic_work_waring) , bind_pole_streelight_id = values(bind_pole_streelight_id) , hardware_version = values(hardware_version) , update_time = values(update_time) , create_user_id = values(create_user_id) , create_time = values(create_time) , software_version = values(software_version) </insert> |
| | | |
| | | <select id="listAll" resultType="api.bean.PhotovoltaicEntity"> |
| | | select |
| | | a.*, |
| | | b.streetlight_id,b.streetlight_name,b.code_number |
| | | from photovoltaic_entity a |
| | | join pole_streetlight b on a.bind_pole_streelight_id = b.streetlight_id |
| | | <if test="key != null and key != ''"> |
| | | where |
| | | (a.bind_pole_streelight_id like '%${key}%' |
| | | or a.photovoltaic_id like '%${key}%' |
| | | or a.photovoltaic_name like '%${key}%' |
| | | or b.streetlight_name like '%${key}%') |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="listByCompanyId" resultType="api.bean.PhotovoltaicEntity"> |
| | | |
| | | select |
| | | a.*, |
| | | b.streetlight_id,b.streetlight_name,b.code_number |
| | | from |
| | | photovoltaic_entity a |
| | | inner join ( |
| | | select |
| | | streetlight_id,streetlight_name,code_number |
| | | from |
| | | pole_streetlight |
| | | where |
| | | streetlight_id in |
| | | ( SELECT streetlight_id FROM pole_user_streetlight WHERE user_id IN |
| | | ( SELECT user_id FROM sys_user_company WHERE company_id = #{companyId}) |
| | | ) |
| | | ) b on a.bind_pole_streelight_id = b.streetlight_id |
| | | |
| | | <if test="key != null and key != ''"> |
| | | where |
| | | (a.bind_pole_streelight_id like '%${key}%' |
| | | or a.photovoltaic_id like '%${key}%' |
| | | or a.photovoltaic_name like '%${key}%' |
| | | or b.streetlight_name like '%${key}%') |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="listByUserId" resultType="api.bean.PhotovoltaicEntity"> |
| | | |
| | | |
| | | select |
| | | a.*, |
| | | b.streetlight_id,b.streetlight_name,b.code_number |
| | | from |
| | | photovoltaic_entity a |
| | | inner join ( |
| | | select |
| | | streetlight_id,streetlight_name,code_number |
| | | from |
| | | pole_streetlight |
| | | where |
| | | streetlight_id in |
| | | ( SELECT streetlight_id FROM pole_user_streetlight WHERE user_id = #{userId} ) |
| | | ) b on a.bind_pole_streelight_id = b.streetlight_id |
| | | <if test="key != null and key != ''"> |
| | | where |
| | | (a.bind_pole_streelight_id like '%${key}%' |
| | | or a.photovoltaic_id like '%${key}%' |
| | | or a.photovoltaic_name like '%${key}%' |
| | | or b.streetlight_name like '%${key}%') |
| | | </if> |
| | | |
| | | </select> |
| | | </mapper> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="api.dao.PhotovoltaicErrorDao"> |
| | | |
| | | <resultMap type="api.bean.PhotovoltaicError" id="PhotovoltaicErrorMap"> |
| | | <result property="errorId" column="error_id" jdbcType="INTEGER"/> |
| | | <result property="mac" column="mac" jdbcType="VARCHAR"/> |
| | | <result property="errorCode" column="error_code" jdbcType="VARCHAR"/> |
| | | <result property="errorMsg" column="error_msg" jdbcType="VARCHAR"/> |
| | | <result property="destinationAddress" column="destination_address" jdbcType="VARCHAR"/> |
| | | <result property="timestamp" column="timestamp" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <!-- æ¹éæå
¥ --> |
| | | <insert id="insertBatch" keyProperty="" useGeneratedKeys="true"> |
| | | insert into machine.photovoltaic_error(error_id, mac, error_code, error_msg, destination_address, timestamp) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.errorId}, #{entity.mac}, #{entity.errorCode}, #{entity.errorMsg}, #{entity.destinationAddress}, |
| | | #{entity.timestamp}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- æ¹éæå
¥ææä¸»é®æ´æ° --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="" useGeneratedKeys="true"> |
| | | insert into machine.photovoltaic_error(error_id, mac, error_code, error_msg, destination_address, timestamp) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.errorId}, #{entity.mac}, #{entity.errorCode}, #{entity.errorMsg}, #{entity.destinationAddress}, |
| | | #{entity.timestamp}) |
| | | </foreach> |
| | | on duplicate key update |
| | | error_id = values(error_id) , mac = values(mac) , error_code = values(error_code) , error_msg = |
| | | values(error_msg) , destination_address = values(destination_address) , timestamp = values(timestamp) |
| | | </insert> |
| | | |
| | | |
| | | <select id="findAllBySort" resultType="api.bean.PhotovoltaicError"> |
| | | select |
| | | ps.streetlight_name , |
| | | ps.streetlight_id, |
| | | pe.photovoltaic_name, |
| | | pe.photovoltaic_id, |
| | | phd.* |
| | | from |
| | | pole_streetlight ps |
| | | right join |
| | | ( |
| | | select |
| | | * |
| | | from |
| | | photovoltaic_error phe |
| | | join |
| | | ( |
| | | select |
| | | max(error_id) as id |
| | | from |
| | | photovoltaic_error |
| | | group by |
| | | streetlight_mac |
| | | limit #{page},#{size} |
| | | ) a |
| | | on |
| | | error_id = a.id ) phd |
| | | on |
| | | phd.streetlight_mac = ps.code_number |
| | | join |
| | | photovoltaic_entity pe |
| | | on |
| | | pe.bind_pole_streelight_id = streetlight_id |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="findByCompanyBySort" resultType="api.bean.PhotovoltaicError"> |
| | | select |
| | | * |
| | | from |
| | | photovoltaic_error phe |
| | | join |
| | | ( |
| | | select |
| | | * |
| | | from |
| | | ( |
| | | select |
| | | ps.streetlight_id , |
| | | ps.streetlight_name, |
| | | ps.code_number |
| | | from |
| | | pole_streetlight ps |
| | | where |
| | | ps.streetlight_id in ( |
| | | select |
| | | pus.streetlight_id |
| | | from |
| | | pole_user_streetlight pus |
| | | where |
| | | pus.company_id in( |
| | | select |
| | | suc.company_id |
| | | from |
| | | sys_user_company suc |
| | | where |
| | | suc.user_id = |
| | | #{userId} |
| | | ) |
| | | ) |
| | | limit #{page},#{size}) streetlight |
| | | join |
| | | ( |
| | | select |
| | | max(error_id) as maxid, |
| | | streetlight_mac |
| | | from |
| | | photovoltaic_error |
| | | group by |
| | | streetlight_mac |
| | | ) a |
| | | on |
| | | a.streetlight_mac = streetlight.code_number) |
| | | b |
| | | on |
| | | b.maxid = phe.error_id |
| | | join |
| | | photovoltaic_entity pe |
| | | on |
| | | pe.bind_pole_streelight_id = streetlight_id |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="findByPhotovoltaicId" resultType="api.bean.PhotovoltaicError" |
| | | parameterType="java.lang.Integer"> |
| | | |
| | | select |
| | | ps.streetlight_name , |
| | | ps.streetlight_id, |
| | | phe.*, |
| | | pe.photovoltaic_name, |
| | | pe.photovoltaic_id |
| | | from |
| | | pole_streetlight ps |
| | | right join |
| | | ( |
| | | select |
| | | * |
| | | from |
| | | photovoltaic_error |
| | | ) phe |
| | | on |
| | | phe.streetlight_mac = ps.code_number |
| | | join |
| | | photovoltaic_entity pe |
| | | on |
| | | pe.bind_pole_streelight_id = streetlight_id |
| | | where ps.streetlight_id in ( |
| | | select pe.bind_pole_streelight_id from photovoltaic_entity pe where pe.photovoltaic_id = #{photovoltaicId}) |
| | | order by error_id desc |
| | | </select> |
| | | </mapper> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="api.dao.PhotovoltaicHeartDataDao"> |
| | | |
| | | <select id="findAllBySort" resultType="api.bean.PhotovoltaicHeartData"> |
| | | |
| | | select |
| | | ps.streetlight_name , |
| | | ps.streetlight_id, |
| | | pe.photovoltaic_name, |
| | | pe.photovoltaic_id, |
| | | phd.* |
| | | from |
| | | pole_streetlight ps |
| | | right join |
| | | ( |
| | | select |
| | | * |
| | | from |
| | | photovoltaic_heart_data |
| | | join |
| | | ( |
| | | select |
| | | max(photovoltaic_heart_data_id) as id |
| | | from |
| | | photovoltaic_heart_data |
| | | group by |
| | | streetlight_mac |
| | | limit #{page},#{size} |
| | | ) a |
| | | on |
| | | photovoltaic_heart_data_id = a.id ) phd |
| | | on |
| | | phd.streetlight_mac = ps.code_number |
| | | join |
| | | photovoltaic_entity pe |
| | | on |
| | | pe.bind_pole_streelight_id = streetlight_id |
| | | <if test="field != null and field != ''"> |
| | | ORDER BY ${field} |
| | | <if test="sort != null and sort != ''">${sort}</if> |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="findByCompanyBySort" resultType="api.bean.PhotovoltaicHeartData"> |
| | | |
| | | |
| | | select |
| | | * |
| | | from |
| | | photovoltaic_heart_data phd |
| | | join |
| | | ( |
| | | select |
| | | * |
| | | from |
| | | ( |
| | | select |
| | | ps.streetlight_id , |
| | | ps.streetlight_name, |
| | | ps.code_number |
| | | from |
| | | pole_streetlight ps |
| | | where |
| | | ps.streetlight_id in ( |
| | | select |
| | | pus.streetlight_id |
| | | from |
| | | pole_user_streetlight pus |
| | | where |
| | | pus.company_id in( |
| | | select |
| | | suc.company_id |
| | | from |
| | | sys_user_company suc |
| | | where |
| | | suc.user_id = |
| | | #{userId} |
| | | ) |
| | | ) |
| | | limit #{page},#{size}) streetlight |
| | | join |
| | | ( |
| | | select |
| | | max(photovoltaic_heart_data_id) as maxid, |
| | | streetlight_mac |
| | | from |
| | | photovoltaic_heart_data |
| | | group by |
| | | streetlight_mac |
| | | ) a |
| | | on |
| | | a.streetlight_mac = streetlight.code_number) |
| | | b |
| | | on |
| | | b.maxid = phd.photovoltaic_heart_data_id |
| | | join |
| | | photovoltaic_entity pe |
| | | on |
| | | pe.bind_pole_streelight_id = streetlight_id |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="findByPhotovoltaicId" resultType="api.bean.PhotovoltaicHeartData"> |
| | | select |
| | | ps.streetlight_name , |
| | | ps.streetlight_id, |
| | | phd.*, |
| | | pe.photovoltaic_name, |
| | | pe.photovoltaic_id |
| | | from |
| | | pole_streetlight ps |
| | | right join |
| | | ( |
| | | select |
| | | * |
| | | from |
| | | photovoltaic_heart_data |
| | | ) phd |
| | | on |
| | | phd.streetlight_mac = ps.code_number |
| | | join |
| | | photovoltaic_entity pe |
| | | on |
| | | pe.bind_pole_streelight_id = streetlight_id |
| | | where ps.streetlight_id in ( |
| | | select pe.bind_pole_streelight_id from photovoltaic_entity pe where pe.photovoltaic_id = #{photovoltaicId}) |
| | | order by photovoltaic_heart_data_id desc |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="api.dao.SysUserRoleDao"> |
| | | |
| | | <delete id="deleteBatch"> |
| | | delete from sys_user_role where role_id in |
| | | <foreach item="roleId" collection="array" open="(" separator="," close=")"> |
| | | #{roleId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | api\dao\LampDao.class |
| | | api\service\PoleService.class |
| | | api\bean\SinglelampDataEntity.class |
| | | api\controller\PoleController.class |
| | | api\controller\OldSystemLoginController.class |
| | | api\dao\WeatherV2Dao.class |
| | | api\service\WeatherService.class |
| | | api\bean\PoleLightBatchEntity.class |
| | | api\bean\TimerRequest.class |
| | | api\bean\ReqParams.class |
| | | api\service\SinglelampDataServer.class |
| | | api\controller\CameraController.class |
| | | api\service\WeatherV2Service.class |
| | | api\utils\HttpUtil.class |
| | | api\controller\WeatherController.class |
| | | api\bean\LoginForm.class |
| | | api\controller\SinglelampDataController.class |
| | | api\dao\SinglelampDataDao.class |
| | | api\bean\PoleSensorV2VOEntity.class |
| | | api\controller\TimerController.class |
| | | api\dao\AccessDao.class |
| | | api\service\AccessService.class |
| | | api\bean\PoleSensorV2SoilVOEntity.class |
| | | api\bean\LampEntity.class |
| | | api\result\Msg.class |
| | | api\bean\AccessEntity.class |
| | | api\utils\CommonHeader.class |
| | | api\APIApplication.class |
| | | api\dao\WeatherDao.class |
| | | api\controller\WeatherV2Controller.class |
| | | api\bean\WeatherEntity.class |
| | | api\controller\AccessController.class |
| | |
| | | D:\Coding\api\src\main\java\api\service\WeatherService.java |
| | | D:\Coding\api\src\main\java\api\controller\PoleController.java |
| | | D:\Coding\api\src\main\java\api\service\PoleService.java |
| | | D:\Coding\api\src\main\java\api\service\WeatherV2Service.java |
| | | D:\Coding\api\src\main\java\api\service\SinglelampDataServer.java |
| | | D:\Coding\api\src\main\java\api\bean\TimerRequest.java |
| | | D:\Coding\api\src\main\java\api\controller\SinglelampDataController.java |
| | | D:\Coding\api\src\main\java\api\dao\AccessDao.java |
| | | D:\Coding\api\src\main\java\api\controller\AccessController.java |
| | | D:\Coding\api\src\main\java\api\bean\LampEntity.java |
| | | D:\Coding\api\src\main\java\api\dao\LampDao.java |
| | | D:\Coding\api\src\main\java\api\controller\OldSystemLoginController.java |
| | | D:\Coding\api\src\main\java\api\bean\PoleSensorV2SoilVOEntity.java |
| | | D:\Coding\api\src\main\java\api\dao\SinglelampDataDao.java |
| | | D:\Coding\api\src\main\java\api\bean\AccessEntity.java |
| | | D:\Coding\api\src\main\java\api\service\AccessService.java |
| | | D:\Coding\api\src\main\java\api\dao\WeatherV2Dao.java |
| | | D:\Coding\api\src\main\java\api\bean\ReqParams.java |
| | | D:\Coding\api\src\main\java\api\utils\HttpUtil.java |
| | | D:\Coding\api\src\main\java\api\controller\TimerController.java |
| | | D:\Coding\api\src\main\java\api\bean\PoleSensorV2VOEntity.java |
| | | D:\Coding\api\src\main\java\api\dao\WeatherDao.java |
| | | D:\Coding\api\src\main\java\api\bean\SinglelampDataEntity.java |
| | | D:\Coding\api\src\main\java\api\bean\WeatherEntity.java |
| | | D:\Coding\api\src\main\java\api\bean\PoleLightBatchEntity.java |
| | | D:\Coding\api\src\main\java\api\controller\CameraController.java |
| | | D:\Coding\api\src\main\java\api\controller\WeatherV2Controller.java |
| | | D:\Coding\api\src\main\java\api\result\Msg.java |
| | | D:\Coding\api\src\main\java\api\utils\CommonHeader.java |
| | | D:\Coding\api\src\main\java\api\controller\WeatherController.java |
| | | D:\Coding\api\src\main\java\api\bean\LoginForm.java |
| | | D:\Coding\api\src\main\java\api\APIApplication.java |
| | | C:\coding\api\src\main\java\api\APIApplication.java |
| | | C:\coding\api\src\main\java\api\service\SinglelampDataServer.java |
| | | C:\coding\api\src\main\java\api\bean\PoleSensorV2VOEntity.java |
| | | C:\coding\api\src\main\java\api\controller\AccessController.java |
| | | C:\coding\api\src\main\java\api\bean\SinglelampDataEntity.java |
| | | C:\coding\api\src\main\java\api\bean\TimerRequest.java |
| | | C:\coding\api\src\main\java\api\service\WeatherV2Service.java |
| | | C:\coding\api\src\main\java\api\result\Msg.java |
| | | C:\coding\api\src\main\java\api\bean\WeatherEntity.java |
| | | C:\coding\api\src\main\java\api\service\AccessService.java |
| | | C:\coding\api\src\main\java\api\bean\AccessEntity.java |
| | | C:\coding\api\src\main\java\api\dao\WeatherDao.java |
| | | C:\coding\api\src\main\java\api\controller\SinglelampDataController.java |
| | | C:\coding\api\src\main\java\api\service\WeatherService.java |
| | | C:\coding\api\src\main\java\api\controller\WeatherV2Controller.java |
| | | C:\coding\api\src\main\java\api\controller\TimerController.java |
| | | C:\coding\api\src\main\java\api\bean\ReqParams.java |
| | | C:\coding\api\src\main\java\api\controller\OldSystemLoginController.java |
| | | C:\coding\api\src\main\java\api\dao\WeatherV2Dao.java |
| | | C:\coding\api\src\main\java\api\bean\PoleSensorV2SoilVOEntity.java |
| | | C:\coding\api\src\main\java\api\controller\CameraController.java |
| | | C:\coding\api\src\main\java\api\bean\LampEntity.java |
| | | C:\coding\api\src\main\java\api\bean\LoginForm.java |
| | | C:\coding\api\src\main\java\api\dao\AccessDao.java |
| | | C:\coding\api\src\main\java\api\dao\SinglelampDataDao.java |
| | | C:\coding\api\src\main\java\api\controller\WeatherController.java |
| | | C:\coding\api\src\main\java\api\dao\LampDao.java |