src/main/java/com/mzl/flower/dto/request/wallet/QueryWalletBillRecordDTO.java
对比新文件 @@ -0,0 +1,45 @@ package com.mzl.flower.dto.request.wallet; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDate; @Data public class QueryWalletBillRecordDTO { @ApiModelProperty(value = "供应商Id") private Long supplierId; @ApiModelProperty(value = "供应商名称") private String supplierName; @ApiModelProperty(value = "提交日期-开始日期") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") private LocalDate createStartDate; @ApiModelProperty(value = "提交日期-结束日期") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") private LocalDate endEndDate; @ApiModelProperty(value = "审核时间-开始日期") @JsonFormat(pattern="yyyy-MM-dd" ,timezone="GMT+8") @DateTimeFormat(pattern="yyyy-MM-dd") private LocalDate approveStartDate; @ApiModelProperty(value = "审核时间-结束日期") @JsonFormat(pattern="yyyy-MM-dd" ,timezone="GMT+8") @DateTimeFormat(pattern="yyyy-MM-dd") private LocalDate approveEndDate; @ApiModelProperty(value = "变动类型") private String type; @ApiModelProperty(value = "订单号") private String orderNo; } src/main/java/com/mzl/flower/dto/response/wallet/WalletBillRecordVO.java
对比新文件 @@ -0,0 +1,45 @@ package com.mzl.flower.dto.response.wallet; import com.mzl.flower.base.AbstractTransDTO; import com.mzl.flower.base.annotation.DictTrans; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.time.LocalDateTime; @Data public class WalletBillRecordVO extends AbstractTransDTO { private Long id; @ApiModelProperty(value = "供应商Id") private Long supplierId; @ApiModelProperty(value = "供应商名称") private String supplierName; @ApiModelProperty(value = "原金额") private BigDecimal originalAmount; @ApiModelProperty(value = "变动金额") private BigDecimal changeAmount; @ApiModelProperty(value = "余额") private BigDecimal balance; @ApiModelProperty(value = "账单变动类型(提现,结算)") @DictTrans(target = "withdrawStateStr", codeType = "BILL_CHANGE_TYPE") private String type; private String typeStr; @ApiModelProperty("提交时间") private LocalDateTime createTime; @ApiModelProperty(value = "审核时间") private LocalDateTime approveTime; @ApiModelProperty(value = "备注") private String remark; } src/main/java/com/mzl/flower/entity/wallet/WalletBillRecordDO.java
@@ -61,4 +61,16 @@ @ApiModelProperty(value = "提现记录表ID") private Long withdrawRecordId; @ApiModelProperty(value = "orderNo") private String orderNo; @ApiModelProperty(value = "orderItemId") private String orderItemId; @ApiModelProperty(value = "结算金额") private BigDecimal totalAmount; @ApiModelProperty(value = "备注") private String remark; } src/main/java/com/mzl/flower/mapper/wallet/WalletBillRecordMapper.java
@@ -1,8 +1,14 @@ package com.mzl.flower.mapper.wallet; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mzl.flower.dto.request.wallet.QueryWalletBillRecordDTO; import com.mzl.flower.dto.response.wallet.WalletBillRecordVO; import com.mzl.flower.entity.wallet.WalletBillRecordDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; /** * <p> @@ -15,4 +21,8 @@ @Repository public interface WalletBillRecordMapper extends BaseMapper<WalletBillRecordDO> { List<WalletBillRecordVO> queryPage(@Param("dto") QueryWalletBillRecordDTO queryWalletBillRecordDTO, Page page); List<WalletBillRecordVO> queryWalletBillRecordList(@Param("dto") QueryWalletBillRecordDTO queryWalletBillRecordDTO); } src/main/java/com/mzl/flower/service/impl/wallet/WalletBillRecordServiceImpl.java
@@ -1,8 +1,13 @@ package com.mzl.flower.service.impl.wallet; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mzl.flower.constant.Constants; import com.mzl.flower.constant.LockConstants; import com.mzl.flower.dto.request.wallet.CreateWalletBillRecordDTO; import com.mzl.flower.dto.request.wallet.QueryWalletBillRecordDTO; import com.mzl.flower.dto.response.wallet.WalletBillRecordVO; import com.mzl.flower.entity.payment.Transfer; import com.mzl.flower.entity.payment.TransferDetail; import com.mzl.flower.entity.wallet.WalletBillRecordDO; @@ -14,13 +19,22 @@ import com.mzl.flower.mapper.wallet.WalletMapper; import com.mzl.flower.mapper.wallet.WalletWithdrawRecordMapper; import com.mzl.flower.service.wallet.WalletBillRecordService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mzl.flower.service.wallet.WalletService; import com.mzl.flower.utils.ExcelExportUtil; import org.redisson.api.RLock; import org.redisson.api.RedissonClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; /** * <p> @@ -30,7 +44,9 @@ * @author @TaoJie * @since 2024-10-22 */ @Service @Transactional public class WalletBillRecordServiceImpl extends ServiceImpl<WalletBillRecordMapper, WalletBillRecordDO> implements WalletBillRecordService { @Resource @@ -50,6 +66,9 @@ @Resource private WalletWithdrawRecordMapper walletWithdrawRecordMapper; @Resource RedissonClient redissonClient; @Override public void create(CreateWalletBillRecordDTO dto) { @@ -76,12 +95,23 @@ walletBillRecordMapper.updateById(walletBillRecordDO); //更新钱包 WalletDO walletDO = walletService.getBySupplierId(walletBillRecordDO.getWalletId()); if(!ObjectUtils.isEmpty(walletDO)){ //提现中金额:减少提现中金额 walletDO.setWithdrawingAmount(walletDO.getWithdrawingAmount().subtract(walletBillRecordDO.getChangeAmount())); //已提现金额:增加已提现金额 walletDO.setWithdrawnAmount(walletDO.getWithdrawnAmount().add(walletBillRecordDO.getChangeAmount())); walletMapper.updateById(walletDO); RLock lock = redissonClient.getLock(String.format(LockConstants.WALLET_ID_KEY, walletDO.getId())); try { if (lock.tryLock(10, 30, TimeUnit.SECONDS)) { try { if (!ObjectUtils.isEmpty(walletDO)) { //提现中金额:减少提现中金额 walletDO.setWithdrawingAmount(walletDO.getWithdrawingAmount().subtract(walletBillRecordDO.getChangeAmount())); //已提现金额:增加已提现金额 walletDO.setWithdrawnAmount(walletDO.getWithdrawnAmount().add(walletBillRecordDO.getChangeAmount())); walletMapper.updateById(walletDO); } } finally { lock.unlock(); } } } catch (InterruptedException e) { throw new RuntimeException(e); } //回写提现状态 if (StringUtils.isEmpty(walletBillRecordDO.getWithdrawRecordId())) { @@ -95,12 +125,23 @@ walletBillRecordDO.update("sys"); walletBillRecordMapper.updateById(walletBillRecordDO); WalletDO walletDO = walletService.getBySupplierId(walletBillRecordDO.getWalletId()); if(!ObjectUtils.isEmpty(walletDO)){ //提现中金额:减少提现中金额 walletDO.setWithdrawingAmount(walletDO.getWithdrawingAmount().subtract(walletBillRecordDO.getChangeAmount())); //可提现金额:增加可提现金额 walletDO.setWithdrawableAmount(walletDO.getWithdrawableAmount().add(walletBillRecordDO.getChangeAmount())); walletMapper.updateById(walletDO); RLock lock = redissonClient.getLock(String.format(LockConstants.WALLET_ID_KEY, walletDO.getId())); try { if (lock.tryLock(10, 30, TimeUnit.SECONDS)) { try { if (!ObjectUtils.isEmpty(walletDO)) { //提现中金额:减少提现中金额 walletDO.setWithdrawingAmount(walletDO.getWithdrawingAmount().subtract(walletBillRecordDO.getChangeAmount())); //可提现金额:增加可提现金额 walletDO.setWithdrawableAmount(walletDO.getWithdrawableAmount().add(walletBillRecordDO.getChangeAmount())); walletMapper.updateById(walletDO); } } finally { lock.unlock(); } } } catch (InterruptedException e) { throw new RuntimeException(e); } //回写提现状态 if (StringUtils.isEmpty(walletBillRecordDO.getWithdrawRecordId())) { @@ -111,4 +152,44 @@ } } } @Override public Page<WalletBillRecordVO> queryPage(QueryWalletBillRecordDTO queryWalletBillRecordDTO, Page page) { List<WalletBillRecordVO> list = walletBillRecordMapper.queryPage(queryWalletBillRecordDTO, page); page.setRecords(list); return page; } @Override public void exportSupplierFinanceList(HttpServletResponse response, QueryWalletBillRecordDTO queryWalletBillRecordDTO) { List<WalletBillRecordVO> list = walletBillRecordMapper.queryWalletBillRecordList(queryWalletBillRecordDTO); String[] rowsName = new String[]{"序号","供应商信息", "变动类型", "原金额", "变动金额", "现余额", "提交时间", "审核时间", "备注"}; List<Object[]> dataList = new ArrayList<>(); int sn = 1; for (WalletBillRecordVO o : list) { Object[] objs = new Object[rowsName.length]; int a = 0; objs[a++] = sn; // 序号 objs[a++] = o.getSupplierName()+":"+o.getSupplierId(); // 供应商信息 objs[a++] = o.getTypeStr(); // 变动类型 objs[a++] = o.getOriginalAmount(); // 原金额 objs[a++] = o.getChangeAmount(); // 变动金额 objs[a++] = o.getBalance(); //现余额 objs[a++] = o.getCreateTime();//提交时间 objs[a++] = o.getApproveTime(); // 审核时间 objs[a++] = o.getRemark(); //备注 dataList.add(objs); sn++; } ExcelExportUtil excelExportUtil = new ExcelExportUtil("供应商财务", rowsName, dataList, response); try { response.addHeader("filename", URLEncoder.encode("供应商财务.xls", "UTF-8")); response.addHeader("Access-Control-Expose-Headers", "filename"); excelExportUtil.export(); } catch (Exception e) { log.error(e.getMessage(), e); } } } src/main/java/com/mzl/flower/service/impl/wallet/WalletWithdrawRecordServiceImpl.java
@@ -238,7 +238,6 @@ } //记录转账状态,定时任务定时获取状态并更新钱包交易记录表信息 walletBillRecordDO.setTransferDetailId(Constants.TRANSFER_STATUS.ACCEPTED.name()); walletBillRecordMapper.insert(walletBillRecordDO); //不需要更新结算单了,此时提现的金额和计算单上的金额不一致 } @@ -246,13 +245,25 @@ if (Constants.WALLET_APPROVE_STATE.REJECT.name().equals(walletWithdrawRecordDTO.getApproveState())) { //更新钱包 Supplier s = supplierMapper.selectById(withdrawRecordDO.getSupplierId()); WalletDO walletDO = walletService.getBySupplierId(s.getId()); if(!ObjectUtils.isEmpty(walletDO)){ //提现中金额:审核失败体现中金额扣减 walletDO.setWithdrawingAmount(walletDO.getWithdrawingAmount().subtract(withdrawRecordDO.getAmount())); //可提现金额:审核失败可提现金额增加 walletDO.setWithdrawableAmount(walletDO.getWithdrawableAmount().add(withdrawRecordDO.getAmount())); walletMapper.updateById(walletDO); RLock lock = redissonClient.getLock(String.format(LockConstants.WALLET_ID_KEY, walletDO.getId())); try { if (lock.tryLock(10, 30, TimeUnit.SECONDS)) { try { if (!ObjectUtils.isEmpty(walletDO)) { //提现中金额:审核失败体现中金额扣减 walletDO.setWithdrawingAmount(walletDO.getWithdrawingAmount().subtract(withdrawRecordDO.getAmount())); //可提现金额:审核失败可提现金额增加 walletDO.setWithdrawableAmount(walletDO.getWithdrawableAmount().add(withdrawRecordDO.getAmount())); walletMapper.updateById(walletDO); } } finally { lock.unlock(); } } } catch (InterruptedException e) { throw new RuntimeException(e); } } } src/main/java/com/mzl/flower/service/payment/OrderSettlementService.java
@@ -38,7 +38,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; import java.math.BigDecimal; import java.math.RoundingMode; @@ -676,11 +675,6 @@ settlement.setUserId(s.getUserId()); settlement.setStatus(Constants.SETTLEMENT_STATUS.PENDING.name()); //2024-10-23 //新增WalletBillRecordDO WalletBillRecordDO walletBillRecord = new WalletBillRecordDO(); walletBillRecord.setId(UUIDGenerator.getUUID()); Integer flowerNum = 0;//商品数量 BigDecimal totalAmount = new BigDecimal(0);//交易合计 BigDecimal checkFee = new BigDecimal(0);//降级扣款 @@ -723,10 +717,10 @@ //2024-10-23 //copy信息到t_wallet_bill_record_detail WalletBillRecordDetail walletBillRecordDetail = new WalletBillRecordDetail(); BeanUtils.copyProperties(detail, walletBillRecordDetail, "id"); walletBillRecordDetail.setBillRecordId(walletBillRecord.getId()); walletBillRecordDetailMapper.insert(walletBillRecordDetail); // WalletBillRecordDetail walletBillRecordDetail = new WalletBillRecordDetail(); // BeanUtils.copyProperties(detail, walletBillRecordDetail, "id"); // walletBillRecordDetail.setBillRecordId(walletBillRecord.getId()); // walletBillRecordDetailMapper.insert(walletBillRecordDetail); flowerNum += oi.getNum(); totalAmount = totalAmount.add(detail.getTotalAmount()); @@ -738,6 +732,48 @@ serviceFee = serviceFee.add(ois.getServiceFee()); serviceFeeRate = ois.getServiceFeeRate(); settlementAmount = settlementAmount.add(ois.getIncomeSupplier()); WalletDO walletDO = walletService.getBySupplierId(supplierId); RLock lock = redissonClient.getLock(String.format(LockConstants.WALLET_ID_KEY, walletDO.getId())); try { if (lock.tryLock(10, 30, TimeUnit.SECONDS)) { try { //2024-10-28 直接保存到walletBillRecord //新增WalletBillRecordDO WalletBillRecordDO walletBillRecord = new WalletBillRecordDO(); walletBillRecord.setId(UUIDGenerator.getUUID()); WalletDO walletDOInfo = walletService.getBySupplierId(supplierId); //增加供应商结算金额保存到钱包 walletBillRecord.setSupplierId(supplierId); walletBillRecord.setWalletId(walletDOInfo.getId()); walletBillRecord.setSettlementId(settlement.getId()); walletBillRecord.setOrderItemId(detail.getOrderItemId()); //变动金额等于供应商收入 walletBillRecord.setTotalAmount(ois.getIncomeSupplier()); walletBillRecord.setType(Constants.BILL_CHANGE_TYPE.settlement.name()); walletBillRecord.setMethod(Constants.BILL_CHANGE_METHOD.add.name()); walletBillRecord.setOriginalAmount(walletDOInfo.getTotalAmount()); walletBillRecord.setChangeAmount(ois.getIncomeSupplier()); walletBillRecord.setBalance(walletDOInfo.getWithdrawableAmount().add(ois.getIncomeSupplier())); Order order = orderMapper.selectById(detail.getOrderId()); if (!ObjectUtils.isEmpty(order)) { walletBillRecord.setRemark("订单完成(订单号" + order.getOrderNo() + ")" + ",获得收入"); walletBillRecord.setOrderNo(order.getOrderNo()); } //更新钱包 //可提现金额=钱包余额=结算金额 walletDOInfo.setWithdrawableAmount(walletDOInfo.getWithdrawableAmount().add(ois.getIncomeSupplier())); walletDOInfo.setTotalAmount(walletDOInfo.getWithdrawableAmount()); //已结算金额 walletDOInfo.setSettledAmount(walletDOInfo.getSettledAmount().add(ois.getIncomeSupplier())); walletMapper.updateById(walletDOInfo); walletBillRecordMapper.insert(walletBillRecord); } finally { lock.unlock(); } } } catch (InterruptedException e) { throw new RuntimeException(e); } } settlement.setFlowerNum(flowerNum); @@ -771,40 +807,6 @@ //新逻辑不是立即转账。不走结算后转账逻辑。此时没有转账时间、openID、转账ID、转账明细ID,直接标记结算状态完成,存金额到钱包中 settlement.setStatus(Constants.SETTLEMENT_STATUS.COMPLETED.name()); settlementMapper.insert(settlement); WalletDO walletDO = walletService.getCurrentSupplier(); if (null == walletDO) { throw new ValidationException("钱包不能为空"); } RLock lock = redissonClient.getLock(String.format(LockConstants.WALLET_ID_KEY, walletDO.getId())); try { if (lock.tryLock(10, 30, TimeUnit.SECONDS)) { try { WalletDO walletDOInfo = walletService.getCurrentSupplier(); //增加供应商结算金额保存到钱包 walletBillRecord.setSupplierId(s.getId()); walletBillRecord.setWalletId(walletDOInfo.getId()); walletBillRecord.setSettlementId(settlement.getId()); walletBillRecord.setType(Constants.BILL_CHANGE_TYPE.settlement.name()); walletBillRecord.setMethod(Constants.BILL_CHANGE_METHOD.add.name()); walletBillRecord.setOriginalAmount(walletDOInfo.getTotalAmount()); walletBillRecord.setChangeAmount(settlementAmount); walletBillRecord.setBalance(walletDOInfo.getWithdrawableAmount().add(settlementAmount)); //更新钱包 //可提现金额=钱包余额=结算金额 walletDOInfo.setWithdrawableAmount(walletDOInfo.getWithdrawableAmount().add(settlementAmount)); walletDOInfo.setTotalAmount(walletDOInfo.getWithdrawableAmount()); //已结算金额 walletDOInfo.setSettledAmount(walletDOInfo.getSettledAmount().add(settlementAmount)); walletMapper.updateById(walletDOInfo); walletBillRecordMapper.insert(walletBillRecord); } finally { lock.unlock(); } } } catch (InterruptedException e) { throw new RuntimeException(e); } } src/main/java/com/mzl/flower/service/wallet/WalletBillRecordService.java
@@ -1,8 +1,13 @@ package com.mzl.flower.service.wallet; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mzl.flower.dto.request.wallet.CreateWalletBillRecordDTO; import com.mzl.flower.dto.request.wallet.QueryWalletBillRecordDTO; import com.mzl.flower.dto.response.wallet.WalletBillRecordVO; import com.mzl.flower.entity.wallet.WalletBillRecordDO; import com.baomidou.mybatisplus.extension.service.IService; import javax.servlet.http.HttpServletResponse; /** * <p> @@ -17,4 +22,9 @@ void create(CreateWalletBillRecordDTO dto); void updateTransferStatus(String transferId); Page<WalletBillRecordVO> queryPage(QueryWalletBillRecordDTO dto, Page page); void exportSupplierFinanceList(HttpServletResponse response, QueryWalletBillRecordDTO dto); } src/main/java/com/mzl/flower/web/v2/wallet/WalletBillRecordController.java
@@ -5,25 +5,21 @@ import com.mzl.flower.base.BaseController; import com.mzl.flower.base.R; import com.mzl.flower.base.ReturnDataDTO; import com.mzl.flower.config.exception.ValidationException; import com.mzl.flower.dto.request.wallet.CreateWalletBillRecordDTO; import com.mzl.flower.entity.supplier.Supplier; import com.mzl.flower.entity.wallet.WalletDO; import com.mzl.flower.mapper.supplier.SupplierMapper; import com.mzl.flower.service.supplier.SupplierService; import com.mzl.flower.dto.request.report.QueryPartnerOrderDTO; import com.mzl.flower.dto.request.wallet.QueryWalletBillRecordDTO; import com.mzl.flower.dto.request.wallet.QueryWalletWithdrawDTO; import com.mzl.flower.dto.response.wallet.WalletBillRecordVO; import com.mzl.flower.dto.response.wallet.WalletWithdrawRecordVO; import com.mzl.flower.service.wallet.WalletBillRecordService; import com.mzl.flower.service.wallet.WalletService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import com.mzl.flower.entity.wallet.WalletBillRecordDO; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.validation.constraints.Min; import javax.validation.constraints.Max; import javax.validation.constraints.Positive; import javax.servlet.http.HttpServletResponse; /** * @author @TaoJie @@ -36,39 +32,16 @@ @Autowired private WalletBillRecordService walletBillRecordService; @PostMapping("") public ResponseEntity<ReturnDataDTO> create(@Validated @RequestBody CreateWalletBillRecordDTO dto) { return returnData(R.SUCCESS.getCode(), null); @GetMapping("/list") @ApiOperation(value = "供应商财务-分页", httpMethod = "GET") public ResponseEntity<ReturnDataDTO<Page<WalletBillRecordVO>>> getMemberList(Page page, QueryWalletBillRecordDTO dto) { return returnData(R.SUCCESS.getCode(), walletBillRecordService.queryPage(dto, page)); } @PutMapping("/{id}") public ResponseEntity<ReturnDataDTO> update(@PathVariable @Positive(message = "{id.positive}") Integer id) { return returnData(R.SUCCESS.getCode(), null); } @DeleteMapping("/{id}") public ResponseEntity<ReturnDataDTO> delete(@PathVariable @Positive(message = "{id.positive}") Integer id) { return returnData(R.SUCCESS.getCode(), null); } @GetMapping("/{id}") public WalletBillRecordDO get(@PathVariable(value = "id") @Positive(message = "{id.positive}") Integer id) { return null; } @GetMapping("/page") public ResponseEntity<ReturnDataDTO<Page<WalletBillRecordDO>>> page( @RequestParam(name = "page", required = false, defaultValue = "0") @Min(value = 0, message = "{page.number.min}") Integer page, @RequestParam(name = "count", required = false, defaultValue = "10") @Min(value = 1, message = "{page.count.min}") @Max(value = 30, message = "{page.count.max}") Integer count ) { return returnData(R.SUCCESS.getCode(), null); @GetMapping({"/export"}) @ApiOperation(value = "供应商财务导出") public void partnerExportSales(HttpServletResponse response, @Validated QueryWalletBillRecordDTO dto){ walletBillRecordService.exportSupplierFinanceList(response, dto); } } src/main/resources/mapper/wallet/WalletBillRecordMapper.xml
@@ -22,5 +22,87 @@ <result column="transfer_detail_id" property="transferDetailId" /> <result column="open_id" property="openId" /> </resultMap> <select id="queryPage" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO"> select t.* ,s.name supplierName from t_wallet_bill_record t left join t_supplier_info s on t.supplier_id = s.id left join t_order o on t.order_id = o.id left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id where t.deleted= 0 <if test="dto.supplierName != null and dto.supplierName != ''"> and s.name like concat('%', #{dto.supplierName}, '%') </if> <if test="dto.supplierId != null and dto.supplierId != ''"> and t.supplier_id = #{dto.supplierId} </if> <if test="dto.type != null and dto.type != ''"> and t.type = #{type} </if> <if test="dto.orderNo != null and dto.orderNo != ''"> and o.order_no = like concat('%', #{orderNo}, '%') </if> <if test="dto.createStartDate!=null "> <![CDATA[ AND w.create_time >= #{dto.createStartDate} ]]> </if> <if test="dto.endEndDate!=null "> <![CDATA[ AND w.create_time <= #{dto.endEndDate} ]]> </if> <if test="dto.approveStartDate!=null "> <![CDATA[ AND w.approve_time >= #{dto.approveStartDate} ]]> </if> <if test="dto.approveEndDate!=null "> <![CDATA[ AND w.approve_time <= #{dto.approveStartDate} ]]> </if> order by t.create_time </select> <select id="queryWalletBillRecordList" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO"> select t.* ,s.name supplierName from t_wallet_bill_record t left join t_supplier_info s on t.supplier_id = s.id left join t_order o on t.order_id = o.id left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id where t.deleted= 0 <if test="dto.supplierName != null and dto.supplierName != ''"> and s.name like concat('%', #{dto.supplierName}, '%') </if> <if test="dto.supplierId != null and dto.supplierId != ''"> and t.supplier_id = #{dto.supplierId} </if> <if test="dto.type != null and dto.type != ''"> and t.type = #{type} </if> <if test="dto.orderNo != null and dto.orderNo != ''"> and o.order_no = like concat('%', #{orderNo}, '%') </if> <if test="dto.createStartDate!=null "> <![CDATA[ AND w.create_time >= #{dto.createStartDate} ]]> </if> <if test="dto.endEndDate!=null "> <![CDATA[ AND w.create_time <= #{dto.endEndDate} ]]> </if> <if test="dto.approveStartDate!=null "> <![CDATA[ AND w.approve_time >= #{dto.approveStartDate} ]]> </if> <if test="dto.approveEndDate!=null "> <![CDATA[ AND w.approve_time <= #{dto.approveStartDate} ]]> </if> order by t.create_time </select> </mapper>