0706
This commit is contained in:
parent
6e23907460
commit
26fbc39043
@ -5,15 +5,11 @@ import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCoach;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCoachService;
|
||||
import cn.iocoder.yudao.module.base.vo.*;
|
||||
import cn.iocoder.yudao.module.base.vo.BusinessRecordExportVO;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionStaffSaveVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.StaffImportExcelVO;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -26,7 +22,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@ -82,6 +77,12 @@ public class DlDriveSchoolCoachController {
|
||||
return success(dlDriveSchoolCoachService.listSchoolCoach(pageReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/businessList")
|
||||
@Operation(summary = "不分页获取业务经理信息")
|
||||
public CommonResult<List<?>> listSchoolBusiness(DlDriveSchoolCoachPageReqVO pageReqVO) {
|
||||
return success(dlDriveSchoolCoachService.listSchoolBusiness(pageReqVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 不分页获取驾校人员信息
|
||||
*
|
||||
@ -310,4 +311,56 @@ public class DlDriveSchoolCoachController {
|
||||
return success(dlDriveSchoolCoachService.getBusinessManagerMoney(reqVO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据列表
|
||||
*/
|
||||
@GetMapping("/getBusinessRecordExportData")
|
||||
public CommonResult<IPage<BusinessRecordExportVO>> getOrderExportData(BusinessRecordExportVO exportVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<BusinessRecordExportVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(dlDriveSchoolCoachService.getBusinessRecordExportData(exportVO, page));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
* @param exportVO
|
||||
* @param response
|
||||
* @throws IOException
|
||||
*/
|
||||
@GetMapping("/businessRecordExport")
|
||||
public void exportCommission(BusinessRecordExportVO exportVO, HttpServletResponse response) throws IOException {
|
||||
// 校验导出类型
|
||||
if (exportVO.getExportType() == null || !Arrays.asList("current", "all", "range").contains(exportVO.getExportType())) {
|
||||
throw new IllegalArgumentException("无效的导出类型: " + exportVO.getExportType());
|
||||
}
|
||||
|
||||
// 根据不同类型查询数据
|
||||
List<BusinessRecordExportVO> exportData;
|
||||
String fileName = "学员记录";
|
||||
|
||||
switch (exportVO.getExportType()) {
|
||||
case "current":
|
||||
exportData = dlDriveSchoolCoachService.getBusinessRecordList(exportVO);
|
||||
fileName += "_第" + exportVO.getPageNo() + "页";
|
||||
break;
|
||||
case "all":
|
||||
exportData = dlDriveSchoolCoachService.getAllBusinessRecordList(exportVO);
|
||||
fileName += "_全部数据";
|
||||
break;
|
||||
case "range":
|
||||
exportData = dlDriveSchoolCoachService.getBusinessRecordListByRange(exportVO);
|
||||
fileName += "_" + exportVO.getStartPage() + "-" + exportVO.getEndPage() + "页";
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("无效的导出类型: " + exportVO.getExportType());
|
||||
}
|
||||
|
||||
|
||||
// 导出Excel
|
||||
ExcelUtils.write(response, fileName + ".xlsx", "业务经理招生记录", BusinessRecordExportVO.class, exportData);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
package cn.iocoder.yudao.module.base.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCoach;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||
import cn.iocoder.yudao.module.base.vo.*;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionStaffSaveVo;
|
||||
import cn.iocoder.yudao.module.base.vo.BusinessRecordExportVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -53,4 +52,6 @@ public interface DlDriveSchoolCoachMapper extends BaseMapper<DlDriveSchoolCoach>
|
||||
|
||||
IPage<BusinessRecordVO> getBusinessManager(@Param("entity") BusinessRecordReqVO reqVO, Page<BusinessRecordReqVO> page);
|
||||
List<BusinessRecordVO> getBusinessManagerMoney(@Param("entity") BusinessRecordReqVO reqVO);
|
||||
|
||||
IPage<BusinessRecordExportVO> getBusinessRecordExportData(@Param("entity") BusinessRecordExportVO exportVO, Page<BusinessRecordExportVO> page);
|
||||
}
|
||||
|
@ -1,15 +1,12 @@
|
||||
package cn.iocoder.yudao.module.base.service;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCoach;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||
import cn.iocoder.yudao.module.base.vo.*;
|
||||
import cn.iocoder.yudao.module.base.vo.BusinessRecordExportVO;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionStaffSaveVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.StaffImportExcelVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
@ -43,6 +40,7 @@ public interface DlDriveSchoolCoachService extends IService<DlDriveSchoolCoach>
|
||||
* @date 14:26 2025/2/7
|
||||
**/
|
||||
List<DlDriveSchoolCoach> listSchoolCoach(DlDriveSchoolCoachPageReqVO pageReqVO);
|
||||
List<DlDriveSchoolCoach> listSchoolBusiness(DlDriveSchoolCoachPageReqVO pageReqVO);
|
||||
List<DlDriveSchoolCoach> listSchoolCoachApp(DlDriveSchoolCoachPageReqVO pageReqVO);
|
||||
List<DlDriveSchoolCoach> listSchoolPeople(DlDriveSchoolCoachPageReqVO pageReqVO);
|
||||
|
||||
@ -160,5 +158,18 @@ public interface DlDriveSchoolCoachService extends IService<DlDriveSchoolCoach>
|
||||
List<SchoolCommissionVO> getBusinessManagerMoney(BusinessRecordReqVO reqVO);
|
||||
BigDecimal getBusinessManagerMoneyTotal(BusinessRecordReqVO reqVO) ;
|
||||
|
||||
/**
|
||||
* 获取导出数据列表
|
||||
*/
|
||||
IPage<BusinessRecordExportVO> getBusinessRecordExportData(BusinessRecordExportVO reqVO, Page<BusinessRecordExportVO> page);
|
||||
/**
|
||||
* 导出的三种形式
|
||||
* @param exportVO
|
||||
* @return
|
||||
*/
|
||||
List<BusinessRecordExportVO> getBusinessRecordList(BusinessRecordExportVO exportVO);
|
||||
List<BusinessRecordExportVO> getAllBusinessRecordList(BusinessRecordExportVO exportVO);
|
||||
List<BusinessRecordExportVO> getBusinessRecordListByRange(BusinessRecordExportVO exportVO);
|
||||
|
||||
|
||||
}
|
||||
|
@ -11,9 +11,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCoach;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||
import cn.iocoder.yudao.module.base.mapper.DlDriveSchoolCoachMapper;
|
||||
import cn.iocoder.yudao.module.base.mapper.DlDriveSchoolStudentMapper;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCoachService;
|
||||
@ -23,17 +21,14 @@ import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
||||
import cn.iocoder.yudao.module.course.mapper.SchoolCommissionMapper;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCourseSchemeService;
|
||||
import cn.iocoder.yudao.module.base.vo.BusinessRecordExportVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessVO;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
||||
import cn.iocoder.yudao.module.exam.mapper.ExamBatchItemMapper;
|
||||
import cn.iocoder.yudao.module.exam.vo.ExamBatchItemVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
||||
import cn.iocoder.yudao.module.inspection.vo.ImportStaffVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionStaffSaveVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.StaffImportExcelVO;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolCar;
|
||||
import cn.iocoder.yudao.module.jx.service.IDriveSchoolCarService;
|
||||
import cn.iocoder.yudao.module.jx.utils.StringUtils;
|
||||
@ -156,6 +151,16 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
||||
return list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DlDriveSchoolCoach> listSchoolBusiness(DlDriveSchoolCoachPageReqVO pageReqVO) {
|
||||
LambdaQueryWrapper<DlDriveSchoolCoach> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(BaseDO::getDeleted, 0).eq(DlDriveSchoolCoach::getType, "ywjl");
|
||||
if (StringUtils.isNotEmpty(pageReqVO.getName())) {
|
||||
lambdaQueryWrapper.like(DlDriveSchoolCoach::getName, pageReqVO.getName());
|
||||
}
|
||||
return list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DlDriveSchoolCoach> listSchoolCoachApp(DlDriveSchoolCoachPageReqVO pageReqVO) {
|
||||
LambdaQueryWrapper<DlDriveSchoolCoach> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@ -1203,4 +1208,58 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<BusinessRecordExportVO> getBusinessRecordExportData(BusinessRecordExportVO exportVO, Page<BusinessRecordExportVO> page) {
|
||||
IPage<BusinessRecordExportVO> businessManager = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
||||
List<BusinessRecordExportVO> records = businessManager.getRecords();
|
||||
for (BusinessRecordExportVO record : records) {
|
||||
BigDecimal deduct = BigDecimal.ZERO;
|
||||
if(record.getScheme() != null){
|
||||
deduct = schemeService.getSchemeById(record.getScheme(), 0);
|
||||
}else{
|
||||
deduct = schemeService.getCourseDeduct(record.getCourseId(), 0);
|
||||
}
|
||||
record.setSubsidy(deduct);
|
||||
}
|
||||
businessManager.setRecords(records);
|
||||
return businessManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出的三种形式
|
||||
*/
|
||||
@Override
|
||||
public List<BusinessRecordExportVO> getBusinessRecordList(BusinessRecordExportVO exportVO) {
|
||||
// 分页查询当前页
|
||||
Page<BusinessRecordExportVO> page = new Page<>(exportVO.getPageNo(), exportVO.getPageSize());
|
||||
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
||||
return result.getRecords();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusinessRecordExportVO> getAllBusinessRecordList(BusinessRecordExportVO exportVO) {
|
||||
// 不分页查询全部数据
|
||||
Page<BusinessRecordExportVO> page = new Page<>(1, Integer.MAX_VALUE);
|
||||
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
||||
return result.getRecords();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusinessRecordExportVO> getBusinessRecordListByRange(BusinessRecordExportVO exportVO) {
|
||||
List<BusinessRecordExportVO> allData = new ArrayList<>();
|
||||
|
||||
// 循环查询指定范围内的数据
|
||||
for (int i = exportVO.getStartPage(); i <= exportVO.getEndPage(); i++) {
|
||||
Page<BusinessRecordExportVO> page = new Page<>(i, exportVO.getPageSize());
|
||||
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
||||
allData.addAll(result.getRecords());
|
||||
|
||||
if (i >= result.getPages()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return allData;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,159 @@
|
||||
package cn.iocoder.yudao.module.base.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class BusinessRecordExportVO {
|
||||
|
||||
@ExcelIgnore
|
||||
private Long coachId;
|
||||
|
||||
@ExcelProperty(value = "业务经理姓名", index = 0)
|
||||
private String businessName;
|
||||
|
||||
@ExcelProperty(value = "报名时间", index = 1)
|
||||
private String createTimeStr;
|
||||
|
||||
@ExcelProperty(value = "学员姓名", index = 2)
|
||||
private String name;
|
||||
|
||||
@ExcelProperty(value = "手机号", index = 3)
|
||||
private String phone;
|
||||
|
||||
@ExcelProperty(value = "学员身份证号", index = 4)
|
||||
private String idCard;
|
||||
|
||||
@ExcelProperty(value = "学员年龄", index = 5)
|
||||
private String age;
|
||||
|
||||
@ExcelProperty(value = "学员性别", index = 6)
|
||||
private String sexStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private String sex;
|
||||
|
||||
@ExcelProperty(value = "来源", index = 7)
|
||||
private String channel;
|
||||
|
||||
@ExcelProperty(value = "是否面签", index = 8)
|
||||
private String isSignStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private Integer isSign;
|
||||
|
||||
@ExcelProperty(value = "面签时间", index = 9)
|
||||
private String signTimeStr;
|
||||
|
||||
@ExcelProperty(value = "课程名称", index = 10)
|
||||
private String courseName;
|
||||
|
||||
@ExcelProperty(value = "课程类型", index = 11)
|
||||
private String courseType;
|
||||
|
||||
@ExcelProperty(value = "所选教练", index = 12)
|
||||
private String coachUserName;
|
||||
|
||||
@ExcelProperty(value = "支付金额", index = 13)
|
||||
private BigDecimal reserveMoney;
|
||||
|
||||
@ExcelProperty(value = "尾款金额", index = 14)
|
||||
private BigDecimal restMoney;
|
||||
|
||||
@ExcelIgnore
|
||||
private String paymentStatus;
|
||||
|
||||
@ExcelProperty(value = "订单状态", index = 15)
|
||||
private String paymentStatusStr;
|
||||
|
||||
@ExcelProperty(value = "支付方式", index = 16)
|
||||
private String payTypeStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private String payType;
|
||||
|
||||
@ExcelProperty(value = "业务经理手机号", index = 17)
|
||||
private String businessPhone;
|
||||
|
||||
@ExcelProperty(value = "补贴金额", index = 18)
|
||||
private BigDecimal subsidy;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
private String scheme;
|
||||
|
||||
@ExcelIgnore
|
||||
private String courseId;
|
||||
|
||||
@ExcelIgnore
|
||||
private String startTimeStr;
|
||||
@ExcelIgnore
|
||||
private String endTimeStr;
|
||||
|
||||
// 分页参数
|
||||
@ExcelIgnore
|
||||
private Integer pageNo = 1;
|
||||
@ExcelIgnore
|
||||
private Integer pageSize = 10;
|
||||
|
||||
// 导出类型:all(全部)、current(当前页)、range(自定义范围)
|
||||
@ExcelIgnore
|
||||
private String exportType;
|
||||
|
||||
// 自定义范围参数
|
||||
@ExcelIgnore
|
||||
private Integer startPage;
|
||||
@ExcelIgnore
|
||||
private Integer endPage;
|
||||
|
||||
|
||||
public String getSexStr() {
|
||||
if ("0".equals(sex)) return "男";
|
||||
if ("1".equals(sex)) return "女";
|
||||
return "未知";
|
||||
}
|
||||
|
||||
public String getPayTypeStr() {
|
||||
if ("1".equals(payType)) return "定金";
|
||||
if ("2".equals(payType)) return "全款";
|
||||
return "未知";
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
if (createTime != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
this.createTimeStr = sdf.format(createTime);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSignTime(Date signTime) {
|
||||
if (signTime != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
this.signTimeStr = sdf.format(signTime);
|
||||
}
|
||||
}
|
||||
|
||||
public String getIsSignStr() {
|
||||
return isSign != null && isSign == 1 ? "是" : "否";
|
||||
}
|
||||
|
||||
public String getPaymentStatusStr() {
|
||||
switch (paymentStatus) {
|
||||
case "0": return "待支付";
|
||||
case "1": return "已取消";
|
||||
case "2": return "已支付";
|
||||
case "3": return "待面签";
|
||||
case "4": return "已面签";
|
||||
case "5": return "已完成";
|
||||
case "6": return "申请退款";
|
||||
case "7": return "退款中";
|
||||
case "8": return "退款成功";
|
||||
default: return "暂无数据";
|
||||
}
|
||||
}
|
||||
}
|
@ -144,22 +144,18 @@
|
||||
dsco.if_end,
|
||||
dsc.name AS businessName,
|
||||
dsc.phone AS businessPhone,
|
||||
dsco.create_time
|
||||
from drive_school_student dss
|
||||
LEFT JOIN drive_school_course_order dsco ON dss.user_id = dsco.user_id
|
||||
<if test="entity.startTimeStr != null and entity.startTimeStr != ''">
|
||||
AND dsco.create_time >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr != null and entity.endTimeStr != ''">
|
||||
AND dsco.create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
LEFT JOIN drive_school_coach dsc ON dss.source_user_id = dsc.user_id
|
||||
dsco.create_time,
|
||||
dsco.sign_time,
|
||||
dsco.course_id,
|
||||
dsco.scheme_id AS scheme
|
||||
from drive_school_course_order dsco
|
||||
LEFT JOIN drive_school_student dss ON dss.user_id = dsco.user_id AND dss.deleted = 0
|
||||
LEFT JOIN drive_school_coach dsc ON dss.source_user_id = dsc.user_id AND dsc.deleted = 0
|
||||
<where>
|
||||
dss.source = '04'
|
||||
AND dsc.type = 'ywjl'
|
||||
AND dss.deleted = 0
|
||||
AND dsco.deleted = 0
|
||||
AND dsc.deleted = 0
|
||||
dss.source = '04' AND dsco.deleted = 0 AND dsc.type = 'ywjl'
|
||||
<if test="entity.coachId != null ">
|
||||
AND dss.source_user_id = #{entity.coachId}
|
||||
</if>
|
||||
<if test="entity.businessName != null and entity.businessName != ''">
|
||||
AND dsc.name LIKE CONCAT('%', #{entity.businessName}, '%')
|
||||
</if>
|
||||
@ -176,8 +172,27 @@
|
||||
<if test="entity.paymentStatus != null and entity.paymentStatus != ''">
|
||||
AND dsco.payment_status = #{entity.paymentStatus}
|
||||
</if>
|
||||
<if test="entity.coachId != null ">
|
||||
AND dss.source_user_id = #{entity.coachId}
|
||||
<if test="entity.startTimeStr != null and entity.startTimeStr != ''">
|
||||
AND dsco.create_time >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr != null and entity.endTimeStr != ''">
|
||||
AND dsco.create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
<if test="entity.idCard != null and entity.idCard != '' ">
|
||||
<choose>
|
||||
<!-- 精确匹配:当输入18位时 -->
|
||||
<when test="entity.idCard.length() == 18">
|
||||
AND dss.id_card = #{entity.idCard}
|
||||
</when>
|
||||
<!-- 后4位匹配:当输入正好4位时 -->
|
||||
<when test="entity.idCard.length() == 4">
|
||||
AND RIGHT(dss.id_card, 4) = #{entity.idCard}
|
||||
</when>
|
||||
<!-- 模糊搜索:当输入大于4位但不足18位时 -->
|
||||
<otherwise>
|
||||
AND dss.id_card LIKE concat('%', #{entity.idCard}, '%')
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY dsco.create_time DESC
|
||||
@ -237,4 +252,84 @@
|
||||
</where>
|
||||
ORDER BY dsco.create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getBusinessRecordExportData" resultType="cn.iocoder.yudao.module.base.vo.BusinessRecordExportVO">
|
||||
select dss.name,
|
||||
dss.phone,
|
||||
dss.id_card,
|
||||
dss.age,
|
||||
dss.sex,
|
||||
dss.channel,
|
||||
dsco.course_name,
|
||||
dsco.course_id,
|
||||
dsco.course_type,
|
||||
dsco.coach_user_name,
|
||||
dsco.reserve_money,
|
||||
dsco.rest_money,
|
||||
dsco.payment_status,
|
||||
dsco.pay_type,
|
||||
dsco.is_sign,
|
||||
dsco.if_end,
|
||||
dsc.name AS businessName,
|
||||
dsc.phone AS businessPhone,
|
||||
dsco.create_time,
|
||||
dsco.sign_time,
|
||||
dsco.scheme_id AS scheme
|
||||
from drive_school_course_order dsco
|
||||
LEFT JOIN drive_school_student dss ON dss.user_id = dsco.user_id AND dss.deleted = 0
|
||||
LEFT JOIN drive_school_coach dsc ON dss.source_user_id = dsc.user_id AND dsc.deleted = 0
|
||||
<where>
|
||||
dsco.deleted = 0 AND dss.source = '04' AND dsc.type = 'ywjl'
|
||||
<!--<if test="entity.coachId != null">
|
||||
AND dsc.user_id = #{entity.coachId}
|
||||
</if>-->
|
||||
<if test="entity.startTimeStr != null and entity.startTimeStr != ''">
|
||||
AND dsco.create_time >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr != null and entity.endTimeStr != ''">
|
||||
AND dsco.create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
<if test="entity.businessName != null and entity.businessName != ''">
|
||||
AND dsc.name LIKE CONCAT('%', #{entity.businessName}, '%')
|
||||
</if>
|
||||
<if test="entity.name != null and entity.name != ''">
|
||||
AND dss.name LIKE CONCAT('%', #{entity.name}, '%')
|
||||
</if>
|
||||
<if test="entity.phone != null and entity.phone != ''">
|
||||
AND (dss.phone LIKE CONCAT('%', #{entity.phone}, '%')
|
||||
OR dsc.phone LIKE CONCAT('%', #{entity.phone}, '%'))
|
||||
</if>
|
||||
<if test="entity.isSign != null ">
|
||||
AND dsco.is_sign = #{entity.isSign}
|
||||
</if>
|
||||
<if test="entity.paymentStatus != null and entity.paymentStatus != ''">
|
||||
AND dsco.payment_status = #{entity.paymentStatus}
|
||||
</if>
|
||||
<if test="entity.courseType != null and entity.courseType != ''">
|
||||
AND dsco.course_type = #{entity.courseType}
|
||||
</if>
|
||||
<if test="entity.coachId != null ">
|
||||
AND dss.source_user_id = #{entity.coachId}
|
||||
</if>
|
||||
<if test="entity.idCard != null and entity.idCard != '' ">
|
||||
<choose>
|
||||
<!-- 精确匹配:当输入18位时 -->
|
||||
<when test="entity.idCard.length() == 18">
|
||||
AND dss.id_card = #{entity.idCard}
|
||||
</when>
|
||||
<!-- 后4位匹配:当输入正好4位时 -->
|
||||
<when test="entity.idCard.length() == 4">
|
||||
AND RIGHT(dss.id_card, 4) = #{entity.idCard}
|
||||
</when>
|
||||
<!-- 模糊搜索:当输入大于4位但不足18位时 -->
|
||||
<otherwise>
|
||||
AND dss.id_card LIKE concat('%', #{entity.idCard}, '%')
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY dsco.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -29,6 +29,13 @@
|
||||
<if test="entity.paymentStatus != null and entity.paymentStatus != ''"> and main.payment_status = #{entity.paymentStatus}</if>
|
||||
<if test="entity.ifEnd != null and entity.ifEnd != ''"> and main.if_end = #{entity.ifEnd}</if>
|
||||
<if test="entity.coachUserName != null and entity.coachUserName != ''"> and main.coach_user_name = #{entity.coachUserName}</if>
|
||||
<if test="entity.isSign != null "> and main.is_sign = #{entity.isSign}</if>
|
||||
<if test="entity.startTimeStr!=null and entity.startTimeStr!=''">
|
||||
AND main.create_time >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr!=null and entity.endTimeStr!=''">
|
||||
AND main.create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
</where>
|
||||
order by main.create_time desc
|
||||
</select>
|
||||
|
Loading…
Reference in New Issue
Block a user