| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.export.PlatformLedgerReportExport; |
| | | import com.ruoyi.system.export.ProcurementReportClinicExport; |
| | | import com.ruoyi.system.export.ProcurementReportPlatformExport; |
| | | import com.ruoyi.system.export.ProcurementReportSupplierExport; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import com.ruoyi.system.query.ClinicProcurementReportQuery; |
| | | import com.ruoyi.system.query.DetectionPaymentReportQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.ClinicProcurementReportVO; |
| | | import com.ruoyi.system.vo.DetectionPaymentReportVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | |
| | | private final TSysAppUserService sysAppUserService; |
| | | private final TCrmClinicPointsService crmClinicPointsService; |
| | | private final TSysOrderService sysOrderService; |
| | | private final TSysPayRecordService sysPayRecordService; |
| | | |
| | | @Autowired |
| | | public FinancialStatementsController(TErpProcurementService erpProcurementService, TokenService tokenService, ISysUserService sysUserService, TCrmSupplierService crmSupplierService, TCrmClinicService crmClinicService, TSysAppUserService sysAppUserService, TCrmClinicPointsService crmClinicPointsService, TSysOrderService sysOrderService) { |
| | | public FinancialStatementsController(TErpProcurementService erpProcurementService, TokenService tokenService, ISysUserService sysUserService, TCrmSupplierService crmSupplierService, TCrmClinicService crmClinicService, TSysAppUserService sysAppUserService, TCrmClinicPointsService crmClinicPointsService, TSysOrderService sysOrderService, TSysPayRecordService sysPayRecordService) { |
| | | this.erpProcurementService = erpProcurementService; |
| | | this.tokenService = tokenService; |
| | | this.sysUserService = sysUserService; |
| | |
| | | this.sysAppUserService = sysAppUserService; |
| | | this.crmClinicPointsService = crmClinicPointsService; |
| | | this.sysOrderService = sysOrderService; |
| | | this.sysPayRecordService = sysPayRecordService; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * AI检测支付报表 |
| | | */ |
| | | @ApiOperation(value = "AI检测支付报表") |
| | | @PostMapping(value = "/detectionPaymentReport") |
| | | public R<PageInfo<DetectionPaymentReportVO>> detectionPaymentReport(@RequestBody DetectionPaymentReportQuery query) { |
| | | PageInfo<DetectionPaymentReportVO> pageInfo = sysPayRecordService.detectionPaymentReport(query); |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | | @Log(title = "财务报表-AI检测支付报表导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "AI检测支付报表导出") |
| | | @PostMapping("/exportDetectionPaymentReport") |
| | | public void exportDetectionPaymentReport(@RequestBody DetectionPaymentReportQuery query){ |
| | | List<DetectionPaymentReportVO> list = sysPayRecordService.exportDetectionPaymentReport(query); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), DetectionPaymentReportVO.class, list); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("AI检测支付报表.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 平台分账报表 |
| | | */ |
| | | @ApiOperation(value = "平台分账报表") |
| | | @PostMapping(value = "/platformLedgerReport") |
| | | public R<PageInfo<ClinicProcurementReportVO>> platformLedgerReport(@RequestBody ClinicProcurementReportQuery query) { |
| | | PageInfo<ClinicProcurementReportVO> pageInfo = erpProcurementService.platformLedgerReport(query); |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | | @Log(title = "财务报表-平台分账报表导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "平台分账报表导出") |
| | | @PostMapping("/exportPlatformLedgerReport") |
| | | public void exportPlatformLedgerReport(@RequestBody ClinicProcurementReportQuery query){ |
| | | List<PlatformLedgerReportExport> list = erpProcurementService.exportPlatformLedgerReport(query); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), PlatformLedgerReportExport.class, list); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("平台分账报表.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel(value = "平台分账报表PlatformLedgerReportExport") |
| | | public class PlatformLedgerReportExport implements Serializable { |
| | | private String id; |
| | | @Excel(name = "诊所名称", width = 20) |
| | | private String clinicName; |
| | | @Excel(name = "采购供应商", width = 20) |
| | | private String supplierName; |
| | | @Excel(name = "采购单号", width = 20) |
| | | private String procurementCode; |
| | | @Excel(name = "采购时间", width = 20) |
| | | private String payTimeStr; |
| | | @Excel(name = "采购金额", width = 20) |
| | | private BigDecimal payMoney; |
| | | @Excel(name = "供应商获得金额", width = 20) |
| | | private BigDecimal money; |
| | | @Excel(name = "平台分佣金额", width = 20) |
| | | private BigDecimal supplierMoney; |
| | | private LocalDateTime payTime; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.system.export.PlatformLedgerReportExport; |
| | | import com.ruoyi.system.export.ProcurementReportClinicExport; |
| | | import com.ruoyi.system.export.ProcurementReportPlatformExport; |
| | | import com.ruoyi.system.export.ProcurementReportSupplierExport; |
| | |
| | | List<ProcurementReportPlatformExport> exportProcurementReportPlatform(@Param("query")ClinicProcurementReportQuery query); |
| | | List<TErpProcurementGoods> branchAdminStatisticsThree(@Param("clinicIds") List<String> clinicIds); |
| | | |
| | | /** |
| | | * 平台分账报表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<ClinicProcurementReportVO> platformLedgerReport(@Param("query")ClinicProcurementReportQuery query, @Param("pageInfo")PageInfo<ClinicProcurementReportVO> pageInfo); |
| | | |
| | | /** |
| | | * 平台分账报表导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<PlatformLedgerReportExport> exportPlatformLedgerReport(@Param("query")ClinicProcurementReportQuery query); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TSysPayRecord; |
| | | import com.ruoyi.system.query.DetectionPaymentReportQuery; |
| | | import com.ruoyi.system.vo.DetectionPaymentReportVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TSysPayRecordMapper extends BaseMapper<TSysPayRecord> { |
| | | |
| | | /** |
| | | * 检测支付报表 |
| | | * @param query 查询参数 |
| | | * @param pageInfo 分页参数 |
| | | * @return 检测支付报表 |
| | | */ |
| | | List<DetectionPaymentReportVO> detectionPaymentReport(@Param("query") DetectionPaymentReportQuery query, @Param("pageInfo")PageInfo<DetectionPaymentReportVO> pageInfo); |
| | | |
| | | /** |
| | | * 检测支付报表导出 |
| | | * @param query 检测支付报表查询参数 |
| | | * @return 检测支付报表 |
| | | */ |
| | | List<DetectionPaymentReportVO> exportDetectionPaymentReport(@Param("query")DetectionPaymentReportQuery query); |
| | | } |
| | |
| | | @TableField("supplier_money") |
| | | private BigDecimal supplierMoney; |
| | | |
| | | @ApiModelProperty(value = "平台是否分佣成功 1=是 2=否") |
| | | @TableField("is_platform_commission") |
| | | private Integer isPlatformCommission; |
| | | |
| | | /** |
| | | * 新增执行 |
| | | */ |
| New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.model.TimeRangeQueryBody; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "检测支付报表查询参数DetectionPaymentReportQuery") |
| | | public class DetectionPaymentReportQuery extends TimeRangeQueryBody { |
| | | |
| | | @ApiModelProperty(value = "用户昵称") |
| | | private String nickName; |
| | | |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.system.dto.AddProcurementDto; |
| | | import com.ruoyi.system.export.PlatformLedgerReportExport; |
| | | import com.ruoyi.system.export.ProcurementReportClinicExport; |
| | | import com.ruoyi.system.export.ProcurementReportPlatformExport; |
| | | import com.ruoyi.system.export.ProcurementReportSupplierExport; |
| | |
| | | * @return |
| | | */ |
| | | List<ProcurementReportPlatformExport> exportProcurementReportPlatform(ClinicProcurementReportQuery query); |
| | | |
| | | /** |
| | | * 平台分账报表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<ClinicProcurementReportVO> platformLedgerReport(ClinicProcurementReportQuery query); |
| | | |
| | | /** |
| | | * 平台分账报表导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<PlatformLedgerReportExport> exportPlatformLedgerReport(ClinicProcurementReportQuery query); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TSysPayRecord; |
| | | import com.ruoyi.system.query.DetectionPaymentReportQuery; |
| | | import com.ruoyi.system.vo.DetectionPaymentReportVO; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param state 支付状态 1=待支付 2=已支付 |
| | | */ |
| | | void saveData(String orderNo, String userId, BigDecimal aiPrice, Integer state); |
| | | |
| | | /** |
| | | * 检测支付报表 |
| | | * @param query 查询参数 |
| | | * @return 结果 |
| | | */ |
| | | PageInfo<DetectionPaymentReportVO> detectionPaymentReport(DetectionPaymentReportQuery query); |
| | | |
| | | /** |
| | | * 导出检测支付报表 |
| | | * @param query 查询参数 |
| | | * @return 结果 |
| | | */ |
| | | List<DetectionPaymentReportVO> exportDetectionPaymentReport(DetectionPaymentReportQuery query); |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.system.dto.AddProcurementDto; |
| | | import com.ruoyi.system.export.PlatformLedgerReportExport; |
| | | import com.ruoyi.system.export.ProcurementReportClinicExport; |
| | | import com.ruoyi.system.export.ProcurementReportPlatformExport; |
| | | import com.ruoyi.system.export.ProcurementReportSupplierExport; |
| | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<ClinicProcurementReportVO> platformLedgerReport(ClinicProcurementReportQuery query) { |
| | | PageInfo<ClinicProcurementReportVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<ClinicProcurementReportVO> list = this.baseMapper.platformLedgerReport(query, pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformLedgerReportExport> exportPlatformLedgerReport(ClinicProcurementReportQuery query) { |
| | | List<PlatformLedgerReportExport> list = this.baseMapper.exportPlatformLedgerReport(query); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | for (PlatformLedgerReportExport platformLedgerReportExport : list) { |
| | | if(Objects.nonNull(platformLedgerReportExport.getPayTime())){ |
| | | String payTimeStr = new SimpleDateFormat("yyyy-MM-dd").format(platformLedgerReportExport.getPayTime()); |
| | | platformLedgerReportExport.setPayTimeStr(payTimeStr); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TSysPayRecordMapper; |
| | | import com.ruoyi.system.model.TErpGoodsType; |
| | | import com.ruoyi.system.model.TSysPayRecord; |
| | | import com.ruoyi.system.query.DetectionPaymentReportQuery; |
| | | import com.ruoyi.system.service.TSysPayRecordService; |
| | | import com.ruoyi.system.vo.DetectionPaymentReportVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | sysPayRecord.setPayState(state); |
| | | this.save(sysPayRecord); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<DetectionPaymentReportVO> detectionPaymentReport(DetectionPaymentReportQuery query) { |
| | | PageInfo<DetectionPaymentReportVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<DetectionPaymentReportVO> list = this.baseMapper.detectionPaymentReport(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public List<DetectionPaymentReportVO> exportDetectionPaymentReport(DetectionPaymentReportQuery query) { |
| | | List<DetectionPaymentReportVO> list = this.baseMapper.exportDetectionPaymentReport(query); |
| | | for (DetectionPaymentReportVO detectionPaymentReportVO : list) { |
| | | String payTimeStr = new SimpleDateFormat("yyyy-MM-dd").format(detectionPaymentReportVO.getPayTime()); |
| | | detectionPaymentReportVO.setPayTimeStr(payTimeStr); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel(value = "检测支付报表视图对象DetectionPaymentReportVO", description = "检测支付报表视图对象") |
| | | public class DetectionPaymentReportVO implements Serializable { |
| | | |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private String appUserId; |
| | | |
| | | @Excel(name = "用户昵称", width = 20) |
| | | @ApiModelProperty(value = "用户昵称") |
| | | private String nickName; |
| | | |
| | | @Excel(name = "支付时间", width = 20) |
| | | private String payTimeStr; |
| | | |
| | | @Excel(name = "支付金额", width = 20) |
| | | @ApiModelProperty(value = "支付价格") |
| | | private BigDecimal payAmount; |
| | | |
| | | @ApiModelProperty(value = "支付状态 1=待支付 2=已支付") |
| | | private Integer payState; |
| | | |
| | | @ApiModelProperty(value = "支付时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime payTime; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | </where> |
| | | order by tep.pay_time desc |
| | | </select> |
| | | <select id="platformLedgerReport" resultType="com.ruoyi.system.vo.ClinicProcurementReportVO"> |
| | | select tep.id, tep.procurement_code, tep.pay_money, tep.status,tep.pay_time,tep.clinic_id, tep.supplier_id, |
| | | tep.money,tep.supplier_money, |
| | | tcs.supplier_name as supplierName, tcc.clinic_name as clinicName,tcc.person_charge_name,tcc.phone |
| | | from t_erp_procurement tep |
| | | left join t_crm_supplier tcs on tep.supplier_id = tcs.id |
| | | left join t_crm_clinic tcc on tep.clinic_id = tcc.id |
| | | <where> |
| | | <if test="query.procurementCode != null and query.procurementCode != ''"> |
| | | and tep.procurement_code like concat('%',#{query.procurementCode},'%') |
| | | </if> |
| | | <if test="query.supplierName != null and query.supplierName != ''"> |
| | | and tcs.supplier_name like concat('%',#{query.supplierName},'%') |
| | | </if> |
| | | <if test="query.clinicName != null and query.clinicName != ''"> |
| | | and tcc.clinic_name like concat('%',#{query.clinicName},'%') |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | and tep.status = #{query.status} |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND tep.pay_time >= #{query.startTime} |
| | | AND tep.pay_time <= #{query.endTime} |
| | | </if> |
| | | <if test="query.clinicId != null and query.clinicId != ''"> |
| | | and tep.clinic_id = #{query.clinicId} |
| | | </if> |
| | | <if test="query.supplierId != null and query.supplierId != ''"> |
| | | and tep.supplier_id = #{query.supplierId} |
| | | </if> |
| | | <if test="query.personChargeName != null and query.personChargeName != ''"> |
| | | and tep.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tep.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | AND tep.is_platform_commission = 1 |
| | | AND tep.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | order by tep.pay_time desc |
| | | </select> |
| | | <select id="exportPlatformLedgerReport" resultType="com.ruoyi.system.export.PlatformLedgerReportExport"> |
| | | select tep.id, tep.procurement_code, tep.pay_money, tep.status,tep.pay_time,tep.clinic_id, tep.supplier_id, |
| | | tep.money,tep.supplier_money, |
| | | tcs.supplier_name as supplierName, tcc.clinic_name as clinicName,tcc.person_charge_name,tcc.phone |
| | | from t_erp_procurement tep |
| | | left join t_crm_supplier tcs on tep.supplier_id = tcs.id |
| | | left join t_crm_clinic tcc on tep.clinic_id = tcc.id |
| | | <where> |
| | | <if test="query.procurementCode != null and query.procurementCode != ''"> |
| | | and tep.procurement_code like concat('%',#{query.procurementCode},'%') |
| | | </if> |
| | | <if test="query.supplierName != null and query.supplierName != ''"> |
| | | and tcs.supplier_name like concat('%',#{query.supplierName},'%') |
| | | </if> |
| | | <if test="query.clinicName != null and query.clinicName != ''"> |
| | | and tcc.clinic_name like concat('%',#{query.clinicName},'%') |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | and tep.status = #{query.status} |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND tep.pay_time >= #{query.startTime} |
| | | AND tep.pay_time <= #{query.endTime} |
| | | </if> |
| | | <if test="query.clinicId != null and query.clinicId != ''"> |
| | | and tep.clinic_id = #{query.clinicId} |
| | | </if> |
| | | <if test="query.supplierId != null and query.supplierId != ''"> |
| | | and tep.supplier_id = #{query.supplierId} |
| | | </if> |
| | | <if test="query.personChargeName != null and query.personChargeName != ''"> |
| | | and tep.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tep.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | AND tep.is_platform_commission = 1 |
| | | AND tep.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | order by tep.pay_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.TSysPayRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TSysPayRecord"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="inspection_id" property="inspectionId" /> |
| | | <result column="pay_amount" property="payAmount" /> |
| | | <result column="pay_state" property="payState" /> |
| | | <result column="order_no" property="orderNo" /> |
| | | <result column="transaction_id" property="transactionId" /> |
| | | <result column="pay_time" property="payTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, inspection_id, pay_amount, pay_state, order_no, transaction_id, pay_time |
| | | </sql> |
| | | <select id="detectionPaymentReport" resultType="com.ruoyi.system.vo.DetectionPaymentReportVO"> |
| | | SELECT |
| | | tspr.id, tspr.app_user_id, tspr.inspection_id, tspr.pay_amount, tspr.pay_state, tspr.order_no, |
| | | tspr.transaction_id, tspr.pay_time, tsau.nick_name |
| | | FROM t_sys_pay_record tspr |
| | | LEFT JOIN t_sys_app_user tsau ON tspr.app_user_id = tsau.id |
| | | <where> |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | AND tsau.nick_name LIKE CONCAT('%', #{query.nickName}, '%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND tspr.pay_time >= #{query.startTime} |
| | | AND tspr.pay_time <= #{query.endTime} |
| | | </if> |
| | | </where> |
| | | ORDER BY tspr.pay_time DESC |
| | | </select> |
| | | <select id="exportDetectionPaymentReport" resultType="com.ruoyi.system.vo.DetectionPaymentReportVO"> |
| | | SELECT |
| | | tspr.id, tspr.app_user_id, tspr.inspection_id, tspr.pay_amount, tspr.pay_state, tspr.order_no, |
| | | tspr.transaction_id, tspr.pay_time, tsau.nick_name |
| | | FROM t_sys_pay_record tspr |
| | | LEFT JOIN t_sys_app_user tsau ON tspr.app_user_id = tsau.id |
| | | <where> |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | AND tsau.nick_name LIKE CONCAT('%', #{query.nickName}, '%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND tspr.pay_time >= #{query.startTime} |
| | | AND tspr.pay_time <= #{query.endTime} |
| | | </if> |
| | | </where> |
| | | ORDER BY tspr.pay_time DESC |
| | | </select> |
| | | |
| | | </mapper> |