救援集成进度2/5
This commit is contained in:
parent
86eb948f7c
commit
98d25ce157
@ -2,10 +2,11 @@ package cn.iocoder.yudao.module.rescue.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.rescue.core.controller.BaseController;
|
||||
import cn.iocoder.yudao.module.rescue.core.page.TableDataInfo;
|
||||
import cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver;
|
||||
import cn.iocoder.yudao.module.rescue.service.IRescueDeptDriverService;
|
||||
import cn.iocoder.yudao.module.rescue.utils.ExcelUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -30,10 +31,12 @@ public class RescueDeptDriverController extends BaseController {
|
||||
* 查询救援客户司机分配列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RescueDeptDriver rescueDeptDriver) {
|
||||
startPage();
|
||||
List<RescueDeptDriver> list = rescueDeptDriverService.selectRescueDeptDriverList(rescueDeptDriver);
|
||||
return getDataTable(list);
|
||||
public CommonResult<IPage<?>> list(RescueDeptDriver rescueDeptDriver,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<RescueDeptDriver> page = new Page<>(pageNo, pageSize);
|
||||
IPage<RescueDeptDriver> list = rescueDeptDriverService.selectRescueDeptDriverPage(rescueDeptDriver, page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -42,7 +45,7 @@ public class RescueDeptDriverController extends BaseController {
|
||||
// @Log(title = "救援客户司机分配", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RescueDeptDriver rescueDeptDriver) {
|
||||
List<RescueDeptDriver> list = rescueDeptDriverService.selectRescueDeptDriverList(rescueDeptDriver);
|
||||
List<RescueDeptDriver> list = rescueDeptDriverService.list();
|
||||
ExcelUtil<RescueDeptDriver> util = new ExcelUtil<RescueDeptDriver>(RescueDeptDriver.class);
|
||||
util.exportExcel(response, list, "救援客户司机分配数据");
|
||||
}
|
||||
@ -76,7 +79,7 @@ public class RescueDeptDriverController extends BaseController {
|
||||
/**
|
||||
* 删除救援客户司机分配
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermission('dept_driver:dept_driver:remove')")
|
||||
// @PreAuthorize("@ss.hasPermission('dept_driver:dept_driver:remove')")
|
||||
// @Log(title = "救援客户司机分配", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public CommonResult remove(@PathVariable Long[] ids) {
|
||||
|
@ -22,6 +22,8 @@ import cn.iocoder.yudao.module.rescue.utils.ExcelUtil;
|
||||
import cn.iocoder.yudao.module.rescue.utils.StringUtils;
|
||||
import cn.iocoder.yudao.module.rescue.vo.MoneyManagement;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -102,10 +104,12 @@ public class RescueInfoSystem extends BaseController {
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
@GetMapping("/list2")
|
||||
public TableDataInfo list2(RescueInfo rescueInfo) {
|
||||
startPage();
|
||||
List<RescueInfo> list = rescueInfoService.selectRescueListSystem2(rescueInfo);
|
||||
return getDataTable(list);
|
||||
public CommonResult<IPage<?>> list2(RescueInfo rescueInfo,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<RescueInfo> page = new Page<>(pageNo, pageSize);
|
||||
IPage<RescueInfo> list = rescueInfoService.selectRescueListSystem2(rescueInfo, page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/watchImg")
|
||||
@ -134,7 +138,7 @@ public class RescueInfoSystem extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('system:info:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RescueInfo rescueInfo) {
|
||||
List<RescueInfo> list = rescueInfoService.selectRescueListSystem2(rescueInfo);
|
||||
List<RescueInfo> list = rescueInfoService.list();
|
||||
for (RescueInfo info : list) {
|
||||
info.setSetMoneyYuan(Double.valueOf(Optional.ofNullable(info.getSetMoney()).orElse(0L)) / 100);
|
||||
info.setPayMoneyYuan(Double.valueOf(Optional.ofNullable(info.getPayMoney()).orElse(0L)) / 100);
|
||||
@ -154,10 +158,12 @@ public class RescueInfoSystem extends BaseController {
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
@GetMapping("/driverList")
|
||||
public TableDataInfo driverList(DriverInfoDto driverInfoDto) {
|
||||
startPage();
|
||||
List<DriverInfo> list = rescueInfoService.driverList(driverInfoDto);
|
||||
return getDataTable(list);
|
||||
public CommonResult<IPage<?>> driverList(DriverInfoDto driverInfoDto,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<DriverInfo> page = new Page<>(pageNo, pageSize);
|
||||
IPage<DriverInfo> list = rescueInfoService.driverList(driverInfoDto, page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/getDriverById")
|
||||
|
@ -73,6 +73,7 @@ public class DriverInfo extends TenantBaseDO
|
||||
/** 用户账号 */
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
private Integer age;
|
||||
|
||||
/** 用户昵称 */
|
||||
@TableField(exist = false)
|
||||
|
@ -109,6 +109,7 @@ public class RescueCarInfo extends TenantBaseDO {
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Long deptId;
|
||||
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ public class RescueCustomerInfo extends TenantBaseDO
|
||||
private String defaultRescueType;
|
||||
|
||||
/** 部门主键 */
|
||||
@TableField
|
||||
private Long deptId;
|
||||
@TableField(exist = false)
|
||||
private String deptName;
|
||||
|
@ -2,7 +2,10 @@ package cn.iocoder.yudao.module.rescue.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
@ -30,7 +33,16 @@ public interface RescueDeptDriverMapper extends BaseMapper<RescueDeptDriver>
|
||||
* @param rescueDeptDriver 救援客户司机分配
|
||||
* @return 救援客户司机分配集合
|
||||
*/
|
||||
public List<RescueDeptDriver> selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver);
|
||||
List<RescueDeptDriver> selectRescueDeptDriverList(@Param("map") RescueDeptDriver rescueDeptDriver);
|
||||
|
||||
/**
|
||||
* 分页查
|
||||
* @author 小李
|
||||
* @date 9:02 2024/8/20
|
||||
* @param rescueDeptDriver
|
||||
* @param page
|
||||
**/
|
||||
IPage<RescueDeptDriver> selectRescueDeptDriverList(@Param("map") RescueDeptDriver rescueDeptDriver, Page<RescueDeptDriver> page);
|
||||
|
||||
/**
|
||||
* 删除救援客户司机分配
|
||||
|
@ -8,6 +8,8 @@ import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -31,8 +33,7 @@ public interface RescueInfoMapper extends BaseMapper<RescueInfo>
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<RescueInfo> selectRescueInfoList(RescueInfo rescueInfo);
|
||||
public List<RescueInfo> selectRescueListSystem2(RescueInfo rescueInfo);
|
||||
|
||||
IPage<RescueInfo> selectRescueListSystem2(@Param("map") RescueInfo rescueInfo, Page<RescueInfo> page);
|
||||
|
||||
JSONObject listData(RescueInfo rescueInfo);
|
||||
/**
|
||||
@ -46,7 +47,7 @@ public interface RescueInfoMapper extends BaseMapper<RescueInfo>
|
||||
|
||||
|
||||
|
||||
List<DriverInfo> driverList(DriverInfoDto user);
|
||||
IPage<DriverInfo> driverList(@Param("map") DriverInfoDto user, Page<DriverInfo> page);
|
||||
List<DriverInfo2Dto> driverListApp(DriverInfoDto user);
|
||||
Map<String,Integer> driverInMap2();
|
||||
void dealOverTimeRescue();
|
||||
|
@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.rescue.service;
|
||||
|
||||
import cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
||||
@ -28,7 +30,15 @@ public interface IRescueDeptDriverService extends IService<RescueDeptDriver>
|
||||
* @param rescueDeptDriver 救援客户司机分配
|
||||
* @return 救援客户司机分配集合
|
||||
*/
|
||||
public List<RescueDeptDriver> selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver);
|
||||
List<RescueDeptDriver> selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver);
|
||||
|
||||
/**
|
||||
* 分页查
|
||||
* @author 小李
|
||||
* @date 8:59 2024/8/20
|
||||
* @param rescueDeptDriver
|
||||
**/
|
||||
IPage<RescueDeptDriver> selectRescueDeptDriverPage(RescueDeptDriver rescueDeptDriver, Page<RescueDeptDriver> page);
|
||||
|
||||
/**
|
||||
* 新增救援客户司机分配
|
||||
|
@ -8,6 +8,8 @@ import cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto;
|
||||
import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
|
||||
import cn.iocoder.yudao.module.rescue.vo.MoneyManagement;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
||||
@ -45,7 +47,7 @@ public interface IRescueInfoService extends IService<RescueInfo>
|
||||
public List<RescueInfo> selectRescueInfoListByAdmin(RescueInfo rescueInfo);
|
||||
JSONObject rescueInfoDetail(Long rescueId);
|
||||
List<RescueInfo> selectRescueListSystem(RescueInfo rescueInfo);
|
||||
List<RescueInfo> selectRescueListSystem2(RescueInfo rescueInfo);
|
||||
IPage<RescueInfo> selectRescueListSystem2(RescueInfo rescueInfo, Page<RescueInfo> page);
|
||||
JSONObject listData(RescueInfo rescueInfo);
|
||||
|
||||
void designateDriver(Long rescueId,Long driverId) throws Exception;
|
||||
@ -81,7 +83,7 @@ public interface IRescueInfoService extends IService<RescueInfo>
|
||||
* @return 结果
|
||||
*/
|
||||
public void deleteRescueInfoById(Long id);
|
||||
List<DriverInfo> driverList(DriverInfoDto user);
|
||||
IPage<DriverInfo> driverList(DriverInfoDto user, Page<DriverInfo> page);
|
||||
DriverInfo getDriverById(Long driverId);
|
||||
void addDriver(DriverInfo driverInfo) throws Exception;
|
||||
void updateDriver(DriverInfo user);
|
||||
|
@ -80,8 +80,7 @@ public class RescueCustomerInfoServiceImpl extends ServiceImpl<RescueCustomerInf
|
||||
*/
|
||||
@Override
|
||||
public int deleteRescueCustomerInfoByIds(Long[] ids) {
|
||||
List<Long> longs = Arrays.asList(ids);
|
||||
return baseMapper.deleteByIds(longs);
|
||||
return baseMapper.deleteByIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -9,12 +9,17 @@ import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.rescue.service.IDriverInfoService;
|
||||
import cn.iocoder.yudao.module.rescue.service.IRescueDeptDriverService;
|
||||
import cn.iocoder.yudao.module.rescue.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.iocoder.yudao.module.rescue.mapper.RescueDeptDriverMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* 救援客户司机分配Service业务层处理
|
||||
@ -23,8 +28,7 @@ import java.util.List;
|
||||
* @date 2023-09-21
|
||||
*/
|
||||
@Service
|
||||
public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMapper, RescueDeptDriver> implements IRescueDeptDriverService
|
||||
{
|
||||
public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMapper, RescueDeptDriver> implements IRescueDeptDriverService {
|
||||
@Autowired
|
||||
private DeptApi deptService;
|
||||
@Autowired
|
||||
@ -41,8 +45,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
|
||||
* @return 救援客户司机分配
|
||||
*/
|
||||
@Override
|
||||
public RescueDeptDriver selectRescueDeptDriverById(Long id)
|
||||
{
|
||||
public RescueDeptDriver selectRescueDeptDriverById(Long id) {
|
||||
return baseMapper.selectRescueDeptDriverById(id);
|
||||
}
|
||||
|
||||
@ -53,46 +56,45 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
|
||||
* @return 救援客户司机分配
|
||||
*/
|
||||
@Override
|
||||
public List<RescueDeptDriver> selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver)
|
||||
{
|
||||
public List<RescueDeptDriver> selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver) {
|
||||
List<RescueDeptDriver> rescueDeptDrivers = baseMapper.selectRescueDeptDriverList(rescueDeptDriver);
|
||||
for (RescueDeptDriver deptDriver : rescueDeptDrivers) {
|
||||
DeptRespDTO dept = deptService.getDept(deptDriver.getDeptId());
|
||||
deptDriver.setDeptName(dept.getName());
|
||||
String firstDriverIds = deptDriver.getFirstDriverIds();
|
||||
if (StringUtils.isNotEmpty(firstDriverIds)){
|
||||
if (StringUtils.isNotEmpty(firstDriverIds)) {
|
||||
String[] driverIds = firstDriverIds.split(",");
|
||||
String firstDriverName ="";
|
||||
String firstDriverName = "";
|
||||
for (String driverId : driverIds) {
|
||||
DriverInfo driverInfo = driverInfoService.getById(driverId);
|
||||
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
|
||||
firstDriverName=firstDriverName+sysUser.getNickname()+"|";
|
||||
firstDriverName = firstDriverName + sysUser.getNickname() + "|";
|
||||
}
|
||||
deptDriver.setFirstDriverName(firstDriverName);
|
||||
|
||||
|
||||
}
|
||||
String secondDriverIds = deptDriver.getSecondDriverIds();
|
||||
if (StringUtils.isNotEmpty(secondDriverIds)){
|
||||
if (StringUtils.isNotEmpty(secondDriverIds)) {
|
||||
String[] driverIds = secondDriverIds.split(",");
|
||||
String name ="";
|
||||
String name = "";
|
||||
for (String driverId : driverIds) {
|
||||
DriverInfo driverInfo = driverInfoService.getById(driverId);
|
||||
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
|
||||
name=name+sysUser.getNickname()+"|";
|
||||
name = name + sysUser.getNickname() + "|";
|
||||
}
|
||||
deptDriver.setSecondDriverName(name);
|
||||
|
||||
|
||||
}
|
||||
String thirdDriverIds = deptDriver.getThirdDriverIds();
|
||||
if (StringUtils.isNotEmpty(thirdDriverIds)){
|
||||
if (StringUtils.isNotEmpty(thirdDriverIds)) {
|
||||
String[] driverIds = thirdDriverIds.split(",");
|
||||
String name ="";
|
||||
String name = "";
|
||||
for (String driverId : driverIds) {
|
||||
DriverInfo driverInfo = driverInfoService.getById(driverId);
|
||||
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
|
||||
name=name+sysUser.getNickname()+"|";
|
||||
name = name + sysUser.getNickname() + "|";
|
||||
}
|
||||
deptDriver.setThirdDriverIds(name);
|
||||
|
||||
@ -102,6 +104,55 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
|
||||
return rescueDeptDrivers;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查
|
||||
* @author 小李
|
||||
* @date 8:59 2024/8/20
|
||||
* @param rescueDeptDriver
|
||||
**/
|
||||
@Override
|
||||
public IPage<RescueDeptDriver> selectRescueDeptDriverPage(RescueDeptDriver rescueDeptDriver, Page<RescueDeptDriver> page){
|
||||
IPage<RescueDeptDriver> driverIPage = baseMapper.selectRescueDeptDriverList(rescueDeptDriver, page);
|
||||
for (RescueDeptDriver deptDriver : driverIPage.getRecords()) {
|
||||
DeptRespDTO dept = deptService.getDept(deptDriver.getDeptId());
|
||||
deptDriver.setDeptName(dept.getName());
|
||||
String firstDriverIds = deptDriver.getFirstDriverIds();
|
||||
if (StringUtils.isNotEmpty(firstDriverIds)) {
|
||||
StringJoiner tempStr = new StringJoiner("|");
|
||||
String[] driverIds = firstDriverIds.split(",");
|
||||
for (String driverId : driverIds) {
|
||||
DriverInfo driverInfo = driverInfoService.getById(driverId);
|
||||
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
|
||||
tempStr.add(sysUser.getNickname());
|
||||
}
|
||||
deptDriver.setFirstDriverName(tempStr.toString());
|
||||
}
|
||||
String secondDriverIds = deptDriver.getSecondDriverIds();
|
||||
if (StringUtils.isNotEmpty(secondDriverIds)) {
|
||||
String[] driverIds = secondDriverIds.split(",");
|
||||
StringJoiner tempStr = new StringJoiner("|");
|
||||
for (String driverId : driverIds) {
|
||||
DriverInfo driverInfo = driverInfoService.getById(driverId);
|
||||
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
|
||||
tempStr.add(sysUser.getNickname());
|
||||
}
|
||||
deptDriver.setSecondDriverName(tempStr.toString());
|
||||
}
|
||||
String thirdDriverIds = deptDriver.getThirdDriverIds();
|
||||
if (StringUtils.isNotEmpty(thirdDriverIds)) {
|
||||
String[] driverIds = thirdDriverIds.split(",");
|
||||
StringJoiner tempStr = new StringJoiner("|");
|
||||
for (String driverId : driverIds) {
|
||||
DriverInfo driverInfo = driverInfoService.getById(driverId);
|
||||
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
|
||||
tempStr.add(sysUser.getNickname());
|
||||
}
|
||||
deptDriver.setThirdDriverName(tempStr.toString());
|
||||
}
|
||||
}
|
||||
return driverIPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增救援客户司机分配
|
||||
*
|
||||
@ -109,8 +160,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRescueDeptDriver(RescueDeptDriver rescueDeptDriver)
|
||||
{
|
||||
public int insertRescueDeptDriver(RescueDeptDriver rescueDeptDriver) {
|
||||
return baseMapper.insert(rescueDeptDriver);
|
||||
}
|
||||
|
||||
@ -121,8 +171,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRescueDeptDriver(RescueDeptDriver rescueDeptDriver)
|
||||
{
|
||||
public int updateRescueDeptDriver(RescueDeptDriver rescueDeptDriver) {
|
||||
return baseMapper.updateById(rescueDeptDriver);
|
||||
}
|
||||
|
||||
@ -133,9 +182,8 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRescueDeptDriverByIds(Long[] ids)
|
||||
{
|
||||
return baseMapper.deleteRescueDeptDriverByIds(ids);
|
||||
public int deleteRescueDeptDriverByIds(Long[] ids) {
|
||||
return baseMapper.deleteByIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,8 +193,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRescueDeptDriverById(Long id)
|
||||
{
|
||||
public int deleteRescueDeptDriverById(Long id) {
|
||||
return baseMapper.deleteRescueDeptDriverById(id);
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,8 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -305,8 +307,8 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RescueInfo> selectRescueListSystem2(RescueInfo rescueInfo) {
|
||||
return baseMapper.selectRescueListSystem2(rescueInfo);
|
||||
public IPage<RescueInfo> selectRescueListSystem2(RescueInfo rescueInfo, Page<RescueInfo> page) {
|
||||
return baseMapper.selectRescueListSystem2(rescueInfo, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -444,9 +446,9 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DriverInfo> driverList(DriverInfoDto driverInfo) {
|
||||
List<DriverInfo> driverInfos = baseMapper.driverList(driverInfo);
|
||||
for (DriverInfo info : driverInfos) {
|
||||
public IPage<DriverInfo> driverList(DriverInfoDto driverInfo, Page<DriverInfo> page) {
|
||||
IPage<DriverInfo> driverInfos = baseMapper.driverList(driverInfo, page);
|
||||
for (DriverInfo info : driverInfos.getRecords()) {
|
||||
LambdaQueryWrapper<RescueCarInfo> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(RescueCarInfo::getCarOwn,"1").eq(RescueCarInfo::getPossessorId,info.getId());
|
||||
List<RescueCarInfo> list = carInfoService.list(queryWrapper);
|
||||
@ -509,6 +511,9 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
|
||||
List<Long> roleIds = new ArrayList<>();
|
||||
roleIds.add((roleReqDTO.getId()));
|
||||
staffRespVO.setRoleIds(roleIds);
|
||||
staffRespVO.setName(driverInfoDto.getRealName());
|
||||
staffRespVO.setSex(driverInfoDto.getSex());
|
||||
staffRespVO.setTel(driverInfoDto.getPhonenumber());
|
||||
Long userId = staffService.saveStaff(staffRespVO);
|
||||
//代表为救援司机角色 需要添加到司机表中
|
||||
driverInfoDto.setUserId(userId);
|
||||
@ -575,7 +580,7 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper,RescueIn
|
||||
DriverInfo driverInfo = driverInfoService.selectDriverInfoById(id);
|
||||
Long userId = driverInfo.getUserId();
|
||||
staffService.deleteStaffByUserId(userId);
|
||||
driverInfoService.deleteDriverInfoById(id);
|
||||
driverInfoService.removeById(id);
|
||||
LambdaQueryWrapper<RescueCarInfo> queryWrapper1 =new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(RescueCarInfo::getPossessorId,id).eq(RescueCarInfo::getCarOwn,"1");
|
||||
carInfoService.remove(queryWrapper1);
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
<sql id="selectDriverInfoVo">
|
||||
select id, user_id, phonenumber, license_image, id_card_right, id_card_back, auth_status, reject_info, driver_status, driver_longitude, driver_latitude, driver_position_info, driver_offline_time, create_time, creator, update_time, updater from driver_info
|
||||
select id, user_id, phonenumber, license_image, id_card_right, id_card_back, auth_status, reject_info, driver_status, driver_longitude, driver_latitude, driver_position_info, driver_offline_time from driver_info
|
||||
</sql>
|
||||
|
||||
<select id="selectDriverInfoList" parameterType="cn.iocoder.yudao.module.rescue.domain.DriverInfo" resultType="cn.iocoder.yudao.module.rescue.domain.DriverInfo">
|
||||
@ -49,10 +49,6 @@
|
||||
<if test="driverLatitude != null">driver_latitude,</if>
|
||||
<if test="driverPositionInfo != null">driver_position_info,</if>
|
||||
<if test="driverOfflineTime != null">driver_offline_time,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">creator,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">updater,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@ -68,10 +64,6 @@
|
||||
<if test="driverLatitude != null">#{driverLatitude},</if>
|
||||
<if test="driverPositionInfo != null">#{driverPositionInfo},</if>
|
||||
<if test="driverOfflineTime != null">#{driverOfflineTime},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -90,10 +82,7 @@
|
||||
<if test="driverLatitude != null">driver_latitude = #{driverLatitude},</if>
|
||||
<if test="driverPositionInfo != null">driver_position_info = #{driverPositionInfo},</if>
|
||||
<if test="driverOfflineTime != null">driver_offline_time = #{driverOfflineTime},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">creator = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">updater = #{updateBy},</if>
|
||||
<if test="age != null">age = #{age},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
@ -10,12 +10,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
|
||||
<select id="selectRescueDeptDriverList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver" resultType="cn.iocoder.yudao.module.rescue.domain.RescueDeptDriver">
|
||||
select * from rescue_dept_driver
|
||||
<where>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="firstDriverIds != null and firstDriverIds != ''"> and first_driver_ids = #{firstDriverIds}</if>
|
||||
<if test="secondDriverIds != null and secondDriverIds != ''"> and second_driver_ids = #{secondDriverIds}</if>
|
||||
<if test="thirdDriverIds != null and thirdDriverIds != ''"> and third_driver_ids = #{thirdDriverIds}</if>
|
||||
select * from rescue_dept_driver where deleted = '0'
|
||||
<where>
|
||||
<if test="map.deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="map.firstDriverIds != null and map.firstDriverIds != ''"> and first_driver_ids = #{map.firstDriverIds}</if>
|
||||
<if test="map.secondDriverIds != null and map.secondDriverIds != ''"> and second_driver_ids = #{map.secondDriverIds}</if>
|
||||
<if test="map.thirdDriverIds != null and map.thirdDriverIds != ''"> and third_driver_ids = #{map.thirdDriverIds}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -1,17 +1,18 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.rescue.mapper.RescueInfoMapper">
|
||||
|
||||
<select id="selectRescueInfoList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||
<select id="selectRescueInfoList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo"
|
||||
resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||
SELECT
|
||||
ri.*,roi.order_status,roi.set_money
|
||||
FROM
|
||||
rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
<where>
|
||||
1=1
|
||||
1=1
|
||||
<if test="rescueStatus != null ">
|
||||
<choose>
|
||||
<when test="rescueStatus == '1'.toString()">
|
||||
@ -51,41 +52,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</where>
|
||||
order by ri.create_time desc
|
||||
</select>
|
||||
<select id="selectRescueListSystem2" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||
<select id="selectRescueListSystem2" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo"
|
||||
resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||
SELECT
|
||||
ri.*,roi.order_status,roi.set_money,roi.id as rescueOrderId,roi.pay_money,roi.pay_time
|
||||
FROM
|
||||
rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
<where>
|
||||
<if test="orderStatus != null and orderStatus != ''">
|
||||
and roi.order_status = #{orderStatus}
|
||||
<if test="map.orderStatus != null and map.orderStatus != ''">
|
||||
and roi.order_status = #{map.orderStatus}
|
||||
</if>
|
||||
<if test="rescueStatus != null and rescueStatus != ''">
|
||||
and ri.rescue_status = #{rescueStatus}
|
||||
<if test="map.rescueStatus != null and map.rescueStatus != ''">
|
||||
and ri.rescue_status = #{map.rescueStatus}
|
||||
</if>
|
||||
<if test="licenseNum != null ">
|
||||
and ri.license_num like concat('%',#{licenseNum},'%')
|
||||
<if test="map.licenseNum != null ">
|
||||
and ri.license_num like concat('%',#{map.licenseNum},'%')
|
||||
</if>
|
||||
<if test="connectionName != null ">
|
||||
and ri.connection_name like concat('%',#{connectionName},'%')
|
||||
<if test="map.connectionName != null ">
|
||||
and ri.connection_name like concat('%',#{map.connectionName},'%')
|
||||
</if>
|
||||
<if test="driverName != null ">
|
||||
and ri.driver_name like concat('%',#{driverName},'%')
|
||||
<if test="map.driverName != null ">
|
||||
and ri.driver_name like concat('%',#{map.driverName},'%')
|
||||
</if>
|
||||
<if test="driverCarNum != null ">
|
||||
and ri.driver_car_num like concat('%',#{driverCarNum},'%')
|
||||
<if test="map.driverCarNum != null ">
|
||||
and ri.driver_car_num like concat('%',#{map.driverCarNum},'%')
|
||||
</if>
|
||||
<if test="rescueType != null ">
|
||||
and ri.rescue_type = #{rescueType}
|
||||
<if test="map.rescueType != null ">
|
||||
and ri.rescue_type = #{map.rescueType}
|
||||
</if>
|
||||
<if test="feeType != null ">
|
||||
and ri.fee_type = #{feeType}
|
||||
<if test="map.feeType != null ">
|
||||
and ri.fee_type = #{map.feeType}
|
||||
</if>
|
||||
<if test="flag != null ">
|
||||
<if test="map.flag != null ">
|
||||
and ri.driver_id is not null
|
||||
</if>
|
||||
<if test="rescueStart != null and rescueEnd != null"> and rescue_time between concat(#{rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59') </if>
|
||||
<if test="map.rescueStart != null and map.rescueEnd != null">and rescue_time between
|
||||
concat(#{map.rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
order by ri.create_time desc
|
||||
@ -94,12 +98,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="listData" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
sum(set_money/100) as allMoney,count(1) as allNum,sum(case when ri.car_type ='1' then (set_money/100)* ${rescueTcBig}
|
||||
when ri.car_type ='2' then (set_money/100)* ${rescueTcMid}
|
||||
when ri.car_type ='3' then (set_money/100)* ${rescueTcSmall} else 0 end) as tcAll
|
||||
sum(set_money/100) as allMoney,count(1) as allNum,sum(case when ri.car_type ='1' then (set_money/100)*
|
||||
${rescueTcBig}
|
||||
when ri.car_type ='2' then (set_money/100)* ${rescueTcMid}
|
||||
when ri.car_type ='3' then (set_money/100)* ${rescueTcSmall} else 0 end) as tcAll
|
||||
FROM
|
||||
rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
<where>
|
||||
<if test="driverName != null ">
|
||||
and ri.driver_name like concat('%',#{driverName},'%')
|
||||
@ -110,254 +115,252 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="flag != null ">
|
||||
and ri.driver_id is not null
|
||||
</if>
|
||||
<if test="rescueStart != null "> and rescue_time like concat(#{rescueStart},'%') </if>
|
||||
<if test="rescueStart != null ">and rescue_time like concat(#{rescueStart},'%')</if>
|
||||
${params.dataScope}
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectRescueInfoListApp" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||
<select id="selectRescueInfoListApp" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo"
|
||||
resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||
SELECT
|
||||
ri.*,roi.order_status,roi.set_money
|
||||
FROM
|
||||
rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
<where>
|
||||
(ri.user_id = #{userId} or connection_phone =#{connectionPhone})
|
||||
<if test="rescueStatus != null ">
|
||||
<choose>
|
||||
<when test="rescueStatus == '1'.toString()">
|
||||
<!-- 救援中 -->
|
||||
and (ri.rescue_status = '1' or ri.rescue_status = '2' or ri.rescue_status = '3')
|
||||
</when>
|
||||
<when test="rescueStatus == '2'.toString()">
|
||||
<!--待支付 -->
|
||||
and roi.order_status ='1'
|
||||
</when>
|
||||
<when test="rescueStatus == '3'.toString()">
|
||||
<!-- 待取车 -->
|
||||
and ri.rescue_status ='6'
|
||||
</when>
|
||||
<when test="rescueStatus == '4'.toString()">
|
||||
<!-- 评价 -->
|
||||
and roi.order_status ='2'
|
||||
</when>
|
||||
<when test="rescueStatus == '5'.toString()">
|
||||
<!-- 评价 -->
|
||||
and roi.order_status ='3'
|
||||
</when>
|
||||
<when test="rescueStatus == '8'.toString()">
|
||||
<!-- 已还车 -->
|
||||
and ri.rescue_status ='8'
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="licenseNum != null ">
|
||||
and ri.license_num like concat('%',#{licenseNum},'%')
|
||||
</if>
|
||||
</where>
|
||||
order by ri.create_time desc
|
||||
<choose>
|
||||
<when test="rescueStatus == '1'.toString()">
|
||||
<!-- 救援中 -->
|
||||
and (ri.rescue_status = '1' or ri.rescue_status = '2' or ri.rescue_status = '3')
|
||||
</when>
|
||||
<when test="rescueStatus == '2'.toString()">
|
||||
<!--待支付 -->
|
||||
and roi.order_status ='1'
|
||||
</when>
|
||||
<when test="rescueStatus == '3'.toString()">
|
||||
<!-- 待取车 -->
|
||||
and ri.rescue_status ='6'
|
||||
</when>
|
||||
<when test="rescueStatus == '4'.toString()">
|
||||
<!-- 评价 -->
|
||||
and roi.order_status ='2'
|
||||
</when>
|
||||
<when test="rescueStatus == '5'.toString()">
|
||||
<!-- 评价 -->
|
||||
and roi.order_status ='3'
|
||||
</when>
|
||||
<when test="rescueStatus == '8'.toString()">
|
||||
<!-- 已还车 -->
|
||||
and ri.rescue_status ='8'
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="licenseNum != null ">
|
||||
and ri.license_num like concat('%',#{licenseNum},'%')
|
||||
</if>
|
||||
</where>
|
||||
order by ri.create_time desc
|
||||
|
||||
</select>
|
||||
<select id="getKcList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||
select * from rescue_info ri
|
||||
</select>
|
||||
<select id="getKcList" parameterType="cn.iocoder.yudao.module.rescue.domain.RescueInfo"
|
||||
resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||
select * from rescue_info ri
|
||||
<where>
|
||||
dept_id = #{deptId} and rescue_type = '5'
|
||||
dept_id = #{deptId} and rescue_type = '5'
|
||||
<if test="connectionName != null and connectionName != ''">
|
||||
and (connection_name like concat('%', #{connectionName}, '%') or connection_phone like concat('%', #{connectionPhone}, '%') or license_num like concat('%',#{licenseNum}, '%'))
|
||||
</if>
|
||||
and (connection_name like concat('%', #{connectionName}, '%') or connection_phone like concat('%',
|
||||
#{connectionPhone}, '%') or license_num like concat('%',#{licenseNum}, '%'))
|
||||
</if>
|
||||
<if test="rescueStatus != null ">
|
||||
<choose>
|
||||
<when test="rescueStatus == '1'.toString()">
|
||||
<choose>
|
||||
<when test="rescueStatus == '1'.toString()">
|
||||
<!-- 扣车中 -->
|
||||
and rescue_status <![CDATA[<]]> '6'
|
||||
</when>
|
||||
<when test="rescueStatus == '2'.toString()">
|
||||
<!-- 已解 -->
|
||||
and rescue_status <![CDATA[>=]]> '6'
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
and rescue_status <![CDATA[<]]> '6'
|
||||
</when>
|
||||
<when test="rescueStatus == '2'.toString()">
|
||||
<!-- 已解 -->
|
||||
and rescue_status <![CDATA[>=]]> '6'
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="driverList" resultType="cn.iocoder.yudao.module.rescue.domain.DriverInfo">
|
||||
SELECT
|
||||
su.user_id AS userId,
|
||||
su.nick_name AS nickName,
|
||||
su.phonenumber AS phonenumber,
|
||||
su.user_age as userAge,
|
||||
su.sex as sex,
|
||||
su.avatar as avatar,
|
||||
su.real_name as realName,
|
||||
di.*
|
||||
FROM
|
||||
driver_info di
|
||||
INNER JOIN sys_user su ON di.user_id = su.user_id
|
||||
AND su.del_flag = '0'
|
||||
WHERE 1=1
|
||||
<if test="realName!=null and realName!=''">
|
||||
and su.real_name like concat('%',#{realName},'%')
|
||||
</if>
|
||||
<if test="phonenumber!=null and phonenumber!=''">
|
||||
and su.phonenumber = #{phonenumber}
|
||||
</if>
|
||||
<if test="driveStatus!=null and driveStatus!=''">
|
||||
and di.driver_status = #{driveStatus}
|
||||
</if>
|
||||
<if test="authStatus!=null and authStatus!=''">
|
||||
and di.auth_status = #{authStatus}
|
||||
</if>
|
||||
<if test="carType!=null and carType!=''">
|
||||
and di.car_type = #{carType}
|
||||
</if>
|
||||
<if test="carLicenseNum!=null and carLicenseNum!=''">
|
||||
and di.car_license_num like concat('%',#{carLicenseNum},'%')
|
||||
</if>
|
||||
${params.dataScope}
|
||||
order by di.create_time desc
|
||||
</select>
|
||||
<select id="driverListApp" resultType="cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto">
|
||||
SELECT
|
||||
di.*,su.real_name,rci.rescue_car_num
|
||||
FROM
|
||||
driver_info di
|
||||
INNER JOIN sys_user su ON di.user_id = su.user_id AND su.del_flag = '0'
|
||||
left join sys_dept sd on sd.dept_id = di.dept_id
|
||||
inner join rescue_car_info rci on rci.possessor_id = di.id
|
||||
WHERE di.auth_status='2'
|
||||
<if test="searchValue!=null and searchValue!=''">
|
||||
and (su.real_name like concat('%',#{searchValue},'%') or di.phonenumber like concat('%',#{searchValue},'%') or rci.rescue_car_num like concat('%',#{searchValue},'%'))
|
||||
</if>
|
||||
order by di.create_time desc
|
||||
</select>
|
||||
<select id="driverInMap2" resultType="java.util.Map">
|
||||
SELECT
|
||||
IFNULL(sum(di.driver_status='1'),0) as kxNum,IFNULL(sum(di.driver_status='2'),0) as ztNum,IFNULL(sum(di.driver_status='3'),0) as mlNum,IFNULL(sum(di.driver_status='4'),0) as lxNum
|
||||
FROM
|
||||
<select id="driverList" resultType="cn.iocoder.yudao.module.rescue.domain.DriverInfo">
|
||||
SELECT
|
||||
su.id AS userId,
|
||||
su.nickname AS nickName,
|
||||
su.mobile AS phonenumber,
|
||||
su.sex as sex,
|
||||
su.avatar as avatar,
|
||||
di.*
|
||||
FROM
|
||||
driver_info di
|
||||
INNER JOIN sys_user su ON di.user_id = su.user_id
|
||||
AND su.del_flag = '0'
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = di.dept_id
|
||||
INNER JOIN rescue_car_info rci ON rci.possessor_id = di.id
|
||||
WHERE
|
||||
di.auth_status = '2'
|
||||
INNER JOIN system_users su ON di.user_id = su.id
|
||||
AND su.deleted = '0'
|
||||
WHERE 1=1
|
||||
<if test="map.nickName !=null and map.nickName !=''">
|
||||
and su.nickname like concat('%',#{map.nickName},'%')
|
||||
</if>
|
||||
<if test="map.phonenumber!=null and map.phonenumber!=''">
|
||||
and su.mobile like concat('%', #{map.phonenumber}, '%')
|
||||
</if>
|
||||
<if test="map.driveStatus!=null and map.driveStatus!=''">
|
||||
and di.driver_status = #{map.driveStatus}
|
||||
</if>
|
||||
<if test="map.authStatus!=null and map.authStatus!=''">
|
||||
and di.auth_status = #{map.authStatus}
|
||||
</if>
|
||||
<if test="map.carType!=null and map.carType!=''">
|
||||
and di.car_type = #{map.carType}
|
||||
</if>
|
||||
<if test="map.carLicenseNum!=null and map.carLicenseNum!=''">
|
||||
and di.car_license_num like concat('%',#{map.carLicenseNum},'%')
|
||||
</if>
|
||||
order by di.create_time desc
|
||||
</select>
|
||||
<update id="dealOverTimeRescue" >
|
||||
UPDATE rescue_info
|
||||
SET need_system = '1'
|
||||
WHERE
|
||||
need_system = '0'
|
||||
AND driver_id IS NULL
|
||||
AND TIMESTAMPDIFF(
|
||||
MINUTE,
|
||||
rescue_time,
|
||||
NOW()) > 5
|
||||
AND rescue_status = '2'
|
||||
</update>
|
||||
|
||||
<select id="driverListApp" resultType="cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto">
|
||||
SELECT
|
||||
di.*,su.real_name,rci.rescue_car_num
|
||||
FROM
|
||||
driver_info di
|
||||
INNER JOIN sys_user su ON di.user_id = su.user_id AND su.del_flag = '0'
|
||||
left join sys_dept sd on sd.dept_id = di.dept_id
|
||||
inner join rescue_car_info rci on rci.possessor_id = di.id
|
||||
WHERE di.auth_status='2'
|
||||
<if test="searchValue!=null and searchValue!=''">
|
||||
and (su.real_name like concat('%',#{searchValue},'%') or di.phonenumber like concat('%',#{searchValue},'%')
|
||||
or rci.rescue_car_num like concat('%',#{searchValue},'%'))
|
||||
</if>
|
||||
order by di.create_time desc
|
||||
</select>
|
||||
<select id="driverInMap2" resultType="java.util.Map">
|
||||
SELECT IFNULL(sum(di.driver_status = '1'), 0) as kxNum,
|
||||
IFNULL(sum(di.driver_status = '2'), 0) as ztNum,
|
||||
IFNULL(sum(di.driver_status = '3'), 0) as mlNum,
|
||||
IFNULL(sum(di.driver_status = '4'), 0) as lxNum
|
||||
FROM driver_info di
|
||||
INNER JOIN sys_user su ON di.user_id = su.user_id
|
||||
AND su.del_flag = '0'
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = di.dept_id
|
||||
INNER JOIN rescue_car_info rci ON rci.possessor_id = di.id
|
||||
WHERE di.auth_status = '2'
|
||||
</select>
|
||||
<update id="dealOverTimeRescue">
|
||||
UPDATE rescue_info
|
||||
SET need_system = '1'
|
||||
WHERE need_system = '0'
|
||||
AND driver_id IS NULL
|
||||
AND TIMESTAMPDIFF(
|
||||
MINUTE, rescue_time,
|
||||
NOW()) > 5
|
||||
AND rescue_status = '2'
|
||||
</update>
|
||||
<select id="getOverTimeRescue" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||
SELECT
|
||||
ri.*, MAX(rdi.driver_level) as driverLevel
|
||||
FROM
|
||||
rescue_info ri
|
||||
INNER JOIN rescue_driver_info rdi ON ri.id = rdi.rescue_id
|
||||
WHERE
|
||||
ri.driver_id IS NULL
|
||||
AND ri.rescue_status = '2'
|
||||
SELECT ri.*,
|
||||
MAX(rdi.driver_level) as driverLevel
|
||||
FROM rescue_info ri
|
||||
INNER JOIN rescue_driver_info rdi ON ri.id = rdi.rescue_id
|
||||
WHERE ri.driver_id IS NULL
|
||||
AND ri.rescue_status = '2'
|
||||
GROUP BY ri.id
|
||||
HAVING
|
||||
TIMESTAMPDIFF(
|
||||
MINUTE,
|
||||
MAX(rdi.create_time),
|
||||
NOW()) <![CDATA[>]]> 3
|
||||
HAVING TIMESTAMPDIFF(
|
||||
MINUTE, MAX(rdi.create_time),
|
||||
NOW()) <![CDATA[>]]> 3
|
||||
</select>
|
||||
<select id="getRescueStatistics" resultType="java.util.Map">
|
||||
SELECT
|
||||
IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3'),0) as jyzNum,
|
||||
IFNULL(sum(roi.order_status ='1'),0) as dzfNum,
|
||||
IFNULL(sum(ri.rescue_status ='6'),0) as dqcNum,
|
||||
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5' ),0) as ywcNum
|
||||
FROM
|
||||
rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
where ri.user_id = #{userId} or connection_phone =#{connectionPhone}
|
||||
SELECT IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3'), 0) as jyzNum,
|
||||
IFNULL(sum(roi.order_status = '1'), 0) as dzfNum,
|
||||
IFNULL(sum(ri.rescue_status = '6'), 0) as dqcNum,
|
||||
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5'), 0) as ywcNum
|
||||
FROM rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
where ri.user_id = #{userId}
|
||||
or connection_phone = #{connectionPhone}
|
||||
</select>
|
||||
<select id="getRescueStatisticsByAdmin" resultType="java.util.Map">
|
||||
SELECT
|
||||
IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3'),0) as jyzNum,
|
||||
IFNULL(sum(roi.order_status ='1'),0) as dzfNum,
|
||||
IFNULL(sum(ri.rescue_status ='6'),0) as dqcNum,
|
||||
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5' ),0) as ywcNum
|
||||
FROM
|
||||
rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
where 1=1
|
||||
${params.dataScope}
|
||||
SELECT IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3'), 0) as jyzNum,
|
||||
IFNULL(sum(roi.order_status = '1'), 0) as dzfNum,
|
||||
IFNULL(sum(ri.rescue_status = '6'), 0) as dqcNum,
|
||||
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5'), 0) as ywcNum
|
||||
FROM rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
where 1 = 1
|
||||
${params.dataScope}
|
||||
</select>
|
||||
<delete id="deleteOtherInfo1">
|
||||
DELETE
|
||||
FROM
|
||||
rescue_info_detail
|
||||
WHERE
|
||||
rescue_info_id = #{rescueId};
|
||||
FROM rescue_info_detail
|
||||
WHERE rescue_info_id = #{rescueId};
|
||||
|
||||
|
||||
</delete>
|
||||
<delete id="deleteOtherInfo2">
|
||||
DELETE
|
||||
FROM
|
||||
rescue_driver_info
|
||||
WHERE
|
||||
rescue_id = #{rescueId};
|
||||
FROM rescue_driver_info
|
||||
WHERE rescue_id = #{rescueId};
|
||||
</delete>
|
||||
|
||||
<select id="getDriverCarNum" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
count( 1 ) as allNum,ifnull(sum(case when start_scale is null then 0 when end_scale is null then 0 else end_scale - start_scale end ),0) as allDistance
|
||||
FROM
|
||||
rescue_info
|
||||
where driver_id = #{driverId} and driver_car_num = #{carNum} and rescue_time like concat(#{time},'%')
|
||||
<select id="getDriverCarNum" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT count(1) as allNum,
|
||||
ifnull(sum(case
|
||||
when start_scale is null then 0
|
||||
when end_scale is null then 0
|
||||
else end_scale - start_scale end), 0) as allDistance
|
||||
FROM rescue_info
|
||||
where driver_id = #{driverId}
|
||||
and driver_car_num = #{carNum}
|
||||
and rescue_time like concat(#{time}, '%')
|
||||
</select>
|
||||
<select id="getRescueInfoByDriver" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||
SELECT
|
||||
ri.*,roi.order_status,roi.set_money,roi.id as rescueOrderId,roi.pay_money,roi.pay_time
|
||||
FROM
|
||||
rescue_info ri
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
where
|
||||
driver_id is not null
|
||||
<if test="rescueStart != null and rescueEnd != null"> and rescue_time between concat(#{rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59') </if>
|
||||
<if test="licenseNum != null ">
|
||||
and ri.license_num like concat('%',#{licenseNum},'%')
|
||||
</if>
|
||||
<if test="feeType != null ">
|
||||
and ri.fee_type = #{feeType}
|
||||
</if>
|
||||
<if test="flag != null ">
|
||||
and ri.driver_id is not null
|
||||
</if>
|
||||
<if test="rescueStart != null and rescueEnd != null"> and rescue_time between concat(#{rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59') </if>
|
||||
left join rescue_order_info roi on roi.rescue_info_id = ri.id
|
||||
where
|
||||
driver_id is not null
|
||||
<if test="rescueStart != null and rescueEnd != null">and rescue_time between concat(#{rescueStart},' 00:00:00')
|
||||
and concat(#{rescueEnd},' 23:59:59')
|
||||
</if>
|
||||
<if test="licenseNum != null ">
|
||||
and ri.license_num like concat('%',#{licenseNum},'%')
|
||||
</if>
|
||||
<if test="feeType != null ">
|
||||
and ri.fee_type = #{feeType}
|
||||
</if>
|
||||
<if test="flag != null ">
|
||||
and ri.driver_id is not null
|
||||
</if>
|
||||
<if test="rescueStart != null and rescueEnd != null">and rescue_time between concat(#{rescueStart},' 00:00:00')
|
||||
and concat(#{rescueEnd},' 23:59:59')
|
||||
</if>
|
||||
|
||||
<if test="driverName != null ">
|
||||
and ri.driver_name like concat('%',#{driverName},'%')
|
||||
</if>
|
||||
<if test="driverCarNum != null ">
|
||||
and ri.driver_car_num like concat('%',#{driverCarNum},'%')
|
||||
</if>
|
||||
<if test="rescueStartMonth != null">
|
||||
<if test="driverName != null ">
|
||||
and ri.driver_name like concat('%',#{driverName},'%')
|
||||
</if>
|
||||
<if test="driverCarNum != null ">
|
||||
and ri.driver_car_num like concat('%',#{driverCarNum},'%')
|
||||
</if>
|
||||
<if test="rescueStartMonth != null">
|
||||
and rescue_time like concat(#{rescueStartMonth},'%')
|
||||
</if>
|
||||
${params.dataScope}
|
||||
</if>
|
||||
${params.dataScope}
|
||||
|
||||
order by ri.driver_name desc
|
||||
</select>
|
||||
<select id="statisticsInfo" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
IFNULL(sum(roi.set_money),0)/100 as money,count(ri.id) as rescueNum,su.real_name as driverName
|
||||
FROM
|
||||
driver_info di
|
||||
LEFT JOIN rescue_info ri on ri.driver_id = di.id and ri.rescue_time <![CDATA[>=]]> #{startTime} and ri.rescue_time <![CDATA[<=]]> #{endTime}
|
||||
LEFT JOIN rescue_order_info roi on ri.id = roi.rescue_info_id
|
||||
INNER JOIN sys_user su on di.user_id = su.user_id
|
||||
SELECT IFNULL(sum(roi.set_money), 0) / 100 as money,
|
||||
count(ri.id) as rescueNum,
|
||||
su.real_name as driverName
|
||||
FROM driver_info di
|
||||
LEFT JOIN rescue_info ri on ri.driver_id = di.id and ri.rescue_time <![CDATA[>=]]> #{startTime} and
|
||||
ri.rescue_time <![CDATA[<=]]> #{endTime}
|
||||
LEFT JOIN rescue_order_info roi on ri.id = roi.rescue_info_id
|
||||
INNER JOIN sys_user su on di.user_id = su.user_id
|
||||
GROUP BY di.id
|
||||
ORDER BY rescueNum desc
|
||||
</select>
|
||||
|
Loading…
Reference in New Issue
Block a user