增加租户的查询条件
This commit is contained in:
parent
3498953c54
commit
b290b13c6f
@ -3,14 +3,15 @@ package com.xhpc.log.controller;
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.common.enums.StationDeviceEnum;
|
||||
import com.xhpc.log.service.OrderLogService;
|
||||
import lombok.extern.java.Log;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@ -24,11 +25,15 @@ public class OrderLogController extends BaseController {
|
||||
OrderLogService orderLogService;
|
||||
|
||||
@GetMapping("/getPage")
|
||||
public TableDataInfo getOrderPage(){
|
||||
startPage();
|
||||
Long operatorId = SecurityUtils.getUserId();
|
||||
public TableDataInfo getOrderPage(@RequestParam(required = false) String tenantId,
|
||||
@RequestParam(required = false) Integer number){
|
||||
|
||||
return getDataTable(orderLogService.getOrderPage(operatorId, null));
|
||||
startPage();
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("operatorId", SecurityUtils.getUserId());
|
||||
params.put("number", number);
|
||||
params.put("tenantId", tenantId);
|
||||
return getDataTable(orderLogService.getOrderPage(params));
|
||||
}
|
||||
|
||||
|
||||
@ -38,4 +43,19 @@ public class OrderLogController extends BaseController {
|
||||
return getDataTable(orderLogService.getOrderDetailPage(orderId));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response,
|
||||
@RequestParam(required = false) String tenantId,
|
||||
@RequestParam(required = false) Integer number,
|
||||
@RequestParam(required = false) String serialNumber) throws Exception {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("operatorId", SecurityUtils.getUserId());
|
||||
params.put("number", number);
|
||||
params.put("serialNumber", serialNumber);
|
||||
params.put("tenantId", tenantId);
|
||||
orderLogService.export(response, params);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,13 +4,14 @@ package com.xhpc.log.controller;
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.common.enums.StationDeviceEnum;
|
||||
import com.xhpc.log.service.PileLogService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@ -25,10 +26,15 @@ public class PileLogController extends BaseController {
|
||||
|
||||
|
||||
@GetMapping("/getPage")
|
||||
public TableDataInfo getPilePage() {
|
||||
Long operatorId = SecurityUtils.getUserId();
|
||||
public TableDataInfo getPilePage(@RequestParam(required = false) String tenantId,
|
||||
@RequestParam(required = false) Integer number) {
|
||||
startPage();
|
||||
return getDataTable(pileLogService.getPilePage(operatorId, null));
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("operatorId", SecurityUtils.getUserId());
|
||||
params.put("number", number);
|
||||
params.put("tenantId", tenantId);
|
||||
return getDataTable(pileLogService.getPilePage(params));
|
||||
}
|
||||
|
||||
|
||||
@ -38,4 +44,19 @@ public class PileLogController extends BaseController {
|
||||
return getDataTable(pileLogService.getPileRunLogPage(pileId));
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response,
|
||||
@RequestParam(required = false) String tenantId,
|
||||
@RequestParam(required = false) Integer number,
|
||||
@RequestParam(required = false) String serialNumber) throws Exception {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("operatorId", SecurityUtils.getUserId());
|
||||
params.put("number", number);
|
||||
params.put("type", StationDeviceEnum.PILE.getCode());
|
||||
params.put("serialNumber", serialNumber);
|
||||
params.put("tenantId", tenantId);
|
||||
pileLogService.export(response, params);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,12 +6,11 @@ import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.log.service.StationLogService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/log/station")
|
||||
@ -22,10 +21,14 @@ public class StationLogController extends BaseController {
|
||||
StationLogService stationLogService;
|
||||
|
||||
@GetMapping("/getPage")
|
||||
public TableDataInfo getPilePage() {
|
||||
public TableDataInfo getPilePage(@RequestParam(required = false) String tenantId,
|
||||
@RequestParam(required = false) Integer number) {
|
||||
startPage();
|
||||
Long operatorId = SecurityUtils.getUserId();
|
||||
return getDataTable(stationLogService.getStationPage(operatorId, null));
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("operatorId", SecurityUtils.getUserId());
|
||||
params.put("number", number);
|
||||
params.put("tenantId", tenantId);
|
||||
return getDataTable(stationLogService.getStationPage(params));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,14 +1,18 @@
|
||||
package com.xhpc.log.controller;
|
||||
|
||||
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.log.service.SystemLogService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 系统操作日志
|
||||
@ -23,8 +27,12 @@ public class SystemLogController extends BaseController {
|
||||
|
||||
|
||||
@GetMapping("/oper/getPage")
|
||||
public TableDataInfo getPage(){
|
||||
public TableDataInfo getPage(@RequestParam(required = false) String tenantId,
|
||||
@RequestParam(required = false) Integer number){
|
||||
startPage();
|
||||
return getDataTable(systemLogService.getPage(null));
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("operName", SecurityUtils.getUsername());
|
||||
params.put("tenantId", tenantId);
|
||||
return getDataTable(systemLogService.getPage(params));
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,6 +12,6 @@ import java.util.Map;
|
||||
*/
|
||||
public interface SysOperLogMapper {
|
||||
|
||||
List<Map<String, Object>> selectUserOperLog(@Param("operName") String operName);
|
||||
List<Map<String, Object>> selectUserOperLog(@Param("params") Map params);
|
||||
|
||||
}
|
||||
|
||||
@ -16,12 +16,8 @@ public interface XhpcChargingPileMapper {
|
||||
/**
|
||||
* 桩列表
|
||||
*
|
||||
* @param serialNumber 桩编号
|
||||
* @param type 桩类型
|
||||
* @param name 桩名称
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> selectXhpcChargingPileList(@Param("operatorId")Long operatorId, @Param("number")Integer number);
|
||||
List<Map<String, Object>> selectXhpcChargingPileList(@Param("params")Map params);
|
||||
|
||||
/**
|
||||
* 终端
|
||||
|
||||
@ -18,7 +18,7 @@ public interface XhpcChargingStationMapper {
|
||||
*
|
||||
* @return 电站集合
|
||||
*/
|
||||
List<Map<String, Object>> selectXhpcChargingStationList(@Param("operatorId")Long operatorId,@Param("type")Integer type);
|
||||
List<Map<String, Object>> selectXhpcChargingStationList(@Param("params")Map params);
|
||||
|
||||
|
||||
List<Map<String, Object>> selectRateListByStationId(@Param("stationId")Long stationId);
|
||||
|
||||
@ -12,4 +12,7 @@ public interface XhpcDeviceMessageMapper {
|
||||
|
||||
List<Map<String, Object>> selectListByTypeAndSerialNumber(@Param("type") String type,
|
||||
@Param("serialNumber")String serialNumber);
|
||||
|
||||
|
||||
List<Map<String, Object>> selectListByParams(@Param("params")Map params);
|
||||
}
|
||||
|
||||
@ -10,6 +10,6 @@ import java.util.Map;
|
||||
public interface XhpcHistoryOrderMapper {
|
||||
|
||||
|
||||
List<Map<String, Object>> getOrderPage(@Param("operatorId") Long operatorId, @Param("number") Integer number);
|
||||
List<Map<String, Object>> getOrderPage(@Param("params")Map params);
|
||||
|
||||
}
|
||||
@ -13,4 +13,7 @@ public interface XhpcMessageMapper {
|
||||
|
||||
|
||||
List<Map<String, Object>> getOrderMessagePage(@Param("serialNumber")String serialNumber);
|
||||
|
||||
|
||||
List<Map<String, Object>> getOrderMessageByParams(@Param("params")Map params);
|
||||
}
|
||||
|
||||
@ -1,14 +1,17 @@
|
||||
package com.xhpc.log.service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface OrderLogService {
|
||||
|
||||
|
||||
List<Map<String, Object>> getOrderPage(Long operatorId, Integer type);
|
||||
List<Map<String, Object>> getOrderPage(Map<String, Object> params);
|
||||
|
||||
|
||||
List<Map<String, Object>> getOrderDetailPage(String orderId);
|
||||
|
||||
|
||||
void export(HttpServletResponse response, Map<String, Object> params) throws Exception;
|
||||
}
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
package com.xhpc.log.service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface PileLogService {
|
||||
|
||||
|
||||
List<Map<String, Object>> getPilePage(Long operatorId, Integer type);
|
||||
List<Map<String, Object>> getPilePage(Map<String, Object> params);
|
||||
|
||||
|
||||
List<Map<String, Object>> getPileRunLogPage(String pileId);
|
||||
|
||||
void export(HttpServletResponse response, Map<String, Object> params) throws Exception;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import java.util.Map;
|
||||
public interface StationLogService {
|
||||
|
||||
|
||||
List<Map<String, Object>> getStationPage(Long operatorId, Integer type);
|
||||
List<Map<String, Object>> getStationPage(Map<String, Object> params);
|
||||
|
||||
|
||||
List<Map<String, Object>> getStationRatePage(Long stationId);
|
||||
|
||||
@ -6,6 +6,6 @@ import java.util.Map;
|
||||
|
||||
public interface SystemLogService {
|
||||
|
||||
List<Map<String, Object>> getPage(String userName);
|
||||
List<Map<String, Object>> getPage(Map<String, Object> params);
|
||||
|
||||
}
|
||||
|
||||
@ -1,12 +1,17 @@
|
||||
package com.xhpc.log.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.xhpc.log.mapper.XhpcHistoryOrderMapper;
|
||||
import com.xhpc.log.mapper.XhpcMessageMapper;
|
||||
import com.xhpc.log.service.OrderLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -21,8 +26,8 @@ public class OrderLogServiceImpl implements OrderLogService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getOrderPage(Long operatorId, Integer type){
|
||||
return historyOrderMapper.getOrderPage(operatorId, type);
|
||||
public List<Map<String, Object>> getOrderPage(Map<String, Object> params){
|
||||
return historyOrderMapper.getOrderPage(params);
|
||||
}
|
||||
|
||||
|
||||
@ -30,4 +35,35 @@ public class OrderLogServiceImpl implements OrderLogService {
|
||||
public List<Map<String, Object>> getOrderDetailPage(String orderId){
|
||||
return messageMapper.getOrderMessagePage(orderId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void export(HttpServletResponse response, Map<String, Object> params) throws Exception{
|
||||
List<Map<String, Object>> list = messageMapper.getOrderMessageByParams(params);
|
||||
|
||||
ExcelWriter writer = ExcelUtil.getWriter(true);
|
||||
writer.addHeaderAlias("serialNumber", "订单号");
|
||||
writer.addHeaderAlias("sourceName", "订单来源");
|
||||
writer.addHeaderAlias("chargingDegree", "充电电量");
|
||||
writer.addHeaderAlias("amountCharged", "总金额");
|
||||
writer.addHeaderAlias("chargingTime", "充电时长");
|
||||
writer.addHeaderAlias("startSOc", "充电启始soc");
|
||||
writer.addHeaderAlias("endSoc", "结束soc");
|
||||
writer.addHeaderAlias("startTime", "充电开始时间");
|
||||
writer.addHeaderAlias("endTime", "充电结束时间");
|
||||
writer.addHeaderAlias("power", "电桩功率(KW)");
|
||||
writer.addHeaderAlias("content", "充电报文");
|
||||
writer.addHeaderAlias("remark", "备注描述");
|
||||
writer.addHeaderAlias("createTime", "发送时间");
|
||||
|
||||
writer.setOnlyAlias(true);
|
||||
writer.write(list, true);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
|
||||
writer.flush(out, true);
|
||||
writer.close();
|
||||
IoUtil.close(out);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.xhpc.log.service.impl;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.xhpc.common.enums.StationDeviceEnum;
|
||||
import com.xhpc.log.mapper.XhpcChargingPileMapper;
|
||||
import com.xhpc.log.mapper.XhpcDeviceMessageMapper;
|
||||
@ -7,6 +10,8 @@ import com.xhpc.log.service.PileLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -21,9 +26,9 @@ public class PileLogServiceImpl implements PileLogService {
|
||||
XhpcDeviceMessageMapper deviceMessageMapper;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getPilePage(Long operatorId, Integer type){
|
||||
public List<Map<String, Object>> getPilePage(Map<String, Object> params){
|
||||
|
||||
return pileMapper.selectXhpcChargingPileList(operatorId , type);
|
||||
return pileMapper.selectXhpcChargingPileList(params);
|
||||
}
|
||||
|
||||
|
||||
@ -31,4 +36,31 @@ public class PileLogServiceImpl implements PileLogService {
|
||||
public List<Map<String, Object>> getPileRunLogPage(String pileId){
|
||||
return deviceMessageMapper.selectListByTypeAndSerialNumber(StationDeviceEnum.PILE.getCode(), pileId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void export(HttpServletResponse response, Map<String, Object> params) throws Exception{
|
||||
List<Map<String, Object>> list = deviceMessageMapper.selectListByParams(params);
|
||||
|
||||
ExcelWriter writer = ExcelUtil.getWriter(true);
|
||||
writer.addHeaderAlias("chargingStationName", "场站名称");
|
||||
writer.addHeaderAlias("chargingPileName", "充电桩名称");
|
||||
writer.addHeaderAlias("serialNumber", "桩编码");
|
||||
writer.addHeaderAlias("brandModel", "费率");
|
||||
writer.addHeaderAlias("pileType", "电桩类型");
|
||||
writer.addHeaderAlias("power", "电桩功率(KW)");
|
||||
writer.addHeaderAlias("content", "充电桩上传平台报文");
|
||||
writer.addHeaderAlias("replyContent", "平台回复报文");
|
||||
writer.addHeaderAlias("remark", "备注描述");
|
||||
writer.addHeaderAlias("createTime", "发送时间");
|
||||
|
||||
writer.setOnlyAlias(true);
|
||||
writer.write(list, true);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
|
||||
writer.flush(out, true);
|
||||
writer.close();
|
||||
IoUtil.close(out);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,8 +16,8 @@ public class StationLogServiceImpl implements StationLogService {
|
||||
XhpcChargingStationMapper stationMapper;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getStationPage(Long operatorId, Integer type){
|
||||
return stationMapper.selectXhpcChargingStationList(operatorId, type);
|
||||
public List<Map<String, Object>> getStationPage(Map<String, Object> params){
|
||||
return stationMapper.selectXhpcChargingStationList(params);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ public class SystemLogServiceImpl implements SystemLogService {
|
||||
SysOperLogMapper operLogMapper;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getPage(String userName){
|
||||
return operLogMapper.selectUserOperLog(userName);
|
||||
public List<Map<String, Object>> getPage(Map<String, Object> params){
|
||||
return operLogMapper.selectUserOperLog(params);
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,8 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
oper_time as 'operTime'
|
||||
from sys_oper_log
|
||||
<where>
|
||||
<if test="operName!=null and operName!=''">
|
||||
oper_name = #{operName}
|
||||
<if test="params.operName!=null and params.operName!=''">
|
||||
oper_name = #{params.operName}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -98,11 +98,14 @@
|
||||
<!-- <if test="chargingStationId !=null and chargingStationId!=''">-->
|
||||
<!-- and cp.charging_station_id=#{chargingStationId}-->
|
||||
<!-- </if>-->
|
||||
<if test="number !=0 and number ==1">
|
||||
and cp.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{operatorId})
|
||||
<if test="params.number !=0 and params.number ==1">
|
||||
and cp.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{params.operatorId})
|
||||
</if>
|
||||
<if test="number !=0 and number ==2">
|
||||
and cp.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{operatorId})
|
||||
<if test="params.number !=0 and params.number ==2">
|
||||
and cp.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{params.operatorId})
|
||||
</if>
|
||||
<if test="params.tenantId != null and params.tenantId != ''">
|
||||
and cp.tenant_id = #{params.tenantId}
|
||||
</if>
|
||||
order by cp.create_time desc
|
||||
</select>
|
||||
|
||||
@ -16,11 +16,14 @@
|
||||
from xhpc_charging_station as cs
|
||||
left join xhpc_operator as ope on cs.operator_id = ope.operator_id
|
||||
where cs.del_flag =0
|
||||
<if test="type == 1">
|
||||
and cs.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{operatorId})
|
||||
<if test="params.number == 1">
|
||||
and cs.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{params.operatorId})
|
||||
</if>
|
||||
<if test="type == 2">
|
||||
and cs.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{operatorId})
|
||||
<if test="params.number == 2">
|
||||
and cs.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{params.operatorId})
|
||||
</if>
|
||||
<if test="params.tenantId != null and params.tenantId != ''">
|
||||
and cs.tenant_id=#{params.tenantId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@ -20,4 +20,44 @@
|
||||
where type=#{type} and serial_number=#{serialNumber}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectListByParams" resultType="java.util.Map">
|
||||
select
|
||||
concat(cp.name,'号桩') as 'chargingPileName',
|
||||
st.name as 'chargingStationName',
|
||||
cp.brand_model as 'brandModel',
|
||||
cp.type as 'pileType',
|
||||
cp.power as 'power',
|
||||
cp.serial_number as 'serialNumber',
|
||||
m.device_message_id as 'deviceMessageId',
|
||||
m.type as 'type',
|
||||
m.serial_number as 'serialNumber',
|
||||
m.content as 'content',
|
||||
m.reply_content as 'replyContent',
|
||||
m.status as 'status',
|
||||
m.remark as 'remark',
|
||||
m.create_time as 'createTime',
|
||||
m.create_by as 'createBy',
|
||||
m.update_time as 'updateTime',
|
||||
from xhpc_device_message m
|
||||
left join xhpc_charging_pile cp on cp.serial_number=m.serial_number
|
||||
left join xhpc_charging_station st on st.charging_station_id =cp.charging_station_id
|
||||
where cp.del_flag =0
|
||||
<if test="params.number ==1">
|
||||
and cp.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{params.operatorId})
|
||||
</if>
|
||||
<if test="params.number ==2">
|
||||
and cp.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{params.operatorId})
|
||||
</if>
|
||||
<if test="params.type!=null and params.type!=''">
|
||||
and m.type=#{params.type}
|
||||
</if>
|
||||
<if test="params.tenantId != null and params.tenantId != ''">
|
||||
and cp.tenant_id = #{params.tenantId}
|
||||
</if>
|
||||
<if test="params.serialNumber !=null and params.serialNumber!=''">
|
||||
and cp.serial_number=#{params.serialNumber}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -15,11 +15,14 @@
|
||||
from xhpc_charge_order as co
|
||||
left join xhpc_charging_station as st on st.charging_station_id =co.charging_station_id
|
||||
where co.del_flag =0
|
||||
<if test="number !=0 and number ==1">
|
||||
and co.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{operatorId})
|
||||
<if test="params.number !=0 and params.number ==1">
|
||||
and co.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{params.operatorId})
|
||||
</if>
|
||||
<if test="number !=0 and number ==2">
|
||||
and co.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{operatorId})
|
||||
<if test="params.number !=0 and params.number ==2">
|
||||
and co.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{params.operatorId})
|
||||
</if>
|
||||
<if test="params.tenantId != null and params.tenantId != ''">
|
||||
and co.tenant_id = #{params.tenantId}
|
||||
</if>
|
||||
order by co.create_time desc
|
||||
</select>
|
||||
|
||||
@ -4,14 +4,49 @@
|
||||
<mapper namespace="com.xhpc.log.mapper.XhpcMessageMapper">
|
||||
|
||||
<select id="getOrderMessagePage" resultType="map">
|
||||
select
|
||||
m.message_id as 'messageId',
|
||||
m.charge_order_no as 'chargeOrderNo',
|
||||
m.content as 'content',
|
||||
m.status as 'status',
|
||||
m.remark as 'remark',
|
||||
m.create_time as 'createTime'
|
||||
select m.message_id as 'messageId', m.charge_order_no as 'chargeOrderNo', m.content as 'content', m.status as 'status', m.remark as 'remark', m.create_time as 'createTime'
|
||||
from xhpc_message m
|
||||
where m.charge_order_no=#{serialNumber}
|
||||
where m.charge_order_no = #{serialNumber}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getOrderMessageByParams" resultType="java.util.Map">
|
||||
select
|
||||
co.serial_number as 'serialNumber',
|
||||
co.source as 'source',
|
||||
case co.source when 0 then 'C端用户'
|
||||
when 1 then '流量方用户'
|
||||
when 2 then '社区用户'
|
||||
when 3 then 'B端用户' end as 'sourceName',
|
||||
co.start_time as 'startTime',
|
||||
co.end_time as 'endTime',
|
||||
co.charging_degree as 'chargingDegree',
|
||||
co.amount_charged as 'amountCharged',
|
||||
co.charging_time as 'chargingTime',
|
||||
co.start_soc as 'startSOc',
|
||||
co.end_soc as 'endSoc',
|
||||
m.message_id as 'messageId',
|
||||
m.charge_order_no as 'chargeOrderNo',
|
||||
m.content as 'content',
|
||||
m.status as 'status',
|
||||
m.remark as 'remark',
|
||||
m.create_time as 'createTime'
|
||||
from xhpc_message m
|
||||
LEFT JOIN xhpc_charge_order as co on co.serial_number = m.charge_order_no
|
||||
left join xhpc_charging_station as st on st.charging_station_id = co.charging_station_id
|
||||
where co.del_flag =0
|
||||
<if test="params.number !=0 and params.number ==1">
|
||||
and co.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{params.operatorId})
|
||||
</if>
|
||||
<if test="params.number !=0 and params.number ==2">
|
||||
and co.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{params.operatorId})
|
||||
</if>
|
||||
<if test="params.tenantId != null and params.tenantId != ''">
|
||||
and co.tenant_id = #{params.tenantId}
|
||||
</if>
|
||||
<if test="params.serialNumber !=null and params.serialNumber !=''">
|
||||
and co.serial_number=#{serialNumber}
|
||||
</if>
|
||||
order by m.charge_order_no asc, m.create_time asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user