Merge remote-tracking branch 'origin/master'
| | |
| | | private Integer chargingPileNumber; |
| | | @ApiModelProperty(value = "排序") |
| | | private Integer sort; |
| | | @ApiModelProperty("计费策略id") |
| | | private Integer accountingStrategyId; |
| | | @ApiModelProperty("计费策略类型(1=平台添加,2=自定义策略)") |
| | | private Integer accountingStrategyType; |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 15:07 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class PageChargingPileListDTO { |
| | | @ApiModelProperty(value = "充电桩id") |
| | | private Integer id; |
| | | @ApiModelProperty(value = "充电桩编号") |
| | | private String code; |
| | | @ApiModelProperty(value = "充电桩名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "桩号") |
| | | private String number; |
| | | @ApiModelProperty(value = "设备类型(0=其他,1=直流设备,2=交流设备,3=交直流一体设备,4=无线设备)") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "归属电站id") |
| | | private Integer siteId; |
| | | @ApiModelProperty(value = "归属电站名称") |
| | | private String siteName; |
| | | @ApiModelProperty(value = "归属合作商id") |
| | | private String partnerId; |
| | | @ApiModelProperty(value = "归属合作商名称") |
| | | private String partnerName; |
| | | @ApiModelProperty(value = "生产商名称") |
| | | private String manufacturer; |
| | | @ApiModelProperty(value = "设备型号") |
| | | private String equipmentType; |
| | | @ApiModelProperty(value = "额定功率") |
| | | private BigDecimal ratedPower; |
| | | |
| | | } |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "充电枪编号") |
| | | @ApiModelProperty(value = "充电枪编号", required = true) |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "站点id") |
| | | @ApiModelProperty(value = "站点id", required = true) |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty(value = "合作商id") |
| | | @ApiModelProperty(value = "合作商id", required = true) |
| | | @TableField("partner_id") |
| | | private Integer partnerId; |
| | | |
| | | @ApiModelProperty(value = "充电桩id") |
| | | @ApiModelProperty(value = "充电桩id", required = true) |
| | | @TableField("charging_pile_id") |
| | | private Integer chargingPileId; |
| | | |
| | | @ApiModelProperty(value = "充电枪名称") |
| | | @ApiModelProperty(value = "充电枪名称", required = true) |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "充电枪类型(0=其他,1=家用插座(模式2),2=交流接口插座(模式3,连接方式B),3=交流接口插头(带枪线,模式3,连接方式C)4=直流接口枪头(带枪线,模式4)5=无线充电座)") |
| | | @ApiModelProperty(value = "充电枪类型(0=其他,1=家用插座(模式2),2=交流接口插座(模式3,连接方式B),3=交流接口插头(带枪线,模式3,连接方式C)4=直流接口枪头(带枪线,模式4)5=无线充电座)", required = true) |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "充电枪状态(1=离线,2=空闲,3=占用(未充电),4=占用(充电中),5=占用(已充满),6=占用(预约锁定),7=故障)") |
| | | @ApiModelProperty(value = "充电枪状态(1=离线,2=空闲,3=占用(未充电),4=占用(充电中),5=占用(已充满),6=占用(预约锁定),7=故障)", required = true) |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "充电模式(1=超级快充,2=快充,3=慢充)") |
| | | @ApiModelProperty(value = "充电模式(1=超级快充,2=快充,3=慢充)", required = true) |
| | | @TableField("charge_mode") |
| | | private Integer chargeMode; |
| | | |
| | |
| | | @TableField("accounting_strategy_id") |
| | | private Integer accountingStrategyId; |
| | | |
| | | @ApiModelProperty(value = "额定电压上限") |
| | | @ApiModelProperty(value = "额定电压上限", required = true) |
| | | @TableField("upper_rated_voltage") |
| | | private BigDecimal upperRatedVoltage; |
| | | |
| | | @ApiModelProperty(value = "额定电压下限") |
| | | @ApiModelProperty(value = "额定电压下限", required = true) |
| | | @TableField("lower_limit_of_rated_voltage") |
| | | private BigDecimal lowerLimitOfRatedVoltage; |
| | | |
| | | @ApiModelProperty(value = "额定电流") |
| | | @ApiModelProperty(value = "额定电流", required = true) |
| | | @TableField("rated_current") |
| | | private BigDecimal ratedCurrent; |
| | | |
| | | @ApiModelProperty(value = "额定功率") |
| | | @ApiModelProperty(value = "额定功率", required = true) |
| | | @TableField("rated_power") |
| | | private BigDecimal ratedPower; |
| | | |
| | |
| | | @TableField("parking_lock_state") |
| | | private Integer parkingLockState; |
| | | |
| | | @ApiModelProperty(value = "国家标准") |
| | | @ApiModelProperty(value = "国家标准", required = true) |
| | | @TableField("national_standard") |
| | | private String nationalStandard; |
| | | |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "设备编号") |
| | | @ApiModelProperty(value = "设备编号", required = true) |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "充电设备名称") |
| | | @ApiModelProperty(value = "充电设备名称", required = true) |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "桩号") |
| | | @ApiModelProperty(value = "桩号", required = true) |
| | | @TableField("number") |
| | | private Integer number; |
| | | |
| | | @ApiModelProperty(value = "设备类型(0=其他,1=直流设备,2=交流设备,3=交直流一体设备,4=无线设备)") |
| | | @ApiModelProperty(value = "设备类型(0=其他,1=直流设备,2=交流设备,3=交直流一体设备,4=无线设备)", required = true) |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "站点id") |
| | | @ApiModelProperty(value = "站点id", required = true) |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty(value = "站点名称") |
| | | @TableField(exist = false) |
| | | private Integer siteName; |
| | | |
| | | @ApiModelProperty(value = "合作商id") |
| | | @ApiModelProperty(value = "合作商id", required = true) |
| | | @TableField("partner_id") |
| | | private Integer partnerId; |
| | | |
| | | @ApiModelProperty(value = "合作商名称") |
| | | @TableField(exist = false) |
| | | private Integer partnerName; |
| | | |
| | | @ApiModelProperty(value = "生产商机构代码") |
| | | @TableField("manufacturer_code") |
| | |
| | | @TableField("production_date") |
| | | private LocalDate productionDate; |
| | | |
| | | @ApiModelProperty(value = "额定功率") |
| | | @ApiModelProperty(value = "额定功率", required = true) |
| | | @TableField("rated_power") |
| | | private BigDecimal ratedPower; |
| | | |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 16:36 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class BatchSetAccountingStrategy { |
| | | @ApiModelProperty(value = "充电桩id", required = true) |
| | | private List<Integer> id; |
| | | @ApiModelProperty(value = "计费策略id", required = true) |
| | | private Integer accountingStrategyId; |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.query; |
| | | |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 15:04 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class PageChargingPileList extends BasePage { |
| | | @ApiModelProperty(value = "站点id") |
| | | private Integer siteId; |
| | | @ApiModelProperty("充电设备名称") |
| | | private String name; |
| | | @ApiModelProperty("设备类型(0=其他,1=直流设备,2=交流设备,3=交直流一体设备,4=无线设备)") |
| | | private Integer type; |
| | | } |
| | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getPartner/{id}") |
| | | @ApiOperation(value = "获取合作商详情", tags = {"管理后台-合作商管理"}) |
| | | @ApiOperation(value = "获取合作商详情", tags = {"管理后台-合作商管理", "管理后台-充电桩信息"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "合作商id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.query.GetSiteList; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delSite/{id}") |
| | | @ApiOperation(value = "编辑站点", tags = {"管理后台-站点管理"}) |
| | | @ApiOperation(value = "删除站点", tags = {"管理后台-站点管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "站点id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/setAccountingStrategy/{id}") |
| | | @ApiOperation(value = "设置站点计费策略", tags = {"管理后台-站点管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "站点id", name = "id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(value = "计费策略id", name = "accountingStrategyId", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | public AjaxResult setAccountingStrategy(@PathVariable("id") Integer id, @RequestParam("accountingStrategyId") Integer accountingStrategyId){ |
| | | siteService.setAccountingStrategy(id, accountingStrategyId); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getAllSiteList") |
| | | @ApiOperation(value = "获取所有站点数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult<List<Site>> getAllSiteList(){ |
| | | List<Site> list = siteService.list(new LambdaQueryWrapper<Site>().eq(Site::getDelFlag, 0) |
| | | .orderByDesc(Site::getCreateTime)); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 查询计费策略明细列表 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "查询计费策略明细列表") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理", "管理后台-充电桩信息"},value = "查询计费策略明细列表") |
| | | @GetMapping(value = "/queryAccountingStrategyDetailByStrategyId") |
| | | public AjaxResult<List<TAccountingStrategyDetailVO>> queryAccountingStrategyDetailByStrategyId(@RequestParam Integer strategyId) { |
| | | List<TAccountingStrategyDetailVO> list = accountingStrategyDetailService.queryAccountingStrategyDetailByStrategyId(strategyId); |
| | |
| | | /** |
| | | * 添加计费策略管理 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "添加计费策略") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "添加计费策略") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TAccountingStrategyDTO dto) { |
| | | public AjaxResult<Integer> add(@RequestBody TAccountingStrategyDTO dto) { |
| | | accountingStrategyService.save(dto); |
| | | // 添加明细 |
| | | dto.getAccountingStrategyDetails().forEach(detail -> detail.setAccountingStrategyId(dto.getId())); |
| | | accountingStrategyDetailService.saveBatch(dto.getAccountingStrategyDetails()); |
| | | // TODO 硬件 同步策略到充电桩 |
| | | return AjaxResult.ok(accountingStrategyDetailService.saveBatch(dto.getAccountingStrategyDetails())); |
| | | return AjaxResult.ok(dto.getId()); |
| | | } |
| | | |
| | | /** |
| | | * 修改计费策略 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "修改计费策略") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "修改计费策略") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TAccountingStrategyDTO dto) { |
| | | // 删除计费策略明细信息 |
| | |
| | | /** |
| | | * 查看计费策略详情 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "查看计费策略详情") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "查看计费策略详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TAccountingStrategy> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(accountingStrategyService.getById(id)); |
| | |
| | | return AjaxResult.ok(accountingStrategyService.removeByIds(ids)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(tags = {"管理后台-站点管理"},value = "获取平台添加的计费策略") |
| | | @DeleteMapping(value = "/getPlatformAccountingStrategy") |
| | | public AjaxResult<List<TAccountingStrategyVO>> getPlatformAccountingStrategy(){ |
| | | List<TAccountingStrategyVO> list = accountingStrategyService.getPlatformAccountingStrategy(); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 查询充电枪列表 |
| | | */ |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "查询充电枪分页列表") |
| | | @ApiOperation(tags = {"后台-充电枪", "管理后台-充电桩信息"},value = "查询充电枪分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TChargingGunVO>> pageList(@RequestBody TChargingGunQuery query) { |
| | | return AjaxResult.ok(chargingGunService.pageList(query)); |
| | |
| | | /** |
| | | * 添加充电枪管理 |
| | | */ |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "添加充电枪") |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "添加充电枪") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TChargingGunDTO dto) { |
| | | return AjaxResult.ok(chargingGunService.save(dto)); |
| | | public AjaxResult add(@RequestBody TChargingGunDTO dto) { |
| | | return chargingGunService.add(dto); |
| | | } |
| | | |
| | | /** |
| | | * 修改充电枪 |
| | | */ |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "修改充电枪") |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "修改充电枪") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TChargingGunDTO dto) { |
| | | return AjaxResult.ok(chargingGunService.updateById(dto)); |
| | | public AjaxResult update(@RequestBody TChargingGunDTO dto) { |
| | | return chargingGunService.update(dto); |
| | | } |
| | | |
| | | /** |
| | | * 查看充电枪详情 |
| | | */ |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "查看充电枪详情") |
| | | @ApiOperation(tags = {"后台-充电枪", "管理后台-充电桩信息"},value = "查看充电枪详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TChargingGun> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(chargingGunService.getById(id)); |
| | |
| | | /** |
| | | * 删除充电枪 |
| | | */ |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "删除充电枪") |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "删除充电枪") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(chargingGunService.removeById(id)); |
| | | TChargingGun chargingGun = chargingGunService.getById(id); |
| | | chargingGun.setDelFlag(true); |
| | | chargingGunService.updateById(chargingGun); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "下载二维码") |
| | | @GetMapping(value = "/downloadQRCode/{id}") |
| | | public void downloadQRCode(@PathVariable Integer id, HttpServletResponse response){ |
| | | // todo 待完善 |
| | | } |
| | | } |
| | | |
| | |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.BatchSetAccountingStrategy; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.chargingPile.api.query.PageChargingPileList; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | return AjaxResult.ok(chargingPileService.list(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .eq(TChargingPile::getSiteId,siteId))); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/pageChargingPileList") |
| | | @ApiOperation(value = "获取充电桩列表数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult<PageInfo<PageChargingPileListDTO>> pageChargingPileList(@RequestBody PageChargingPileList page){ |
| | | PageInfo<PageChargingPileListDTO> list = chargingPileService.pageChargingPileList(page); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/addChargingPile") |
| | | @ApiOperation(value = "添加充电桩数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult addChargingPile(@RequestBody TChargingPile chargingPile){ |
| | | return chargingPileService.addChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getChargingPile/{id}") |
| | | @ApiOperation(value = "获取充电桩详情数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult<TChargingPile> getChargingPile(@PathVariable Integer id){ |
| | | TChargingPile chargingPile = chargingPileService.getChargingPile(id); |
| | | return AjaxResult.success(chargingPile); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editChargingPile") |
| | | @ApiOperation(value = "编辑充电桩数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult editChargingPile(@RequestBody TChargingPile chargingPile){ |
| | | return chargingPileService.editChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delChargingPile/{id}") |
| | | @ApiOperation(value = "删除充电桩", tags = {"管理后台-充电桩信息"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "充电桩id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | public AjaxResult delChargingPile(@PathVariable Integer id){ |
| | | return chargingPileService.delChargingPile(id); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/batchSetAccountingStrategy") |
| | | @ApiOperation(value = "批量设置计费策略", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult batchSetAccountingStrategy(@RequestBody BatchSetAccountingStrategy setAccountingStrategy){ |
| | | chargingPileService.batchSetAccountingStrategy(setAccountingStrategy); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<TAccountingStrategyVO> pageList(@Param("query") TAccountingStrategyQuery query, @Param("pageInfo")PageInfo<TAccountingStrategyVO> pageInfo); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取平台添加的计费策略 |
| | | * @return |
| | | */ |
| | | List<TAccountingStrategyVO> getPlatformAccountingStrategy(); |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.PageChargingPileList; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Mapper |
| | | public interface TChargingPileMapper extends BaseMapper<TChargingPile> { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩列表数据 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | List<PageChargingPileListDTO> pageChargingPileList(PageInfo<PageChargingPileListDTO> pageInfo, @Param("item") PageChargingPileList page); |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | TChargingPile getChargingPile(Integer id); |
| | | } |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | * @return |
| | | */ |
| | | AjaxResult delSite(Integer id); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取站点分页列表 |
| | | * @param query |
| | | * @return |
| | | * 设置站点计费策略 |
| | | * @param id 站点id |
| | | * @param accountingStrategyId 计费策略id |
| | | */ |
| | | void setAccountingStrategy(Integer id, Integer accountingStrategyId); |
| | | |
| | | |
| | | PageInfo<SiteVO> pageList(SiteQuery query); |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 计费策略 服务类 |
| | |
| | | * @return |
| | | */ |
| | | PageInfo<TAccountingStrategyVO> pageList(TAccountingStrategyQuery query); |
| | | |
| | | |
| | | /** |
| | | * 获取平台添加的计费策略 |
| | | * @return |
| | | */ |
| | | List<TAccountingStrategyVO> getPlatformAccountingStrategy(); |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | PageInfo<TChargingGunVO> pageList(TChargingGunQuery query); |
| | | |
| | | |
| | | /** |
| | | * 添加充电枪 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | AjaxResult add(TChargingGunDTO dto); |
| | | |
| | | |
| | | /** |
| | | * 编辑充电枪 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | AjaxResult update(TChargingGunDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.BatchSetAccountingStrategy; |
| | | import com.ruoyi.chargingPile.api.query.PageChargingPileList; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-08-06 |
| | | */ |
| | | public interface TChargingPileService extends IService<TChargingPile> { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩列表 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | PageInfo<PageChargingPileListDTO> pageChargingPileList(PageChargingPileList page); |
| | | |
| | | |
| | | /** |
| | | * 添加充电桩 |
| | | * @param chargingPile |
| | | * @return |
| | | */ |
| | | AjaxResult addChargingPile(TChargingPile chargingPile); |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩详情 |
| | | * @param id 充电桩id |
| | | * @return |
| | | */ |
| | | TChargingPile getChargingPile(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 编辑充电桩 |
| | | * @param chargingPile |
| | | * @return |
| | | */ |
| | | AjaxResult editChargingPile(TChargingPile chargingPile); |
| | | |
| | | |
| | | /** |
| | | * 删除充电桩 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | AjaxResult delChargingPile(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 批量设置计费策略 |
| | | * @param setAccountingStrategy |
| | | */ |
| | | void batchSetAccountingStrategy(BatchSetAccountingStrategy setAccountingStrategy); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.dto.PartnerListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Partner; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.query.GetPartnerList; |
| | | import com.ruoyi.chargingPile.dto.ResetPassword; |
| | | import com.ruoyi.chargingPile.mapper.PartnerMapper; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | |
| | | |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | @Resource |
| | | private ISiteService siteService; |
| | | |
| | | |
| | | |
| | |
| | | user.setStatus("0"); |
| | | user.setDelFlag("0"); |
| | | user.setRoleId(partner.getRoleId().longValue()); |
| | | user.setRoleType(2); |
| | | user.setObjectId(partner.getId()); |
| | | R r = sysUserClient.addSysUser(user); |
| | | if(200 != r.getCode()){ |
| | | throw new RuntimeException(r.getMsg()); |
| | |
| | | user.setAvatar(partner.getLogoUrl()); |
| | | user.setPassword(partner.getPassword()); |
| | | user.setRoleId(partner.getRoleId().longValue()); |
| | | user.setRoleType(2); |
| | | user.setObjectId(partner.getId()); |
| | | R r = sysUserClient.addSysUser(user); |
| | | if(200 != r.getCode()){ |
| | | throw new RuntimeException(r.getMsg()); |
| | |
| | | public AjaxResult delPartner(Integer id) { |
| | | //查询有无关联数据 |
| | | //站点 |
| | | long count = siteService.count(new LambdaQueryWrapper<Site>().eq(Site::getPartnerId, id).eq(Site::getDelFlag, 0)); |
| | | if(count > 0){ |
| | | return AjaxResult.error("当前合作商有关联得站点,删除失败!"); |
| | | } |
| | | // todo 代码完善 |
| | | //充电桩 |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.query.GetSiteList; |
| | | import com.ruoyi.chargingPile.api.query.SiteQuery; |
| | | import com.ruoyi.chargingPile.api.vo.SiteVO; |
| | | import com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO; |
| | | import com.ruoyi.chargingPile.mapper.SiteMapper; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | public class SiteServiceImpl extends ServiceImpl<SiteMapper, Site> implements ISiteService { |
| | | |
| | | @Resource |
| | | private TChargingGunService chargingGunService; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置站点计费策略 |
| | | * @param id 站点id |
| | | * @param accountingStrategyId 计费策略id |
| | | */ |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public void setAccountingStrategy(Integer id, Integer accountingStrategyId) { |
| | | Site site = this.getById(id); |
| | | site.setAccountingStrategyId(accountingStrategyId); |
| | | this.updateById(site); |
| | | List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0)); |
| | | for (TChargingGun tChargingGun : list) { |
| | | tChargingGun.setChargingPileId(accountingStrategyId); |
| | | } |
| | | chargingGunService.updateBatchById(list); |
| | | } |
| | | } |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取平台添加的计费策略 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TAccountingStrategyVO> getPlatformAccountingStrategy() { |
| | | return this.baseMapper.getPlatformAccountingStrategy(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.chargingPile.api.vo.TMonitoringEquipmentVO; |
| | | import com.ruoyi.chargingPile.mapper.TChargingGunMapper; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | /** |
| | | * 添加充电枪 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult add(TChargingGunDTO dto) { |
| | | AjaxResult ajaxResult = addVerify(dto); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | long count = this.count(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getCode, dto.getCode()).eq(TChargingGun::getDelFlag, 0)); |
| | | if(count > 0){ |
| | | return AjaxResult.error("接口编码已存在"); |
| | | } |
| | | this.save(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑充电枪 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult update(TChargingGunDTO dto) { |
| | | AjaxResult ajaxResult = addVerify(dto); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | TChargingGun one = this.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getCode, dto.getCode()).eq(TChargingGun::getDelFlag, 0)); |
| | | if(null != one && !dto.getId().equals(one.getId())){ |
| | | return AjaxResult.error("接口编码已存在"); |
| | | } |
| | | this.updateById(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 校验必填项 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | AjaxResult addVerify(TChargingGunDTO dto){ |
| | | if(StringUtils.isEmpty(dto.getCode())){ |
| | | return AjaxResult.error("接口编码不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(dto.getName())){ |
| | | return AjaxResult.error("接口名称不能为空"); |
| | | } |
| | | if(null == dto.getType()){ |
| | | return AjaxResult.error("接口类型不能为空"); |
| | | } |
| | | if(null == dto.getStatus()){ |
| | | return AjaxResult.error("接口状态不能为空"); |
| | | } |
| | | if(null == dto.getChargeMode()){ |
| | | return AjaxResult.error("充电方式不能为空"); |
| | | } |
| | | if(null == dto.getUpperRatedVoltage()){ |
| | | return AjaxResult.error("额定电压上限不能为空"); |
| | | } |
| | | if(null == dto.getLowerLimitOfRatedVoltage()){ |
| | | return AjaxResult.error("额定电压下限不能为空"); |
| | | } |
| | | if(null == dto.getRatedCurrent()){ |
| | | return AjaxResult.error("额定电流不能为空"); |
| | | } |
| | | if(null == dto.getRatedPower()){ |
| | | return AjaxResult.error("额定功率不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(dto.getNationalStandard())){ |
| | | return AjaxResult.error("国家标准不能为空"); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.BatchSetAccountingStrategy; |
| | | import com.ruoyi.chargingPile.api.query.PageChargingPileList; |
| | | import com.ruoyi.chargingPile.mapper.TChargingPileMapper; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class TChargingPileServiceImpl extends ServiceImpl<TChargingPileMapper, TChargingPile> implements TChargingPileService { |
| | | |
| | | |
| | | @Resource |
| | | private TChargingGunService chargingGunService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩列表数据 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<PageChargingPileListDTO> pageChargingPileList(PageChargingPileList page) { |
| | | PageInfo<PageChargingPileListDTO> pageInfo = new PageInfo<>(page.getPageCurr(), page.getPageSize()); |
| | | List<PageChargingPileListDTO> list = this.baseMapper.pageChargingPileList(pageInfo, page); |
| | | return pageInfo.setRecords(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加充电桩 |
| | | * @param chargingPile |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult addChargingPile(TChargingPile chargingPile) { |
| | | AjaxResult ajaxResult = addChargingPileVerify(chargingPile); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | long count = this.count(new LambdaQueryWrapper<TChargingPile>().eq(TChargingPile::getCode, chargingPile.getCode()) |
| | | .eq(TChargingPile::getDelFlag, 0)); |
| | | if(count > 0){ |
| | | return AjaxResult.error("设备编号已存在"); |
| | | } |
| | | this.save(chargingPile); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 校验必填项 |
| | | * @param chargingPile |
| | | * @return |
| | | */ |
| | | AjaxResult addChargingPileVerify(TChargingPile chargingPile){ |
| | | if(StringUtils.isEmpty(chargingPile.getCode())){ |
| | | return AjaxResult.error("设备编号不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(chargingPile.getName())){ |
| | | return AjaxResult.error("充电设备名称不能为空"); |
| | | } |
| | | if(null == chargingPile.getNumber()){ |
| | | return AjaxResult.error("桩号不能为空"); |
| | | } |
| | | if(null == chargingPile.getType()){ |
| | | return AjaxResult.error("设备类型不能为空"); |
| | | } |
| | | if(null == chargingPile.getSiteId()){ |
| | | return AjaxResult.error("归属电站不能为空"); |
| | | } |
| | | if(null == chargingPile.getPartnerId()){ |
| | | return AjaxResult.error("归属合作商不能为空"); |
| | | } |
| | | if(null == chargingPile.getRatedPower()){ |
| | | return AjaxResult.error("额定功率不能为空"); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩详情 |
| | | * @param id 充电桩id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public TChargingPile getChargingPile(Integer id) { |
| | | return this.baseMapper.getChargingPile(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑充电桩 |
| | | * @param chargingPile |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult editChargingPile(TChargingPile chargingPile) { |
| | | AjaxResult ajaxResult = addChargingPileVerify(chargingPile); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | TChargingPile one = this.getOne(new LambdaQueryWrapper<TChargingPile>().eq(TChargingPile::getCode, chargingPile.getCode()) |
| | | .eq(TChargingPile::getDelFlag, 0)); |
| | | if(null != one && !one.getId().equals(chargingPile.getId())){ |
| | | return AjaxResult.error("设备编号已存在"); |
| | | } |
| | | this.updateById(chargingPile); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除充电桩 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult delChargingPile(Integer id) { |
| | | //检查是否有关联数据 |
| | | //接口 |
| | | long count = chargingGunService.count(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0)); |
| | | if(count > 0){ |
| | | return AjaxResult.error("该充电桩有关联的接口数据,删除失败!"); |
| | | } |
| | | TChargingPile chargingPile = this.getById(id); |
| | | chargingPile.setDelFlag(true); |
| | | this.updateById(chargingPile); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 批量设置计费策略 |
| | | * @param setAccountingStrategy |
| | | */ |
| | | @Override |
| | | public void batchSetAccountingStrategy(BatchSetAccountingStrategy setAccountingStrategy) { |
| | | List<Integer> id = setAccountingStrategy.getId(); |
| | | List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0)); |
| | | for (TChargingGun tChargingGun : list) { |
| | | tChargingGun.setChargingPileId(setAccountingStrategy.getAccountingStrategyId()); |
| | | } |
| | | chargingGunService.updateBatchById(list); |
| | | } |
| | | } |
| | |
| | | a.parking_space as parkingSpace, |
| | | DATE_FORMAT('%Y-%m-%d %H:%i:%s', a.establishment_time) as establishmentTime, |
| | | c.num as chargingPileNumber, |
| | | a.sort |
| | | a.sort, |
| | | a.accounting_strategy_id as accountingStrategyId, |
| | | if(a.accounting_strategy_id is null, 1, if(d.site_id is null, 1, 2)) as accountingStrategyType |
| | | from t_site a |
| | | left join t_partner b on (a.partner_id = b.id) |
| | | left join (select site_id, count(1) as num from t_charging_pile where del_flag = 0 group by site_id) c on (a.id = c.site_id) |
| | | left join t_accounting_strategy d on (a.accounting_strategy_id = d.id) |
| | | WHERE a.del_flag = 0 |
| | | <if test="null != item.name and '' != item.name"> |
| | | and a.name like CONCAT('%', #{item.name}, '%') |
| | |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="getPlatformAccountingStrategy" resultType="com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO"> |
| | | SELECT |
| | | id, site_id, `name`, description, discount, create_time, del_flag |
| | | FROM t_accounting_strategy where del_flag = 0 and site_id is not null order by create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | id, code, `name`, `number`, `type`, site_id, partner_id, manufacturer_code, manufacturer, equipment_type, production_date, rated_power, charging_station_number, status, create_time, del_flag |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <select id="pageChargingPileList" resultType="com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO"> |
| | | select |
| | | id, |
| | | code, |
| | | name, |
| | | number, |
| | | type, |
| | | a.site_id as siteId, |
| | | b.name as siteName, |
| | | a.partner_id as partnerId, |
| | | c.name as partnerName, |
| | | a.manufacturer, |
| | | a.equipment_type as equipmentType, |
| | | a.ratedPower |
| | | from t_charging_pile a |
| | | left join t_site b on (a.site_id = b.id) |
| | | left join t_partner c on (a.partner_id = c.id) |
| | | where del_flag = 0 |
| | | <if test="null != item.siteId"> |
| | | and a.site_id = #{item.siteId} |
| | | </if> |
| | | <if test="null != item.name and '' != item.name"> |
| | | and a.name like CONCAT('%', #{item.name}, '%') |
| | | </if> |
| | | <if test="null != item.type"> |
| | | and a.type = #{item.type} |
| | | </if> |
| | | order by a.create_time desc limit #{item.pageCurr}, #{item.pageSize} |
| | | </select> |
| | | |
| | | |
| | | <select id="getChargingPile" resultMap="BaseResultMap"> |
| | | select |
| | | a.*, |
| | | b.name as siteName, |
| | | c.name as partnerName |
| | | from t_charging_pile a |
| | | left join t_site b on (a.site_id = b.id) |
| | | left join t_partner c on (a.partner_id = c.id) |
| | | </select> |
| | | </mapper> |