| @@ -0,0 +1,80 @@ | |||||
| package com.iformall.controller.rent; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.BaseEntity; | |||||
| import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxBillSettle; | |||||
| import com.iformall.domain.po.WxBillSettleRecord; | |||||
| import com.iformall.service.WxBillRentService; | |||||
| import com.iformall.service.WxBillSettleRecordService; | |||||
| import com.iformall.service.WxBillSettleService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| /** | |||||
| * @author luozukai | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("wxBillSettle") | |||||
| public class WxBillSettleController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxBillSettleService wxBillSettleService; | |||||
| @Autowired | |||||
| private WxBillSettleRecordService wxBillSettleRecordService; | |||||
| @GetMapping("list") | |||||
| @ApiOperation("账单管理-结算对冲列表") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "账单管理-结算对冲列表") | |||||
| public ResultData list(@ModelAttribute WxBillSettle wxBillSettle, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillSettleController::list"); | |||||
| if (null == wxBillSettle) { | |||||
| wxBillSettle = new WxBillSettle(); | |||||
| } | |||||
| wxBillSettle.setTenantId(getTenantId()); | |||||
| wxBillSettle.setSortColumns(BaseEntity.SortField.Createtime_DESC,BaseEntity.SortField.Id_DESC); | |||||
| final PageInfo<WxBillSettle> page = wxBillSettleService.listAsPage(wxBillSettle, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @PostMapping("add") | |||||
| @ApiOperation("账单管理-结算单-新增") | |||||
| @SystemControllerLog(description = "账单管理-结算单-新增") | |||||
| public ResultData add(@RequestBody WxBillSettle wxBillSettle) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillSettleController::add"); | |||||
| wxBillSettle.setTenantId(getTenantId()); | |||||
| return wxBillSettleService.saveOrUpdate(wxBillSettle); | |||||
| } | |||||
| @PostMapping("update") | |||||
| @ApiOperation("账单管理-结算单-更新") | |||||
| @SystemControllerLog(description = "账单管理-结算单-更新") | |||||
| public ResultData update(@RequestBody WxBillSettle wxBillSettle) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillSettleController::update"); | |||||
| return wxBillSettleService.saveOrUpdate(wxBillSettle); | |||||
| } | |||||
| @GetMapping("exportSettle") | |||||
| @SystemControllerLog(description = "账单管理-结算单-导出") | |||||
| public void exportBill(@ModelAttribute WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) { | |||||
| wxBillSettle.setTenantId(getTenantId()); | |||||
| wxBillSettleService.exportBill(request, response, wxBillSettle); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,50 @@ | |||||
| package com.iformall.domain.po; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import javax.persistence.Id; | |||||
| import javax.persistence.Table; | |||||
| import javax.persistence.Transient; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author luozukai | |||||
| */ | |||||
| @Table(name = "wx_bill_settle") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxBillSettle extends BaseEntity { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @Id | |||||
| protected Long id; | |||||
| @Transient | |||||
| protected List<Long> ids; | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||||
| private String tenantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="结算单号",name="settleNumber") | |||||
| private String settleNumber; | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId") | |||||
| private Long merchantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="0待确认1未清算结余金额2结算完成",name="status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value="审核状态0未审核1审核中2审核完成3驳回4异常终止5撤回",name="applyStatus") | |||||
| private Integer applyStatus; | |||||
| @io.swagger.annotations.ApiModelProperty(value="收款",name="receiveMoney") | |||||
| private Long receiveMoney; | |||||
| @io.swagger.annotations.ApiModelProperty(value="承付",name="payMoney") | |||||
| private Long payMoney; | |||||
| @io.swagger.annotations.ApiModelProperty(value="结算时间",name="settletime") | |||||
| private Date settletime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | |||||
| private Date createtime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||||
| private Date updatetime; | |||||
| } | |||||
| @@ -0,0 +1,52 @@ | |||||
| package com.iformall.domain.po; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import javax.persistence.Id; | |||||
| import javax.persistence.Table; | |||||
| import javax.persistence.Transient; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author luozukai | |||||
| */ | |||||
| @Table(name = "wx_bill_settle_record") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxBillSettleRecord extends BaseEntity { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @Id | |||||
| protected Long id; | |||||
| @Transient | |||||
| protected List<Long> ids; | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||||
| private String tenantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="结算单id",name="settleId") | |||||
| private Long settleId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="操作人id",name="userid") | |||||
| private Long userid; | |||||
| @io.swagger.annotations.ApiModelProperty(value="操作人姓名",name="userName") | |||||
| private String userName; | |||||
| @io.swagger.annotations.ApiModelProperty(value="清算金额",name="settleMoney") | |||||
| private Long settleMoney; | |||||
| @io.swagger.annotations.ApiModelProperty(value="清算时间",name="settleTime") | |||||
| private Date settleTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="清算方式1现金2支付宝3微信4银行卡转账5其他",name="settleWay") | |||||
| private Integer settleWay; | |||||
| @io.swagger.annotations.ApiModelProperty(value="结余",name="balance") | |||||
| private Long balance; | |||||
| @io.swagger.annotations.ApiModelProperty(value="明细",name="detail") | |||||
| private String detail; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | |||||
| private Date createtime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||||
| private Date updatetime; | |||||
| } | |||||
| @@ -1,13 +1,11 @@ | |||||
| package com.iformall.domain.vo; | package com.iformall.domain.vo; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import java.math.BigDecimal; | |||||
| @Data | @Data | ||||
| public class RatioVo { | public class RatioVo { | ||||
| //扣点率 | //扣点率 | ||||
| private Integer ratio = 0; | private Integer ratio = 0; | ||||
| //超出部分金额 | |||||
| private BigDecimal balance; | |||||
| //金额 | |||||
| private Long price; | |||||
| } | } | ||||
| @@ -0,0 +1,17 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxBillSettle; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author luozukai | |||||
| */ | |||||
| public interface WxBillSettleMapper extends CommonMapper<WxBillSettle, Long> { | |||||
| List<WxBillSettle> findList(WxBillSettle wxBillSettle); | |||||
| void update(WxBillSettle record); | |||||
| } | |||||
| @@ -0,0 +1,19 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxBillSettle; | |||||
| import com.iformall.domain.po.WxBillSettleRecord; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author luozukai | |||||
| */ | |||||
| public interface WxBillSettleRecordMapper extends CommonMapper<WxBillSettleRecord, Long> { | |||||
| List<WxBillSettleRecord> findList(WxBillSettleRecord wxBillSettleRecord); | |||||
| void update(WxBillSettleRecord record); | |||||
| } | |||||
| @@ -0,0 +1,28 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxBillSettleRecord; | |||||
| /** | |||||
| * @author luozukai | |||||
| */ | |||||
| public interface WxBillSettleRecordService { | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxBillSettleRecord> listAsPage(WxBillSettleRecord record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| ResultData saveOrUpdate(WxBillSettleRecord record); | |||||
| } | |||||
| @@ -0,0 +1,39 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxBillSettle; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| /** | |||||
| * @author luozukai | |||||
| */ | |||||
| public interface WxBillSettleService { | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxBillSettle getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| ResultData saveOrUpdate(WxBillSettle record); | |||||
| void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillSettle wxBillSettle); | |||||
| } | |||||
| @@ -0,0 +1,30 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxBillSettleRecord; | |||||
| import com.iformall.mapper.WxBillSettleRecordMapper; | |||||
| import com.iformall.service.WxBillSettleRecordService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| /** | |||||
| * @author luozukai | |||||
| * @date 2019/8/26 17:37 | |||||
| */ | |||||
| @Service | |||||
| public class WxBillSettleRecordServiceImpl implements WxBillSettleRecordService { | |||||
| @Autowired | |||||
| private WxBillSettleRecordMapper wxBillSettleRecordMapper; | |||||
| @Override | |||||
| public PageInfo<WxBillSettleRecord> listAsPage(WxBillSettleRecord record, Integer pageIndex, Integer pageSize) { | |||||
| return null; | |||||
| } | |||||
| @Override | |||||
| public ResultData saveOrUpdate(WxBillSettleRecord record) { | |||||
| return null; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,41 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxBillSettle; | |||||
| import com.iformall.mapper.WxBillSettleMapper; | |||||
| import com.iformall.service.WxBillSettleService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| /** | |||||
| * @author luozukai | |||||
| * @date 2019/8/26 17:37 | |||||
| */ | |||||
| @Service | |||||
| public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| @Autowired | |||||
| private WxBillSettleMapper wxBillSettleMapper; | |||||
| @Override | |||||
| public PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize) { | |||||
| return null; | |||||
| } | |||||
| @Override | |||||
| public WxBillSettle getById(Long id) { | |||||
| return null; | |||||
| } | |||||
| @Override | |||||
| public ResultData saveOrUpdate(WxBillSettle record) { | |||||
| return null; | |||||
| } | |||||
| @Override | |||||
| public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillSettle wxBillSettle) { | |||||
| } | |||||
| } | |||||
| @@ -248,6 +248,24 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| return result; | return result; | ||||
| } | } | ||||
| /** | |||||
| * 计算金额 | |||||
| * @param ratio | |||||
| * @param revenueLong | |||||
| * @return | |||||
| */ | |||||
| public static Long countPrice(Integer ratio,Long revenueLong,int timeType){ | |||||
| BigDecimal hundred = new BigDecimal(100); | |||||
| BigDecimal revenue = new BigDecimal(revenueLong == null ? 0 : revenueLong).divide(hundred); | |||||
| BigDecimal payRatio = new BigDecimal(ratio == null ? 0 : ratio).divide(new BigDecimal(10000)); | |||||
| BigDecimal price; | |||||
| if(EnumMissTimeType.YEAR.getCode().equals(timeType)){ | |||||
| price = revenue.multiply(payRatio).divide(new BigDecimal(12),2, RoundingMode.HALF_EVEN); | |||||
| }else{ | |||||
| price = revenue.multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN); | |||||
| } | |||||
| return price.multiply(hundred).longValue(); | |||||
| } | |||||
| /** | /** | ||||
| * 获取设置的跳点率 | * 获取设置的跳点率 | ||||
| @@ -293,6 +311,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| if (revenue.compareTo(start) >= 0 && revenue.compareTo(end)<= 0){ | if (revenue.compareTo(start) >= 0 && revenue.compareTo(end)<= 0){ | ||||
| ratioVo.setRatio(ratio); | ratioVo.setRatio(ratio); | ||||
| ratioVo.setPrice(countPrice(ratioVo.getRatio(),revenueLong,timeType)); | |||||
| break; | break; | ||||
| } | } | ||||
| }else if(e.indexOf(">") >= 0){ | }else if(e.indexOf(">") >= 0){ | ||||
| @@ -330,7 +349,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| BigDecimal frontRatio = new BigDecimal(frontatio).divide(new BigDecimal(10000)); | BigDecimal frontRatio = new BigDecimal(frontatio).divide(new BigDecimal(10000)); | ||||
| BigDecimal frontPrice = end.multiply(new BigDecimal(1000000).multiply(frontRatio).setScale(2, RoundingMode.HALF_EVEN)); | BigDecimal frontPrice = end.multiply(new BigDecimal(1000000).multiply(frontRatio).setScale(2, RoundingMode.HALF_EVEN)); | ||||
| ratioVo.setBalance(price.add(frontPrice)); | |||||
| ratioVo.setPrice(price.add(frontPrice).longValue()); | |||||
| return ratioVo; | return ratioVo; | ||||
| } | } | ||||
| } | } | ||||
| @@ -338,20 +357,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| return ratioVo; | return ratioVo; | ||||
| } | } | ||||
| /** | |||||
| * 计算金额 | |||||
| * @param ratio | |||||
| * @param revenueLong | |||||
| * @return | |||||
| */ | |||||
| public Long countPrice(Integer ratio,Long revenueLong){ | |||||
| BigDecimal hundred = new BigDecimal(100); | |||||
| BigDecimal revenue = new BigDecimal(revenueLong == null ? 0 : revenueLong).divide(hundred); | |||||
| BigDecimal payRatio = new BigDecimal(ratio == null ? 0 : ratio).divide(new BigDecimal(10000)); | |||||
| BigDecimal price = revenue.multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN); | |||||
| return price.multiply(hundred).longValue(); | |||||
| } | |||||
| @Transactional(rollbackFor = {Exception.class}) | @Transactional(rollbackFor = {Exception.class}) | ||||
| @Override | @Override | ||||
| public ResultData save(WxRentContract record,Long userId,String userName,Date oldRentStartDate) { | public ResultData save(WxRentContract record,Long userId,String userName,Date oldRentStartDate) { | ||||
| @@ -379,17 +384,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| record.setPrice(0l); | record.setPrice(0l); | ||||
| }else{ | }else{ | ||||
| if(record.getPayRatio()!=null && record.getPayRatio().intValue() > 0){ | if(record.getPayRatio()!=null && record.getPayRatio().intValue() > 0){ | ||||
| record.setPrice(countPrice(record.getPayRatio(),record.getRevenue())); | |||||
| record.setPrice(countPrice(record.getPayRatio(),record.getRevenue(),EnumMissTimeType.OTHER.getCode())); | |||||
| }else{ | }else{ | ||||
| int dayCount = record.getReceivePeriod() * 30; | int dayCount = record.getReceivePeriod() * 30; | ||||
| RatioVo ratioVo = getPayRatio(EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod()); | RatioVo ratioVo = getPayRatio(EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod()); | ||||
| //record.setPayRatio(ratioVo.getRatio()); | //record.setPayRatio(ratioVo.getRatio()); | ||||
| if(ratioVo.getBalance() != null){ | |||||
| //有超出部分,在getPayRatio里计算 | |||||
| record.setPrice(ratioVo.getBalance().longValue()); | |||||
| }else{ | |||||
| record.setPrice(countPrice(ratioVo.getRatio(),record.getRevenue())); | |||||
| } | |||||
| record.setPrice(ratioVo.getPrice()); | |||||
| } | } | ||||
| } | } | ||||
| } else { | } else { | ||||
| @@ -617,17 +617,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| if(!EnumFromType.SWITCH.getCode().equals(from)){ | if(!EnumFromType.SWITCH.getCode().equals(from)){ | ||||
| if (record.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | if (record.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | ||||
| if(record.getPayRatio()!=null && record.getPayRatio().intValue() > 0){ | if(record.getPayRatio()!=null && record.getPayRatio().intValue() > 0){ | ||||
| record.setPrice(countPrice(record.getPayRatio(),record.getRevenue())); | |||||
| record.setPrice(countPrice(record.getPayRatio(),record.getRevenue(),EnumMissTimeType.OTHER.getCode())); | |||||
| }else{ | }else{ | ||||
| int dayCount = record.getReceivePeriod() * 30; | int dayCount = record.getReceivePeriod() * 30; | ||||
| RatioVo ratioVo = getPayRatio(EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod()); | RatioVo ratioVo = getPayRatio(EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod()); | ||||
| //record.setPayRatio(ratioVo.getRatio()); | //record.setPayRatio(ratioVo.getRatio()); | ||||
| if(ratioVo.getBalance() != null){ | |||||
| //有超出部分,在getPayRatio里计算 | |||||
| record.setPrice(ratioVo.getBalance().longValue()); | |||||
| }else{ | |||||
| record.setPrice(countPrice(ratioVo.getRatio(),record.getRevenue())); | |||||
| } | |||||
| record.setPrice(ratioVo.getPrice()); | |||||
| } | } | ||||
| } else { | } else { | ||||
| if (StringUtils.isNotEmpty(record.getPriceStr())) { | if (StringUtils.isNotEmpty(record.getPriceStr())) { | ||||
| @@ -642,7 +642,7 @@ | |||||
| </select> | </select> | ||||
| <select id="getReceiveAndPayBillAsPage" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap"> | <select id="getReceiveAndPayBillAsPage" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap"> | ||||
| select m.id,m.name,ws.shop_number shopNumber,ws.type,m.link_person linkPerson,m.link_line_phone linkPhone, | |||||
| select m.id,m.name,ws.shop_number shopNumber,ws.type,m.link_person linkPerson,m.link_phone linkPhone, | |||||
| xb.title business,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate, | xb.title business,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate, | ||||
| round( | round( | ||||
| @@ -0,0 +1,48 @@ | |||||
| <?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.iformall.mapper.WxBillSettleMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillSettle"> | |||||
| <id column="id" property="id"/> | |||||
| <result column="tenant_id" property="tenantId"/> | |||||
| <result column="settle_number" property="settleNumber"/> | |||||
| <result column="merchant_id" property="merchantId"/> | |||||
| <result column="status" property="status"/> | |||||
| <result column="apply_status" property="applyStatus"/> | |||||
| <result column="receive_money" property="receiveMoney"/> | |||||
| <result column="pay_money" property="payMoney"/> | |||||
| <result column="settletime" property="settletime"/> | |||||
| <result column="createtime" property="createtime"/> | |||||
| <result column="updatetime" property="updatetime"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`settle_number`,`merchant_id`,`status`,`apply_status`, | |||||
| `receive_money`,`pay_money`,`settletime`,`createtime`,`updatetime` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1=1 | |||||
| <if test=" null != id ">and `id` = #{id}</if> | |||||
| <if test=" null != tenantId ">and `tenant_id` = #{tenantId}</if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxBillSettle" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_bill_settle | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -0,0 +1,49 @@ | |||||
| <?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.iformall.mapper.WxBillSettleRecordMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillSettleRecord"> | |||||
| <id column="id" property="id"/> | |||||
| <result column="tenant_id" property="tenantId"/> | |||||
| <result column="settle_id" property="settleId"/> | |||||
| <result column="userid" property="userid"/> | |||||
| <result column="user_name" property="userName"/> | |||||
| <result column="settle_money" property="settleMoney"/> | |||||
| <result column="settle_time" property="settleTime"/> | |||||
| <result column="settle_way" property="settleWay"/> | |||||
| <result column="balance" property="balance"/> | |||||
| <result column="detail" property="detail"/> | |||||
| <result column="createtime" property="createtime"/> | |||||
| <result column="updatetime" property="updatetime"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`settle_id`,`userid`,`user_name`,`settle_money`, | |||||
| `settle_time`,`settle_way`,`balance`,detail,`createtime`,`updatetime` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1=1 | |||||
| <if test=" null != id ">and `id` = #{id}</if> | |||||
| <if test=" null != tenantId ">and `tenant_id` = #{tenantId}</if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxBillSettleRecord" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_bill_settle_record | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||