diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueDeptDriverController.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueDeptDriverController.java index 4e054aff..efa09533 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueDeptDriverController.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueDeptDriverController.java @@ -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 list = rescueDeptDriverService.selectRescueDeptDriverList(rescueDeptDriver); - return getDataTable(list); + public CommonResult> list(RescueDeptDriver rescueDeptDriver, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + Page page = new Page<>(pageNo, pageSize); + IPage 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 list = rescueDeptDriverService.selectRescueDeptDriverList(rescueDeptDriver); + List list = rescueDeptDriverService.list(); ExcelUtil util = new ExcelUtil(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) { diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java index f9b0348a..d33c7859 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java @@ -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 list = rescueInfoService.selectRescueListSystem2(rescueInfo); - return getDataTable(list); + public CommonResult> list2(RescueInfo rescueInfo, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + Page page = new Page<>(pageNo, pageSize); + IPage 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 list = rescueInfoService.selectRescueListSystem2(rescueInfo); + List 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 list = rescueInfoService.driverList(driverInfoDto); - return getDataTable(list); + public CommonResult> driverList(DriverInfoDto driverInfoDto, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + Page page = new Page<>(pageNo, pageSize); + IPage list = rescueInfoService.driverList(driverInfoDto, page); + return success(list); } @GetMapping("/getDriverById") diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/DriverInfo.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/DriverInfo.java index afb0d237..6eaea61e 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/DriverInfo.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/DriverInfo.java @@ -73,6 +73,7 @@ public class DriverInfo extends TenantBaseDO /** 用户账号 */ @TableField(exist = false) private String userName; + private Integer age; /** 用户昵称 */ @TableField(exist = false) diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueCarInfo.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueCarInfo.java index e1cc3be7..d4fd6871 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueCarInfo.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueCarInfo.java @@ -109,6 +109,7 @@ public class RescueCarInfo extends TenantBaseDO { /** * 部门id */ + @TableField(exist = false) private Long deptId; } diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueCustomerInfo.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueCustomerInfo.java index d28bb5f4..26fbb36c 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueCustomerInfo.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueCustomerInfo.java @@ -55,6 +55,7 @@ public class RescueCustomerInfo extends TenantBaseDO private String defaultRescueType; /** 部门主键 */ + @TableField private Long deptId; @TableField(exist = false) private String deptName; diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueDeptDriverMapper.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueDeptDriverMapper.java index 83f1d247..f1a04e2d 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueDeptDriverMapper.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueDeptDriverMapper.java @@ -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 * @param rescueDeptDriver 救援客户司机分配 * @return 救援客户司机分配集合 */ - public List selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver); + List selectRescueDeptDriverList(@Param("map") RescueDeptDriver rescueDeptDriver); + + /** + * 分页查 + * @author 小李 + * @date 9:02 2024/8/20 + * @param rescueDeptDriver + * @param page + **/ + IPage selectRescueDeptDriverList(@Param("map") RescueDeptDriver rescueDeptDriver, Page page); /** * 删除救援客户司机分配 diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java index f8a0bdbb..54296248 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/mapper/RescueInfoMapper.java @@ -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 * @return 【请填写功能名称】集合 */ public List selectRescueInfoList(RescueInfo rescueInfo); - public List selectRescueListSystem2(RescueInfo rescueInfo); - + IPage selectRescueListSystem2(@Param("map") RescueInfo rescueInfo, Page page); JSONObject listData(RescueInfo rescueInfo); /** @@ -46,7 +47,7 @@ public interface RescueInfoMapper extends BaseMapper - List driverList(DriverInfoDto user); + IPage driverList(@Param("map") DriverInfoDto user, Page page); List driverListApp(DriverInfoDto user); Map driverInMap2(); void dealOverTimeRescue(); diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueDeptDriverService.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueDeptDriverService.java index 02cfc6ba..1431ba9c 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueDeptDriverService.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueDeptDriverService.java @@ -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 * @param rescueDeptDriver 救援客户司机分配 * @return 救援客户司机分配集合 */ - public List selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver); + List selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver); + + /** + * 分页查 + * @author 小李 + * @date 8:59 2024/8/20 + * @param rescueDeptDriver + **/ + IPage selectRescueDeptDriverPage(RescueDeptDriver rescueDeptDriver, Page page); /** * 新增救援客户司机分配 diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueInfoService.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueInfoService.java index 993a818f..bd7f7f5c 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueInfoService.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/IRescueInfoService.java @@ -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 public List selectRescueInfoListByAdmin(RescueInfo rescueInfo); JSONObject rescueInfoDetail(Long rescueId); List selectRescueListSystem(RescueInfo rescueInfo); - List selectRescueListSystem2(RescueInfo rescueInfo); + IPage selectRescueListSystem2(RescueInfo rescueInfo, Page page); JSONObject listData(RescueInfo rescueInfo); void designateDriver(Long rescueId,Long driverId) throws Exception; @@ -81,7 +83,7 @@ public interface IRescueInfoService extends IService * @return 结果 */ public void deleteRescueInfoById(Long id); - List driverList(DriverInfoDto user); + IPage driverList(DriverInfoDto user, Page page); DriverInfo getDriverById(Long driverId); void addDriver(DriverInfo driverInfo) throws Exception; void updateDriver(DriverInfo user); diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueCustomerInfoServiceImpl.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueCustomerInfoServiceImpl.java index ba099f70..db3a7044 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueCustomerInfoServiceImpl.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueCustomerInfoServiceImpl.java @@ -80,8 +80,7 @@ public class RescueCustomerInfoServiceImpl extends ServiceImpl longs = Arrays.asList(ids); - return baseMapper.deleteByIds(longs); + return baseMapper.deleteByIds(Arrays.asList(ids)); } /** diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDeptDriverServiceImpl.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDeptDriverServiceImpl.java index dcdaa3d7..1aaaade2 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDeptDriverServiceImpl.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/service/impl/RescueDeptDriverServiceImpl.java @@ -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 implements IRescueDeptDriverService -{ +public class RescueDeptDriverServiceImpl extends ServiceImpl implements IRescueDeptDriverService { @Autowired private DeptApi deptService; @Autowired @@ -41,8 +45,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver) - { + public List selectRescueDeptDriverList(RescueDeptDriver rescueDeptDriver) { List 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 selectRescueDeptDriverPage(RescueDeptDriver rescueDeptDriver, Page page){ + IPage 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 selectRescueListSystem2(RescueInfo rescueInfo) { - return baseMapper.selectRescueListSystem2(rescueInfo); + public IPage selectRescueListSystem2(RescueInfo rescueInfo, Page page) { + return baseMapper.selectRescueListSystem2(rescueInfo, page); } @Override @@ -444,9 +446,9 @@ public class RescueInfoServiceImpl extends ServiceImpl driverList(DriverInfoDto driverInfo) { - List driverInfos = baseMapper.driverList(driverInfo); - for (DriverInfo info : driverInfos) { + public IPage driverList(DriverInfoDto driverInfo, Page page) { + IPage driverInfos = baseMapper.driverList(driverInfo, page); + for (DriverInfo info : driverInfos.getRecords()) { LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); queryWrapper.eq(RescueCarInfo::getCarOwn,"1").eq(RescueCarInfo::getPossessorId,info.getId()); List list = carInfoService.list(queryWrapper); @@ -509,6 +511,9 @@ public class RescueInfoServiceImpl extends ServiceImpl 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 queryWrapper1 =new LambdaQueryWrapper<>(); queryWrapper1.eq(RescueCarInfo::getPossessorId,id).eq(RescueCarInfo::getCarOwn,"1"); carInfoService.remove(queryWrapper1); diff --git a/dl-module-rescue/src/main/resources/mapper/rescue/DriverInfoMapper.xml b/dl-module-rescue/src/main/resources/mapper/rescue/DriverInfoMapper.xml index deb75717..a1b77910 100644 --- a/dl-module-rescue/src/main/resources/mapper/rescue/DriverInfoMapper.xml +++ b/dl-module-rescue/src/main/resources/mapper/rescue/DriverInfoMapper.xml @@ -6,7 +6,7 @@ - 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 - select * from rescue_dept_driver - - and dept_id = #{deptId} - and first_driver_ids = #{firstDriverIds} - and second_driver_ids = #{secondDriverIds} - and third_driver_ids = #{thirdDriverIds} + select * from rescue_dept_driver where deleted = '0' + + and dept_id = #{deptId} + and first_driver_ids = #{map.firstDriverIds} + and second_driver_ids = #{map.secondDriverIds} + and third_driver_ids = #{map.thirdDriverIds} diff --git a/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml b/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml index 43119a9d..257ac50a 100644 --- a/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml +++ b/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml @@ -1,17 +1,18 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - 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 - 1=1 + 1=1 @@ -51,41 +52,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by ri.create_time desc - 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 - - and roi.order_status = #{orderStatus} + + and roi.order_status = #{map.orderStatus} - - and ri.rescue_status = #{rescueStatus} + + and ri.rescue_status = #{map.rescueStatus} - - and ri.license_num like concat('%',#{licenseNum},'%') + + and ri.license_num like concat('%',#{map.licenseNum},'%') - - and ri.connection_name like concat('%',#{connectionName},'%') + + and ri.connection_name like concat('%',#{map.connectionName},'%') - - and ri.driver_name like concat('%',#{driverName},'%') + + and ri.driver_name like concat('%',#{map.driverName},'%') - - and ri.driver_car_num like concat('%',#{driverCarNum},'%') + + and ri.driver_car_num like concat('%',#{map.driverCarNum},'%') - - and ri.rescue_type = #{rescueType} + + and ri.rescue_type = #{map.rescueType} - - and ri.fee_type = #{feeType} + + and ri.fee_type = #{map.feeType} - + and ri.driver_id is not null - and rescue_time between concat(#{rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59') + and rescue_time between + concat(#{map.rescueStart},' 00:00:00') and concat(#{rescueEnd},' 23:59:59') + order by ri.create_time desc @@ -94,12 +98,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 (ri.user_id = #{userId} or connection_phone =#{connectionPhone}) - - - - and (ri.rescue_status = '1' or ri.rescue_status = '2' or ri.rescue_status = '3') - - - - and roi.order_status ='1' - - - - and ri.rescue_status ='6' - - - - and roi.order_status ='2' - - - - and roi.order_status ='3' - - - - and ri.rescue_status ='8' - - - - - and ri.license_num like concat('%',#{licenseNum},'%') - - - order by ri.create_time desc + + + + and (ri.rescue_status = '1' or ri.rescue_status = '2' or ri.rescue_status = '3') + + + + and roi.order_status ='1' + + + + and ri.rescue_status ='6' + + + + and roi.order_status ='2' + + + + and roi.order_status ='3' + + + + and ri.rescue_status ='8' + + + + + and ri.license_num like concat('%',#{licenseNum},'%') + + + order by ri.create_time desc - - + - - - + 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 + + and su.nickname like concat('%',#{map.nickName},'%') + + + and su.mobile like concat('%', #{map.phonenumber}, '%') + + + and di.driver_status = #{map.driveStatus} + + + and di.auth_status = #{map.authStatus} + + + and di.car_type = #{map.carType} + + + and di.car_license_num like concat('%',#{map.carLicenseNum},'%') + + order by di.create_time desc - - 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 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' + DELETE - FROM - rescue_info_detail - WHERE - rescue_info_id = #{rescueId}; + FROM rescue_info_detail + WHERE rescue_info_id = #{rescueId}; DELETE - FROM - rescue_driver_info - WHERE - rescue_id = #{rescueId}; + FROM rescue_driver_info + WHERE rescue_id = #{rescueId}; - + 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}, '%')