Merge branch 'driver'
This commit is contained in:
commit
479fd66535
@ -93,12 +93,14 @@ public class WorkReportServiceImpl extends ServiceImpl<WorkReportMapper, WorkRep
|
|||||||
String message = "向您进行了工作汇报,请在内部管理中查阅!";
|
String message = "向您进行了工作汇报,请在内部管理中查阅!";
|
||||||
String text = userName + message;
|
String text = userName + message;
|
||||||
|
|
||||||
|
// 发送消息给汇报对象
|
||||||
|
this.sendMessage(createReqVO.getReportTos(), text, createReqVO.getServicePackageId());
|
||||||
// 根据服务套餐id进行发送
|
// 根据服务套餐id进行发送
|
||||||
if("jiaxiao".equals(createReqVO.getServicePackageId())){
|
/*if("jiaxiao".equals(createReqVO.getServicePackageId())){
|
||||||
this.sendMessage(createReqVO.getReportTos(), text, createReqVO.getServicePackageId());
|
this.sendMessage(createReqVO.getReportTos(), text, createReqVO.getServicePackageId());
|
||||||
}else if("jiance".equals(createReqVO.getServicePackageId())){
|
}else if("jiance".equals(createReqVO.getServicePackageId())){
|
||||||
this.sendMessage(createReqVO.getReportTos(), text, createReqVO.getServicePackageId());
|
this.sendMessage(createReqVO.getReportTos(), text, createReqVO.getServicePackageId());
|
||||||
}
|
}*/
|
||||||
// 返回
|
// 返回
|
||||||
return report.getId();
|
return report.getId();
|
||||||
}
|
}
|
||||||
@ -187,7 +189,6 @@ public class WorkReportServiceImpl extends ServiceImpl<WorkReportMapper, WorkRep
|
|||||||
/**
|
/**
|
||||||
* 查询汇报对象数量
|
* 查询汇报对象数量
|
||||||
*
|
*
|
||||||
* @param userId
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -14,6 +14,8 @@ public enum InspectionFileEnum {
|
|||||||
FILE("equipment", "设备文件夹"),
|
FILE("equipment", "设备文件夹"),
|
||||||
COACH("coach", "驾校员工文件夹"),
|
COACH("coach", "驾校员工文件夹"),
|
||||||
student("student","驾校学员文件夹"),
|
student("student","驾校学员文件夹"),
|
||||||
|
WX_EQUIPMENT("wx_equipment","维修设备文件夹"),
|
||||||
|
JY_EQUIPMENT("jy_equipment","救援设备文件夹"),
|
||||||
INSPECTION_CUSTOMER("small_inspection_member_folder", "检测客户资料夹"),
|
INSPECTION_CUSTOMER("small_inspection_member_folder", "检测客户资料夹"),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@ -174,6 +174,11 @@ public class InspectionEquInfoController extends BaseController {
|
|||||||
return success(inspectionEquInfoService.addFolder(id));
|
return success(inspectionEquInfoService.addFolder(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/addDeviceFolder")
|
||||||
|
public CommonResult<?> addDeviceFolder(@RequestParam Long id, @RequestParam String servicePackageId, @RequestParam String defaultKey) {
|
||||||
|
return success(inspectionEquInfoService.addDeviceFolder(id, servicePackageId, defaultKey));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备数量根据分类
|
* 查询设备数量根据分类
|
||||||
*
|
*
|
||||||
@ -184,4 +189,9 @@ public class InspectionEquInfoController extends BaseController {
|
|||||||
return success(inspectionEquInfoService.queryEquipmentCountByCategory());
|
return success(inspectionEquInfoService.queryEquipmentCountByCategory());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryEquipmentCountByPackageId")
|
||||||
|
public CommonResult<?> queryEquipmentCountByPackageId(@RequestParam String servicePackageId, @RequestParam String dictType) {
|
||||||
|
return success(inspectionEquInfoService.queryEquipmentCountByPackageId(servicePackageId, dictType));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,4 +96,7 @@ public class InspectionEquInfo extends TenantBaseDO
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<FileDO> fileList;
|
private List<FileDO> fileList;
|
||||||
|
|
||||||
|
/** 服务套餐id */
|
||||||
|
private String servicePackageId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,4 +36,5 @@ public interface InspectionEquInfoMapper extends BaseMapper<InspectionEquInfo>
|
|||||||
public IPage<InspectionEquInfo> selectInspectionEquInfoList(Page page, @Param("inspectionEquInfo") InspectionEquInfo inspectionEquInfo);
|
public IPage<InspectionEquInfo> selectInspectionEquInfoList(Page page, @Param("inspectionEquInfo") InspectionEquInfo inspectionEquInfo);
|
||||||
|
|
||||||
List<EquipmentCountVo> queryEquipmentCountByCategory();
|
List<EquipmentCountVo> queryEquipmentCountByCategory();
|
||||||
|
List<EquipmentCountVo> queryEquipmentCountByPackageId(@Param("servicePackageId") String servicePackageId, @Param("dictType") String dictType);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,6 +80,7 @@ public interface IInspectionEquInfoService extends IService<InspectionEquInfo> {
|
|||||||
* @return 文件夹id
|
* @return 文件夹id
|
||||||
*/
|
*/
|
||||||
Long addFolder(Long id);
|
Long addFolder(Long id);
|
||||||
|
Long addDeviceFolder(Long id, String servicePackageId, String defaultKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备统计信息
|
* 查询设备统计信息
|
||||||
@ -87,4 +88,5 @@ public interface IInspectionEquInfoService extends IService<InspectionEquInfo> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<EquipmentCountVo> queryEquipmentCountByCategory();
|
List<EquipmentCountVo> queryEquipmentCountByCategory();
|
||||||
|
List<EquipmentCountVo> queryEquipmentCountByPackageId(String servicePackageId, String dictType);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,6 +115,7 @@ public interface IInspectionFileService extends IService<InspectionFile> {
|
|||||||
* @return 文件夹id
|
* @return 文件夹id
|
||||||
*/
|
*/
|
||||||
Long addFolder(String folderName, String key);
|
Long addFolder(String folderName, String key);
|
||||||
|
Long addFolderForDevice(String folderName, String key, String servicePackageId);
|
||||||
Long addFolderForJx(String folderName, String key);
|
Long addFolderForJx(String folderName, String key);
|
||||||
Long addFolderForJy(String folderName, String key);
|
Long addFolderForJy(String folderName, String key);
|
||||||
|
|
||||||
|
|||||||
@ -210,6 +210,18 @@ public class InspectionEquInfoServiceImpl extends ServiceImpl<InspectionEquInfoM
|
|||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long addDeviceFolder(Long id, String servicePackageId, String defaultKey) {
|
||||||
|
InspectionEquInfo inspectionEquInfo = this.getById(id);
|
||||||
|
if (ObjectUtil.isNotEmpty(inspectionEquInfo)) {
|
||||||
|
Long folderId = inspectionFileService.addFolderForDevice(inspectionEquInfo.getEquName(), defaultKey, servicePackageId);
|
||||||
|
//修改文件夹id
|
||||||
|
this.update(Wrappers.<InspectionEquInfo>lambdaUpdate().eq(InspectionEquInfo::getId, id).set(InspectionEquInfo::getFolderId, folderId));
|
||||||
|
return folderId;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加设备文件夹
|
* 添加设备文件夹
|
||||||
*
|
*
|
||||||
@ -238,6 +250,11 @@ public class InspectionEquInfoServiceImpl extends ServiceImpl<InspectionEquInfoM
|
|||||||
return baseMapper.queryEquipmentCountByCategory();
|
return baseMapper.queryEquipmentCountByCategory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EquipmentCountVo> queryEquipmentCountByPackageId(String servicePackageId, String dictType) {
|
||||||
|
return baseMapper.queryEquipmentCountByPackageId(servicePackageId, dictType);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存导入的设备信息
|
* 保存导入的设备信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -498,6 +498,36 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
|
|||||||
return resultFiles;
|
return resultFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long addFolderForDevice(String folderName, String key, String servicePackageId) {
|
||||||
|
//根据key找到对应的文件夹id
|
||||||
|
InspectionFile fatherFolder = baseMapper.selectOne(new LambdaQueryWrapper<InspectionFile>().eq(InspectionFile::getDefaultKey, key));
|
||||||
|
|
||||||
|
//如果默认文件夹为空就新建
|
||||||
|
if (fatherFolder == null) {
|
||||||
|
fatherFolder = new InspectionFile();
|
||||||
|
fatherFolder.setFileName(InspectionFileEnum.getDescByType(key));
|
||||||
|
fatherFolder.setType(InspectionConstants.INSPECTION_FOLDER);
|
||||||
|
fatherFolder.setDefaultKey(key);
|
||||||
|
fatherFolder.setServicePackageId(servicePackageId);
|
||||||
|
baseMapper.insert(fatherFolder);
|
||||||
|
fatherFolder.setFileCode(fatherFolder.getId() + ",");
|
||||||
|
baseMapper.updateById(fatherFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
InspectionFile inspectionFile = new InspectionFile();
|
||||||
|
inspectionFile.setFatherId(fatherFolder.getId());
|
||||||
|
inspectionFile.setFileName(folderName + InspectionConstants.INSPECTION_FOLDER_SUFFIX);
|
||||||
|
inspectionFile.setType(InspectionConstants.INSPECTION_FOLDER);
|
||||||
|
inspectionFile.setIsStaffFile(InspectionConstants.INSPECTION_IS_STAFF_FILE);
|
||||||
|
inspectionFile.setServicePackageId(servicePackageId);
|
||||||
|
baseMapper.insert(inspectionFile);
|
||||||
|
inspectionFile.setFileCode(inspectionFile.getId() + ",");
|
||||||
|
baseMapper.updateById(inspectionFile);
|
||||||
|
|
||||||
|
return inspectionFile.getId();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增文件夹
|
* 新增文件夹
|
||||||
*
|
*
|
||||||
|
|||||||
@ -27,6 +27,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="inspectionEquInfo.type != null and inspectionEquInfo.type != ''">
|
<if test="inspectionEquInfo.type != null and inspectionEquInfo.type != ''">
|
||||||
and `type` = #{inspectionEquInfo.type}
|
and `type` = #{inspectionEquInfo.type}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="inspectionEquInfo.servicePackageId != null and inspectionEquInfo.servicePackageId != ''">
|
||||||
|
and service_package_id = #{inspectionEquInfo.servicePackageId}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -48,4 +51,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
GROUP BY sd.value, sd.label;
|
GROUP BY sd.value, sd.label;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryEquipmentCountByPackageId" resultType="cn.iocoder.yudao.module.inspection.vo.EquipmentCountVo">
|
||||||
|
SELECT
|
||||||
|
sd.value AS categoryId,
|
||||||
|
COUNT(iei.id) AS count,
|
||||||
|
sd.label AS categoryName
|
||||||
|
FROM system_dict_data sd
|
||||||
|
LEFT JOIN inspection_equ_info iei
|
||||||
|
ON iei.type = sd.value AND iei.deleted = 0 AND iei.service_package_id = #{servicePackageId}
|
||||||
|
WHERE sd.dict_type = #{dictType}
|
||||||
|
AND sd.deleted = 0
|
||||||
|
GROUP BY sd.value, sd.label;
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -112,8 +112,8 @@ public class TrainController {
|
|||||||
@RequestParam(value = "sort",required = false) String sort,
|
@RequestParam(value = "sort",required = false) String sort,
|
||||||
@RequestParam(value = "startTime",required = false) String startTime,
|
@RequestParam(value = "startTime",required = false) String startTime,
|
||||||
@RequestParam(value = "endTime",required = false) String endTime,
|
@RequestParam(value = "endTime",required = false) String endTime,
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
//默认查全部数据
|
//默认查全部数据
|
||||||
String startTimeStr = "";
|
String startTimeStr = "";
|
||||||
String endTimeStr = "";
|
String endTimeStr = "";
|
||||||
@ -304,7 +304,7 @@ public class TrainController {
|
|||||||
* 当日正在训练学员统计
|
* 当日正在训练学员统计
|
||||||
*/
|
*/
|
||||||
@GetMapping("getTodayTrainSituation")
|
@GetMapping("getTodayTrainSituation")
|
||||||
public CommonResult<CloakAndTrainCountVO> getTodayTrainSituation(Train train){
|
public CommonResult<CloakAndTrainCountVO> getTodayTrainSituation(TodayTrainVO train){
|
||||||
return success(trainService.getTodayTrainSituation(train));
|
return success(trainService.getTodayTrainSituation(train));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,10 +312,10 @@ public class TrainController {
|
|||||||
* 获取当前正在训练的学员列表
|
* 获取当前正在训练的学员列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("getTodayStudentTrainSituation")
|
@GetMapping("getTodayStudentTrainSituation")
|
||||||
public CommonResult<IPage<Train>> getTodayStudentTrainSituation(Train train,
|
public CommonResult<IPage<TodayTrainVO>> getTodayStudentTrainSituation(TodayTrainVO train,
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
||||||
Page<Train> page = new Page<>(pageNo, pageSize);
|
Page<TodayTrainVO> page = new Page<>(pageNum, pageSize);
|
||||||
return success(trainService.getTodayStudentTrainSituation(train,page));
|
return success(trainService.getTodayStudentTrainSituation(train,page));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,10 +44,10 @@ public interface TrainMapper extends BaseMapper<Train> {
|
|||||||
/**
|
/**
|
||||||
* 获取当日实时训练情况
|
* 获取当日实时训练情况
|
||||||
*/
|
*/
|
||||||
CloakAndTrainCountVO getTodayTrainSituation(@Param("entity") Train train);
|
CloakAndTrainCountVO getTodayTrainSituation(@Param("entity") TodayTrainVO train);
|
||||||
/**
|
/**
|
||||||
* 获取正在训练的学员信息
|
* 获取正在训练的学员信息
|
||||||
*/
|
*/
|
||||||
IPage<Train> getTodayStudentTrainSituation(@Param("entity") Train train, Page<Train> page);
|
IPage<TodayTrainVO> getTodayStudentTrainSituation(@Param("entity") TodayTrainVO train, Page<TodayTrainVO> page);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,10 +2,7 @@ package cn.iocoder.yudao.module.train.service;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.module.course.vo.CommissionExportVO;
|
import cn.iocoder.yudao.module.course.vo.CommissionExportVO;
|
||||||
import cn.iocoder.yudao.module.train.entity.Train;
|
import cn.iocoder.yudao.module.train.entity.Train;
|
||||||
import cn.iocoder.yudao.module.train.vo.CloakAndTrainCountVO;
|
import cn.iocoder.yudao.module.train.vo.*;
|
||||||
import cn.iocoder.yudao.module.train.vo.NoClockInRemindVO;
|
|
||||||
import cn.iocoder.yudao.module.train.vo.TrainExportVO;
|
|
||||||
import cn.iocoder.yudao.module.train.vo.TrainVO;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
@ -118,10 +115,10 @@ public interface TrainService extends IService<Train> {
|
|||||||
/**
|
/**
|
||||||
* 当日正在训练学员统计
|
* 当日正在训练学员统计
|
||||||
*/
|
*/
|
||||||
CloakAndTrainCountVO getTodayTrainSituation(Train train);
|
CloakAndTrainCountVO getTodayTrainSituation(TodayTrainVO train);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前正在训练的学员信息列表
|
* 获取当前正在训练的学员信息列表
|
||||||
*/
|
*/
|
||||||
IPage<Train> getTodayStudentTrainSituation(Train train, Page<Train> page);
|
IPage<TodayTrainVO> getTodayStudentTrainSituation(TodayTrainVO train, Page<TodayTrainVO> page);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,10 +11,7 @@ import cn.iocoder.yudao.module.course.vo.CommissionExportVO;
|
|||||||
import cn.iocoder.yudao.module.train.entity.Train;
|
import cn.iocoder.yudao.module.train.entity.Train;
|
||||||
import cn.iocoder.yudao.module.train.mapper.TrainMapper;
|
import cn.iocoder.yudao.module.train.mapper.TrainMapper;
|
||||||
import cn.iocoder.yudao.module.train.service.TrainService;
|
import cn.iocoder.yudao.module.train.service.TrainService;
|
||||||
import cn.iocoder.yudao.module.train.vo.CloakAndTrainCountVO;
|
import cn.iocoder.yudao.module.train.vo.*;
|
||||||
import cn.iocoder.yudao.module.train.vo.NoClockInRemindVO;
|
|
||||||
import cn.iocoder.yudao.module.train.vo.TrainExportVO;
|
|
||||||
import cn.iocoder.yudao.module.train.vo.TrainVO;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -258,7 +255,7 @@ public class TrainServiceImpl extends ServiceImpl<TrainMapper, Train> implements
|
|||||||
* 当日正在训练学员统计
|
* 当日正在训练学员统计
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CloakAndTrainCountVO getTodayTrainSituation(Train train) {
|
public CloakAndTrainCountVO getTodayTrainSituation(TodayTrainVO train) {
|
||||||
return trainMapper.getTodayTrainSituation(train);
|
return trainMapper.getTodayTrainSituation(train);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,7 +263,7 @@ public class TrainServiceImpl extends ServiceImpl<TrainMapper, Train> implements
|
|||||||
* 获取当前正在训练的学员信息列表
|
* 获取当前正在训练的学员信息列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<Train> getTodayStudentTrainSituation(Train train, Page<Train> page) {
|
public IPage<TodayTrainVO> getTodayStudentTrainSituation(TodayTrainVO train, Page<TodayTrainVO> page) {
|
||||||
return trainMapper.getTodayStudentTrainSituation(train, page);
|
return trainMapper.getTodayStudentTrainSituation(train, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,11 @@
|
|||||||
|
package cn.iocoder.yudao.module.train.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.train.entity.Train;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TodayTrainVO extends Train {
|
||||||
|
|
||||||
|
// 课程类型
|
||||||
|
private String courseType;
|
||||||
|
}
|
||||||
@ -331,7 +331,7 @@
|
|||||||
AND dscc.end_time IS NULL
|
AND dscc.end_time IS NULL
|
||||||
AND dscc.deleted = 0
|
AND dscc.deleted = 0
|
||||||
<if test="entity.subject != null and entity.subject != '' ">
|
<if test="entity.subject != null and entity.subject != '' ">
|
||||||
AND subject = #{entity.subject}
|
AND dscc.subject = #{entity.subject}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
dscc.id
|
dscc.id
|
||||||
|
|||||||
@ -213,38 +213,46 @@
|
|||||||
<select id="getTodayTrainSituation" resultType="cn.iocoder.yudao.module.train.vo.CloakAndTrainCountVO">
|
<select id="getTodayTrainSituation" resultType="cn.iocoder.yudao.module.train.vo.CloakAndTrainCountVO">
|
||||||
SELECT
|
SELECT
|
||||||
COALESCE ( COUNT(*), 0 ) AS totalStudentCount,
|
COALESCE ( COUNT(*), 0 ) AS totalStudentCount,
|
||||||
COALESCE ( SUM( CASE WHEN SUBJECT = 2 THEN 1 ELSE 0 END ), 0 ) AS subject2StudentCount,
|
COALESCE ( SUM( CASE WHEN dst.subject = 2 THEN 1 ELSE 0 END ), 0 ) AS subject2StudentCount,
|
||||||
COALESCE ( SUM( CASE WHEN SUBJECT = 3 THEN 1 ELSE 0 END ), 0 ) AS subject3StudentCount
|
COALESCE ( SUM( CASE WHEN dst.subject = 3 THEN 1 ELSE 0 END ), 0 ) AS subject3StudentCount
|
||||||
FROM
|
FROM
|
||||||
drive_school_train
|
drive_school_train dst
|
||||||
|
LEFT JOIN drive_school_course dsc ON dst.course_id = dsc.id AND dsc.deleted = 0
|
||||||
WHERE
|
WHERE
|
||||||
DATE ( create_time ) = CURDATE()
|
DATE ( dst.create_time ) = CURDATE()
|
||||||
AND DATE ( start_time ) = CURDATE()
|
AND DATE ( dst.start_time ) = CURDATE()
|
||||||
AND end_time IS NULL
|
AND dst.end_time IS NULL
|
||||||
AND user_id IS NOT NULL
|
AND dst.user_id IS NOT NULL
|
||||||
AND deleted = 0
|
AND dst.deleted = 0
|
||||||
<if test="entity.userName != null and entity.userName != '' ">
|
<if test="entity.userName != null and entity.userName != '' ">
|
||||||
AND user_name like concat('%',#{entity.userName},'%')
|
AND dst.user_name like concat('%',#{entity.userName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="entity.subject != null">
|
<if test="entity.subject != null">
|
||||||
AND subject = #{entity.subject}
|
AND dst.subject = #{entity.subject}
|
||||||
|
</if>
|
||||||
|
<if test="entity.courseType != null and entity.courseType != ''">
|
||||||
|
AND dsc.type = #{entity.courseType}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getTodayStudentTrainSituation" resultType="cn.iocoder.yudao.module.train.entity.Train">
|
<select id="getTodayStudentTrainSituation" resultType="cn.iocoder.yudao.module.train.vo.TodayTrainVO">
|
||||||
SELECT *
|
SELECT dst.*
|
||||||
FROM drive_school_train
|
FROM drive_school_train dst
|
||||||
|
LEFT JOIN drive_school_course dsc ON dst.course_id = dsc.id AND dsc.deleted = 0
|
||||||
WHERE
|
WHERE
|
||||||
DATE (create_time) = CURDATE()
|
DATE (dst.create_time) = CURDATE()
|
||||||
AND DATE (start_time) = CURDATE()
|
AND DATE (dst.start_time) = CURDATE()
|
||||||
AND end_time IS NULL
|
AND dst.end_time IS NULL
|
||||||
AND user_id IS NOT NULL
|
AND dst.user_id IS NOT NULL
|
||||||
AND deleted = 0
|
AND dst.deleted = 0
|
||||||
<if test="entity.userName != null and entity.userName != ''">
|
<if test="entity.userName != null and entity.userName != ''">
|
||||||
AND user_name like concat('%',#{entity.userName},'%')
|
AND dst.user_name like concat('%',#{entity.userName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="entity.subject != null">
|
<if test="entity.subject != null">
|
||||||
AND subject = #{entity.subject}
|
AND dst.subject = #{entity.subject}
|
||||||
|
</if>
|
||||||
|
<if test="entity.courseType != null and entity.courseType != ''">
|
||||||
|
AND dsc.type = #{entity.courseType}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.rescue.service.IRescueOrderInfoService;
|
|||||||
import cn.iocoder.yudao.module.rescue.utils.ExcelUtil;
|
import cn.iocoder.yudao.module.rescue.utils.ExcelUtil;
|
||||||
import cn.iocoder.yudao.module.rescue.utils.StringUtils;
|
import cn.iocoder.yudao.module.rescue.utils.StringUtils;
|
||||||
import cn.iocoder.yudao.module.rescue.vo.BuckleVO;
|
import cn.iocoder.yudao.module.rescue.vo.BuckleVO;
|
||||||
|
import cn.iocoder.yudao.module.rescue.vo.DriverInfoExportVO;
|
||||||
import cn.iocoder.yudao.module.rescue.vo.MoneyManagement;
|
import cn.iocoder.yudao.module.rescue.vo.MoneyManagement;
|
||||||
import cn.iocoder.yudao.module.rescue.vo.ReturnCarVO;
|
import cn.iocoder.yudao.module.rescue.vo.ReturnCarVO;
|
||||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
||||||
@ -542,7 +543,7 @@ public class RescueInfoSystem extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/get-import-template")
|
@GetMapping("/get-import-template")
|
||||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||||
String[] head = {"员工姓名", "岗位", "年龄", "电话号码", "性别"};
|
String[] head = {"员工姓名", "年龄", "电话号码", "性别"};
|
||||||
|
|
||||||
// 下拉框列及选项:列索引 -> 下拉框选项
|
// 下拉框列及选项:列索引 -> 下拉框选项
|
||||||
Map<Integer, String[]> dropdownColumns = new HashMap<>();
|
Map<Integer, String[]> dropdownColumns = new HashMap<>();
|
||||||
@ -562,7 +563,7 @@ public class RescueInfoSystem extends BaseController {
|
|||||||
dropdownColumns.put(5, genders);
|
dropdownColumns.put(5, genders);
|
||||||
|
|
||||||
List<List<String>> exampleDataList = Arrays.asList(
|
List<List<String>> exampleDataList = Arrays.asList(
|
||||||
Arrays.asList("测试员工", "岗位是下拉框选择", "年龄", "电话号码", "性别")
|
Arrays.asList("测试员工", "年龄", "电话号码", "性别")
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Integer> textColumns = Collections.singletonList(3);
|
List<Integer> textColumns = Collections.singletonList(3);
|
||||||
@ -570,4 +571,16 @@ public class RescueInfoSystem extends BaseController {
|
|||||||
// 导出空白模板到Excel
|
// 导出空白模板到Excel
|
||||||
exportBlankTemplate(response, "staff_template.xlsx", "员工信息", head, dropdownColumns, true, exampleDataList, textColumns);
|
exportBlankTemplate(response, "staff_template.xlsx", "员工信息", head, dropdownColumns, true, exampleDataList, textColumns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出
|
||||||
|
*/
|
||||||
|
@GetMapping("/drviceExport")
|
||||||
|
public void exportUserList(DriverInfoDto query,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<DriverInfoExportVO> list = rescueInfoService.getAll(query);
|
||||||
|
// 输出 Excel
|
||||||
|
ExcelUtils.write(response, "员工数据.xls", "数据", DriverInfoExportVO.class,
|
||||||
|
list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
|
|||||||
import cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto;
|
import cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto;
|
||||||
import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
|
import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
|
||||||
import cn.iocoder.yudao.module.rescue.vo.BuckleVO;
|
import cn.iocoder.yudao.module.rescue.vo.BuckleVO;
|
||||||
|
import cn.iocoder.yudao.module.rescue.vo.DriverInfoExportVO;
|
||||||
import cn.iocoder.yudao.module.rescue.vo.DriverStaffSaveVO;
|
import cn.iocoder.yudao.module.rescue.vo.DriverStaffSaveVO;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
@ -90,4 +91,6 @@ public interface RescueInfoMapper extends BaseMapper<RescueInfo>
|
|||||||
List<Map<String, Object>> selectRescueOrderByRoad(String dictType);
|
List<Map<String, Object>> selectRescueOrderByRoad(String dictType);
|
||||||
|
|
||||||
DriverStaffSaveVO getOnInternal(Long id);
|
DriverStaffSaveVO getOnInternal(Long id);
|
||||||
|
|
||||||
|
List<DriverInfoExportVO> getAll(@Param("entity") DriverInfoDto query);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,10 +6,7 @@ import cn.iocoder.yudao.module.rescue.domain.DriverInfo;
|
|||||||
import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
|
import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
|
||||||
import cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto;
|
import cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto;
|
||||||
import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
|
import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
|
||||||
import cn.iocoder.yudao.module.rescue.vo.BuckleVO;
|
import cn.iocoder.yudao.module.rescue.vo.*;
|
||||||
import cn.iocoder.yudao.module.rescue.vo.DriverStaffSaveVO;
|
|
||||||
import cn.iocoder.yudao.module.rescue.vo.MoneyManagement;
|
|
||||||
import cn.iocoder.yudao.module.rescue.vo.ReturnCarVO;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -175,4 +172,6 @@ public interface IRescueInfoService extends IService<RescueInfo>
|
|||||||
|
|
||||||
|
|
||||||
DriverStaffSaveVO getOnInternal(Long id);
|
DriverStaffSaveVO getOnInternal(Long id);
|
||||||
|
|
||||||
|
List<DriverInfoExportVO> getAll(DriverInfoDto query);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,10 +25,7 @@ import cn.iocoder.yudao.module.rescue.utils.DateUtils;
|
|||||||
import cn.iocoder.yudao.module.rescue.utils.RedisUtil;
|
import cn.iocoder.yudao.module.rescue.utils.RedisUtil;
|
||||||
import cn.iocoder.yudao.module.rescue.utils.RedissonDelayQueue;
|
import cn.iocoder.yudao.module.rescue.utils.RedissonDelayQueue;
|
||||||
import cn.iocoder.yudao.module.rescue.utils.StringUtils;
|
import cn.iocoder.yudao.module.rescue.utils.StringUtils;
|
||||||
import cn.iocoder.yudao.module.rescue.vo.BuckleVO;
|
import cn.iocoder.yudao.module.rescue.vo.*;
|
||||||
import cn.iocoder.yudao.module.rescue.vo.DriverStaffSaveVO;
|
|
||||||
import cn.iocoder.yudao.module.rescue.vo.MoneyManagement;
|
|
||||||
import cn.iocoder.yudao.module.rescue.vo.ReturnCarVO;
|
|
||||||
import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
|
import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
|
||||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
|
import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
|
||||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
@ -1547,6 +1544,10 @@ public class RescueInfoServiceImpl extends ServiceImpl<RescueInfoMapper, RescueI
|
|||||||
return driverStaffSaveVo;
|
return driverStaffSaveVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DriverInfoExportVO> getAll(DriverInfoDto query) {
|
||||||
|
return baseMapper.getAll(query);
|
||||||
|
}
|
||||||
public List<RescueInfo> filterRescueInfoByDate(List<RescueInfo> rescueInfos, Date startTime, Date endTime) {
|
public List<RescueInfo> filterRescueInfoByDate(List<RescueInfo> rescueInfos, Date startTime, Date endTime) {
|
||||||
return rescueInfos.stream()
|
return rescueInfos.stream()
|
||||||
.filter(info -> info.getRescueTime() != null &&
|
.filter(info -> info.getRescueTime() != null &&
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
package cn.iocoder.yudao.module.rescue.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DriverInfoExportVO {
|
||||||
|
|
||||||
|
@ExcelProperty("员工账号")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@ExcelProperty("员工姓名")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@ExcelProperty("手机号")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ExcelIgnore
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
@ExcelProperty("性别")
|
||||||
|
private String sexStr;
|
||||||
|
|
||||||
|
@ExcelProperty("岗位")
|
||||||
|
private String roleNames;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setSex(String sex) {
|
||||||
|
this.sex = sex;
|
||||||
|
// 设置转换后的性别字符串
|
||||||
|
if ("0".equals(sex)) {
|
||||||
|
this.sexStr = "男";
|
||||||
|
} else if ("1".equals(sex)) {
|
||||||
|
this.sexStr = "女";
|
||||||
|
} else {
|
||||||
|
this.sexStr = "未知";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,13 +6,13 @@
|
|||||||
<select id="selectRescueInfoList" parameterType="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">
|
resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||||
SELECT ri.*,
|
SELECT ri.*,
|
||||||
roi.order_status,
|
roi.order_status,
|
||||||
roi.set_money
|
roi.set_money
|
||||||
FROM rescue_info ri
|
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>
|
<where>
|
||||||
1 = 1
|
1 = 1
|
||||||
and ri.deleted = '0'
|
and ri.deleted = '0'
|
||||||
<if test="map.rescueStatus != null">
|
<if test="map.rescueStatus != null">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="map.rescueStatus == '1'.toString()">
|
<when test="map.rescueStatus == '1'.toString()">
|
||||||
@ -49,9 +49,10 @@
|
|||||||
and ri.license_num like concat('%', #{map.licenseNum}, '%')
|
and ri.license_num like concat('%', #{map.licenseNum}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="map.deptList != null and map.deptList.size()>0">
|
<if test="map.deptList != null and map.deptList.size()>0">
|
||||||
and ri.dept_id in <foreach collection="map.deptList" separator="," item="item" open="(" close=")">
|
and ri.dept_id in
|
||||||
#{item}
|
<foreach collection="map.deptList" separator="," item="item" open="(" close=")">
|
||||||
</foreach>
|
#{item}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by ri.create_time desc
|
order by ri.create_time desc
|
||||||
@ -59,13 +60,13 @@
|
|||||||
|
|
||||||
<select id="selectRescueListSystem2" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
<select id="selectRescueListSystem2" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||||
SELECT ri.*,
|
SELECT ri.*,
|
||||||
roi.order_status,
|
roi.order_status,
|
||||||
roi.set_money,
|
roi.set_money,
|
||||||
roi.id as rescueOrderId,
|
roi.id as rescueOrderId,
|
||||||
roi.pay_money,
|
roi.pay_money,
|
||||||
roi.pay_time
|
roi.pay_time
|
||||||
FROM rescue_info ri
|
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.deleted = '0'
|
where ri.deleted = '0'
|
||||||
<if test="map.orderStatus != null and map.orderStatus != ''">
|
<if test="map.orderStatus != null and map.orderStatus != ''">
|
||||||
and roi.order_status = #{map.orderStatus}
|
and roi.order_status = #{map.orderStatus}
|
||||||
@ -96,7 +97,7 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="map.rescueStart != null and map.rescueEnd != null">
|
<if test="map.rescueStart != null and map.rescueEnd != null">
|
||||||
and rescue_time between
|
and rescue_time between
|
||||||
concat(#{map.rescueStart}, ' 00:00:00') and concat(#{map.rescueEnd}, ' 23:59:59')
|
concat(#{map.rescueStart}, ' 00:00:00') and concat(#{map.rescueEnd}, ' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
<if test="map.deptId != null">
|
<if test="map.deptId != null">
|
||||||
and if(#{map.deptId} = 0, ri.dept_id is null, ri.dept_id = #{map.deptId})
|
and if(#{map.deptId} = 0, ri.dept_id is null, ri.dept_id = #{map.deptId})
|
||||||
@ -107,15 +108,15 @@
|
|||||||
|
|
||||||
<select id="listData" resultType="com.alibaba.fastjson.JSONObject">
|
<select id="listData" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
SELECT sum(set_money / 100) as allMoney,
|
SELECT sum(set_money / 100) as allMoney,
|
||||||
count(1) as allNum,
|
count(1) as allNum,
|
||||||
sum(case
|
sum(case
|
||||||
when ri.car_type = '1' then (set_money / 100) *
|
when ri.car_type = '1' then (set_money / 100) *
|
||||||
${rescueTcBig}
|
${rescueTcBig}
|
||||||
when ri.car_type = '2' then (set_money / 100) * ${rescueTcMid}
|
when ri.car_type = '2' then (set_money / 100) * ${rescueTcMid}
|
||||||
when ri.car_type = '3' then (set_money / 100) * ${rescueTcSmall}
|
when ri.car_type = '3' then (set_money / 100) * ${rescueTcSmall}
|
||||||
else 0 end) as tcAll
|
else 0 end) as tcAll
|
||||||
FROM rescue_info ri
|
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>
|
<where>
|
||||||
<if test="driverName != null">
|
<if test="driverName != null">
|
||||||
and ri.driver_name like concat('%', #{driverName}, '%')
|
and ri.driver_name like concat('%', #{driverName}, '%')
|
||||||
@ -135,10 +136,10 @@
|
|||||||
<select id="selectRescueInfoListApp" parameterType="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">
|
resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||||
SELECT ri.*,
|
SELECT ri.*,
|
||||||
roi.order_status,
|
roi.order_status,
|
||||||
roi.set_money
|
roi.set_money
|
||||||
FROM rescue_info ri
|
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>
|
<where>
|
||||||
(ri.user_id = #{map.userId} or connection_phone = #{map.connectionPhone})
|
(ri.user_id = #{map.userId} or connection_phone = #{map.connectionPhone})
|
||||||
<if test="map.rescueStatus != null">
|
<if test="map.rescueStatus != null">
|
||||||
@ -223,12 +224,12 @@
|
|||||||
from rescue_info ri
|
from rescue_info ri
|
||||||
<where>
|
<where>
|
||||||
dept_id = #{map.deptId}
|
dept_id = #{map.deptId}
|
||||||
and rescue_type = '5'
|
and rescue_type = '5'
|
||||||
<if test="map.connectionName != null and map.connectionName != ''">
|
<if test="map.connectionName != null and map.connectionName != ''">
|
||||||
and (connection_name like concat('%', #{map.connectionName}, '%') or connection_phone like concat('%',
|
and (connection_name like concat('%', #{map.connectionName}, '%') or connection_phone like concat('%',
|
||||||
#{map.connectionPhone},
|
#{map.connectionPhone},
|
||||||
'%') or
|
'%') or
|
||||||
license_num like concat('%', #{map.licenseNum}, '%'))
|
license_num like concat('%', #{map.licenseNum}, '%'))
|
||||||
</if>
|
</if>
|
||||||
<if test="map.rescueStatus != null">
|
<if test="map.rescueStatus != null">
|
||||||
<choose>
|
<choose>
|
||||||
@ -247,15 +248,15 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="driverList" resultType="cn.iocoder.yudao.module.rescue.domain.DriverInfo">
|
<select id="driverList" resultType="cn.iocoder.yudao.module.rescue.domain.DriverInfo">
|
||||||
SELECT su.id AS userId,
|
SELECT su.id AS userId,
|
||||||
su.nickname AS nickName,
|
su.nickname AS nickName,
|
||||||
su.mobile AS phonenumber,
|
su.mobile AS phonenumber,
|
||||||
su.sex as sex,
|
su.sex as sex,
|
||||||
su.avatar as avatar,
|
su.avatar as avatar,
|
||||||
di.*
|
di.*
|
||||||
FROM driver_info di
|
FROM driver_info di
|
||||||
INNER JOIN system_users su ON di.user_id = su.id
|
INNER JOIN system_users su ON di.user_id = su.id
|
||||||
AND su.deleted = '0'
|
AND su.deleted = '0'
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
<if test="map.nickName != null and map.nickName != ''">
|
<if test="map.nickName != null and map.nickName != ''">
|
||||||
and su.nickname like concat('%', #{map.nickName}, '%')
|
and su.nickname like concat('%', #{map.nickName}, '%')
|
||||||
@ -280,17 +281,17 @@
|
|||||||
|
|
||||||
<select id="driverListApp" resultType="cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto">
|
<select id="driverListApp" resultType="cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto">
|
||||||
SELECT di.*,
|
SELECT di.*,
|
||||||
su.nickname as real_name,
|
su.nickname as real_name,
|
||||||
rci.rescue_car_num
|
rci.rescue_car_num
|
||||||
FROM driver_info di
|
FROM driver_info di
|
||||||
INNER JOIN system_users su ON di.user_id = su.id AND su.deleted = '0'
|
INNER JOIN system_users su ON di.user_id = su.id AND su.deleted = '0'
|
||||||
left join system_dept sd on sd.id = di.dept_id
|
left join system_dept sd on sd.id = di.dept_id
|
||||||
inner join rescue_car_info rci on rci.possessor_id = di.id
|
inner join rescue_car_info rci on rci.possessor_id = di.id
|
||||||
WHERE di.auth_status = '2'
|
WHERE di.auth_status = '2'
|
||||||
<if test="searchValue != null and searchValue != ''">
|
<if test="searchValue != null and searchValue != ''">
|
||||||
and (su.nickname like concat('%', #{searchValue}, '%') or
|
and (su.nickname like concat('%', #{searchValue}, '%') or
|
||||||
di.phonenumber like concat('%', #{searchValue}, '%')
|
di.phonenumber like concat('%', #{searchValue}, '%')
|
||||||
or rci.rescue_car_num like concat('%', #{searchValue}, '%'))
|
or rci.rescue_car_num like concat('%', #{searchValue}, '%'))
|
||||||
</if>
|
</if>
|
||||||
order by di.create_time desc
|
order by di.create_time desc
|
||||||
</select>
|
</select>
|
||||||
@ -312,8 +313,8 @@
|
|||||||
WHERE need_system = '0'
|
WHERE need_system = '0'
|
||||||
AND driver_id IS NULL
|
AND driver_id IS NULL
|
||||||
AND TIMESTAMPDIFF(
|
AND TIMESTAMPDIFF(
|
||||||
MINUTE, rescue_time,
|
MINUTE, rescue_time,
|
||||||
NOW()) > 5
|
NOW()) > 5
|
||||||
AND rescue_status = '2'
|
AND rescue_status = '2'
|
||||||
</update>
|
</update>
|
||||||
<select id="getOverTimeRescue" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
<select id="getOverTimeRescue" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||||
@ -325,15 +326,15 @@
|
|||||||
AND ri.rescue_status = '2'
|
AND ri.rescue_status = '2'
|
||||||
GROUP BY ri.id
|
GROUP BY ri.id
|
||||||
HAVING TIMESTAMPDIFF(
|
HAVING TIMESTAMPDIFF(
|
||||||
MINUTE, MAX(rdi.create_time),
|
MINUTE, MAX(rdi.create_time),
|
||||||
NOW()) <![CDATA[>]]> 3
|
NOW()) <![CDATA[>]]> 3
|
||||||
</select>
|
</select>
|
||||||
<select id="getRescueStatistics" resultType="java.util.Map">
|
<select id="getRescueStatistics" resultType="java.util.Map">
|
||||||
SELECT IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3'), 0) as jyzNum,
|
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(roi.order_status = '1'), 0) as dzfNum,
|
||||||
IFNULL(sum(ri.rescue_status = '6'), 0) as dqcNum,
|
IFNULL(sum(ri.rescue_status = '6'), 0) as dqcNum,
|
||||||
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5'), 0) as ywcNum,
|
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5'), 0) as ywcNum,
|
||||||
IFNULL(sum(ri.is_wei_xiu = '1'), 0) as zwxNum
|
IFNULL(sum(ri.is_wei_xiu = '1'), 0) as zwxNum
|
||||||
FROM rescue_info ri
|
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}
|
where ri.user_id = #{userId}
|
||||||
@ -341,17 +342,18 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="getRescueStatisticsByAdmin" resultType="java.util.Map">
|
<select id="getRescueStatisticsByAdmin" resultType="java.util.Map">
|
||||||
SELECT IFNULL(sum(ri.rescue_status = '2' or ri.rescue_status = '3'), 0) as jyzNum,
|
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(roi.order_status = '1'), 0) as dzfNum,
|
||||||
IFNULL(sum(ri.rescue_status = '6'), 0) as dqcNum,
|
IFNULL(sum(ri.rescue_status = '6'), 0) as dqcNum,
|
||||||
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5'), 0) as ywcNum,
|
IFNULL(sum(ri.rescue_status <![CDATA[>=]]> '5'), 0) as ywcNum,
|
||||||
IFNULL(sum(ri.is_wei_xiu = '1'), 0) as zwxNum
|
IFNULL(sum(ri.is_wei_xiu = '1'), 0) as zwxNum
|
||||||
FROM rescue_info ri
|
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
|
where 1 = 1
|
||||||
<if test="map.deptList != null and map.deptList.size()>0">
|
<if test="map.deptList != null and map.deptList.size()>0">
|
||||||
and ri.dept_id in <foreach collection="map.deptList" separator="," item="item" open="(" close=")">
|
and ri.dept_id in
|
||||||
#{item}
|
<foreach collection="map.deptList" separator="," item="item" open="(" close=")">
|
||||||
</foreach>
|
#{item}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<delete id="deleteOtherInfo1">
|
<delete id="deleteOtherInfo1">
|
||||||
@ -378,17 +380,17 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="getRescueInfoByDriver" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
<select id="getRescueInfoByDriver" resultType="cn.iocoder.yudao.module.rescue.domain.RescueInfo">
|
||||||
SELECT ri.*,
|
SELECT ri.*,
|
||||||
roi.order_status,
|
roi.order_status,
|
||||||
roi.set_money,
|
roi.set_money,
|
||||||
roi.id as rescueOrderId,
|
roi.id as rescueOrderId,
|
||||||
roi.pay_money,
|
roi.pay_money,
|
||||||
roi.pay_time
|
roi.pay_time
|
||||||
FROM rescue_info ri
|
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 driver_id is not null
|
where driver_id is not null
|
||||||
<if test="map.rescueStart != null and map.rescueEnd != null">
|
<if test="map.rescueStart != null and map.rescueEnd != null">
|
||||||
and rescue_time between concat(#{map.rescueStart}, ' 00:00:00')
|
and rescue_time between concat(#{map.rescueStart}, ' 00:00:00')
|
||||||
and concat(#{map.rescueEnd}, ' 23:59:59')
|
and concat(#{map.rescueEnd}, ' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
<if test="map.licenseNum != null">
|
<if test="map.licenseNum != null">
|
||||||
and ri.license_num like concat('%', #{map.licenseNum}, '%')
|
and ri.license_num like concat('%', #{map.licenseNum}, '%')
|
||||||
@ -401,7 +403,7 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="map.rescueStart != null and map.rescueEnd != null">
|
<if test="map.rescueStart != null and map.rescueEnd != null">
|
||||||
and rescue_time between concat(#{map.rescueStart}, ' 00:00:00')
|
and rescue_time between concat(#{map.rescueStart}, ' 00:00:00')
|
||||||
and concat(#{map.rescueEnd}, ' 23:59:59')
|
and concat(#{map.rescueEnd}, ' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="map.driverName != null">
|
<if test="map.driverName != null">
|
||||||
@ -442,53 +444,55 @@
|
|||||||
ORDER BY sd.id desc
|
ORDER BY sd.id desc
|
||||||
</select>
|
</select>
|
||||||
<select id="selectManageAnalyze" resultType="java.util.Map">
|
<select id="selectManageAnalyze" resultType="java.util.Map">
|
||||||
WITH rescue_types AS (
|
WITH rescue_types AS (SELECT '1' AS rescue_type, '拖车' AS rescue_type_desc
|
||||||
SELECT '1' AS rescue_type, '拖车' AS rescue_type_desc
|
UNION ALL
|
||||||
UNION ALL SELECT '2', '送油'
|
SELECT '2', '送油'
|
||||||
UNION ALL SELECT '3', '搭电'
|
UNION ALL
|
||||||
UNION ALL SELECT '4', '换台'
|
SELECT '3', '搭电'
|
||||||
UNION ALL SELECT '5', '扣车'
|
UNION ALL
|
||||||
)
|
SELECT '4', '换台'
|
||||||
SELECT
|
UNION ALL
|
||||||
rt.rescue_type_desc AS rescueType,
|
SELECT '5', '扣车')
|
||||||
COUNT(ri.rescue_type) AS typeCount,
|
SELECT rt.rescue_type_desc AS rescueType,
|
||||||
ROUND((COUNT(ri.rescue_type) * 100.0 / NULLIF((SELECT COUNT(*) FROM rescue_info WHERE deleted = b'0' AND rescue_time BETWEEN #{startTime} AND #{endTime} AND tenant_id = #{tenantId}), 0)), 2) AS percentage
|
COUNT(ri.rescue_type) AS typeCount,
|
||||||
FROM
|
ROUND((COUNT(ri.rescue_type) * 100.0 / NULLIF((SELECT COUNT(*)
|
||||||
rescue_types rt
|
FROM rescue_info
|
||||||
LEFT JOIN
|
WHERE deleted = b'0'
|
||||||
rescue_info ri ON rt.rescue_type = ri.rescue_type
|
AND rescue_time BETWEEN #{startTime} AND #{endTime}
|
||||||
AND ri.rescue_time BETWEEN #{startTime} AND #{endTime}
|
AND tenant_id = #{tenantId}), 0)), 2) AS percentage
|
||||||
AND ri.tenant_id = #{tenantId}
|
FROM rescue_types rt
|
||||||
GROUP BY
|
LEFT JOIN
|
||||||
rt.rescue_type_desc
|
rescue_info ri ON rt.rescue_type = ri.rescue_type
|
||||||
ORDER BY
|
AND ri.rescue_time BETWEEN #{startTime} AND #{endTime}
|
||||||
rt.rescue_type;
|
AND ri.tenant_id = #{tenantId}
|
||||||
|
GROUP BY rt.rescue_type_desc
|
||||||
|
ORDER BY rt.rescue_type;
|
||||||
</select>
|
</select>
|
||||||
<select id="selectDriverSort" resultType="java.util.Map">
|
<select id="selectDriverSort" resultType="java.util.Map">
|
||||||
SELECT
|
SELECT ROW_NUMBER() OVER (ORDER BY COALESCE(SUM(roi.pay_money), 0) DESC) AS sort, su.nickname,
|
||||||
ROW_NUMBER() OVER (ORDER BY COALESCE(SUM(roi.pay_money), 0) DESC) AS sort,
|
COALESCE(SUM(roi.set_money), 0) AS money,
|
||||||
su.nickname,
|
COALESCE(COUNT(roi.id), 0) AS count
|
||||||
COALESCE(SUM(roi.set_money), 0) AS money,
|
|
||||||
COALESCE(COUNT(roi.id), 0) AS count
|
|
||||||
FROM
|
FROM
|
||||||
driver_info di
|
driver_info di
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
system_users su ON di.user_id = su.id
|
system_users su
|
||||||
LEFT JOIN
|
ON di.user_id = su.id
|
||||||
|
LEFT JOIN
|
||||||
rescue_info ri ON di.id = ri.driver_id
|
rescue_info ri ON di.id = ri.driver_id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
rescue_order_info roi ON ri.id = roi.rescue_info_id
|
rescue_order_info roi ON ri.id = roi.rescue_info_id
|
||||||
WHERE roi.pay_time BETWEEN #{startTime} AND #{endTime}
|
WHERE roi.pay_time BETWEEN #{startTime}
|
||||||
|
AND #{endTime}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
su.nickname,
|
su.nickname,
|
||||||
di.id
|
di.id
|
||||||
ORDER BY
|
ORDER BY
|
||||||
COALESCE(SUM(roi.set_money), 0) DESC;
|
COALESCE (SUM (roi.set_money), 0) DESC;
|
||||||
</select>
|
</select>
|
||||||
<select id="selectRescueOrderByRoad" resultType="java.util.Map">
|
<select id="selectRescueOrderByRoad" resultType="java.util.Map">
|
||||||
select
|
select COALESCE((select value from system_dict_data where dict_type = #{dictType} and id = ri.section_road),
|
||||||
COALESCE((select value from system_dict_data where dict_type = #{dictType} and id = ri.section_road),'其他') name,
|
'其他') name,
|
||||||
count(1) as count
|
count(1) as count
|
||||||
from rescue_info ri
|
from rescue_info ri
|
||||||
group by name;
|
group by name;
|
||||||
</select>
|
</select>
|
||||||
@ -520,5 +524,27 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getAll" resultType="cn.iocoder.yudao.module.rescue.vo.DriverInfoExportVO">
|
||||||
|
SELECT su.username,
|
||||||
|
su.nickname,
|
||||||
|
su.mobile,
|
||||||
|
su.sex,
|
||||||
|
GROUP_CONCAT(DISTINCT sr2.name SEPARATOR ',') AS roleNames
|
||||||
|
FROM driver_info di
|
||||||
|
INNER JOIN system_users su ON di.user_id = su.id AND su.deleted = 0
|
||||||
|
LEFT JOIN system_user_role sr ON su.id = sr.user_id AND sr.deleted = 0
|
||||||
|
INNER JOIN system_role role ON role.id = sr.role_id AND role.deleted = 0 AND role.code = 'jysj'
|
||||||
|
LEFT JOIN system_role sr2 ON sr.role_id = sr2.id AND sr2.service_package_id = 'jiuyuan'
|
||||||
|
<if test="entity.status != null">
|
||||||
|
AND su.status = #{entity.status}
|
||||||
|
</if>
|
||||||
|
<if test="entity.nickname != null">
|
||||||
|
AND (su.nickname like CONCAT('%',#{entity.nickname},'%') OR su.username like
|
||||||
|
CONCAT('%',#{entity.nickname},'%'))
|
||||||
|
</if>
|
||||||
|
GROUP BY su.username, su.nickname, su.mobile, su.sex
|
||||||
|
ORDER BY su.nickname
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -104,6 +104,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="role.nickname != null">
|
<if test="role.nickname != null">
|
||||||
AND (su.nickname like CONCAT('%',#{role.nickname},'%') OR su.username like CONCAT('%',#{role.nickname},'%'))
|
AND (su.nickname like CONCAT('%',#{role.nickname},'%') OR su.username like CONCAT('%',#{role.nickname},'%'))
|
||||||
</if>
|
</if>
|
||||||
|
<if test="role.status != null">
|
||||||
|
AND su.status = #{role.status}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
su.id, su.username, su.nickname, su.user_type, su.remark,
|
su.id, su.username, su.nickname, su.user_type, su.remark,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user