| @@ -0,0 +1,118 @@ | |||||
| package com.iformall.domain.po; | |||||
| import lombok.Data; | |||||
| import javax.persistence.*; | |||||
| import java.util.*; | |||||
| import java.math.*; | |||||
| import javax.persistence.Transient; | |||||
| import java.util.List; | |||||
| import javax.persistence.Id; | |||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_card_info") | |||||
| @Data | |||||
| public class WxCardInfo implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @Id | |||||
| protected Long id; | |||||
| @Transient | |||||
| protected List<Long> ids; | |||||
| @Transient | |||||
| protected String sortColumns; | |||||
| /**卡券ID*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡券ID",name="cardId") | |||||
| private Long cardId; | |||||
| /**微信订单号-购买类储值卡时的订单号*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="微信订单号-购买类储值卡时的订单号",name="transactionId") | |||||
| private String transactionId; | |||||
| /**面额总金额*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="面额总金额",name="amount") | |||||
| private Integer amount; | |||||
| /**剩余面额*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="剩余面额",name="remainingAmount") | |||||
| private Integer remainingAmount; | |||||
| /**分账总手续费*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="分账总手续费",name="serviceFeeAmount") | |||||
| private Integer serviceFeeAmount; | |||||
| /**分账总金额*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="分账总金额",name="shareFeeAmount") | |||||
| private Integer shareFeeAmount; | |||||
| /**分账剩余总金额*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="分账剩余总金额",name="remaingShareFeeAmount") | |||||
| private Integer remaingShareFeeAmount; | |||||
| /**创建时间*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| /**更新时间*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| public static enum Field | |||||
| { | |||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||||
| ,CardId_ASC("`card_id` ASC"),CardId_DESC("`card_id` DESC") | |||||
| ,TransactionId_ASC("`transaction_id` ASC"),TransactionId_DESC("`transaction_id` DESC") | |||||
| ,Amount_ASC("`amount` ASC"),Amount_DESC("`amount` DESC") | |||||
| ,RemainingAmount_ASC("`remaining_amount` ASC"),RemainingAmount_DESC("`remaining_amount` DESC") | |||||
| ,ServiceFeeAmount_ASC("`service_fee_amount` ASC"),ServiceFeeAmount_DESC("`service_fee_amount` DESC") | |||||
| ,ShareFeeAmount_ASC("`share_fee_amount` ASC"),ShareFeeAmount_DESC("`share_fee_amount` DESC") | |||||
| ,RemaingShareFeeAmount_ASC("`remaing_share_fee_amount` ASC"),RemaingShareFeeAmount_DESC("`remaing_share_fee_amount` DESC") | |||||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") | |||||
| ; | |||||
| private String value; | |||||
| Field(String value){ | |||||
| this.value = value; | |||||
| } | |||||
| public String getValue() { | |||||
| return value; | |||||
| } | |||||
| public void setCol(String value) { | |||||
| this.value = value; | |||||
| } | |||||
| @Override | |||||
| public String toString() { | |||||
| return this.getValue(); | |||||
| } | |||||
| } | |||||
| public void setSortColumns(WxCardInfo.Field... fields) | |||||
| { | |||||
| if (fields == null || fields.length == 0) { | |||||
| return; | |||||
| } | |||||
| for (int k = 0; k < fields.length; k++) { | |||||
| if (fields[k] == null) { | |||||
| return; | |||||
| } | |||||
| } | |||||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||||
| for (int k = 1; k < fields.length; k++) { | |||||
| sb.append(","); | |||||
| sb.append(fields[k].toString()); | |||||
| } | |||||
| this.sortColumns = sb.toString(); | |||||
| } | |||||
| public void setSortColumns(String sortColumns) | |||||
| { | |||||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||||
| return; | |||||
| } | |||||
| if (sortColumns.contains(",")) { | |||||
| String[] cols = sortColumns.split(","); | |||||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||||
| for (int k = 0; k < cols.length; k++) { | |||||
| fList.add(Field.valueOf(cols[k])); | |||||
| } | |||||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||||
| } else { | |||||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,121 @@ | |||||
| package com.iformall.domain.po; | |||||
| import lombok.Data; | |||||
| import javax.persistence.*; | |||||
| import java.util.*; | |||||
| import javax.persistence.Transient; | |||||
| import java.util.List; | |||||
| import javax.persistence.Id; | |||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_card_spend") | |||||
| @Data | |||||
| public class WxCardSpend implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @Id | |||||
| protected Long id; | |||||
| @Transient | |||||
| protected List<Long> ids; | |||||
| @Transient | |||||
| protected String sortColumns; | |||||
| /**储值卡ID*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="储值卡ID",name="cardId") | |||||
| private Long cardId; | |||||
| /**持有人ID*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="持有人ID",name="ownerId") | |||||
| private Long ownerId; | |||||
| /**商户ID*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||||
| private Long merchantId; | |||||
| /**订单账号*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单账号",name="orderId") | |||||
| private Long orderId; | |||||
| /**支付金额(包含通道费)*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(包含通道费)",name="payment") | |||||
| private Integer payment; | |||||
| /**实收金额(不包含通道费)*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="实收金额(不包含通道费)",name="realPayment") | |||||
| private Integer realPayment; | |||||
| /**卡剩余总金额*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡剩余总金额",name="remainAmount") | |||||
| private Integer remainAmount; | |||||
| /**卡支付前总金额*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡支付前总金额",name="beforeAmount") | |||||
| private Integer beforeAmount; | |||||
| /**创建时间*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| /**更新时间*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| public static enum Field | |||||
| { | |||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||||
| ,CardId_ASC("`card_id` ASC"),CardId_DESC("`card_id` DESC") | |||||
| ,OwnerId_ASC("`owner_id` ASC"),OwnerId_DESC("`owner_id` DESC") | |||||
| ,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_id` DESC") | |||||
| ,OrderId_ASC("`order_id` ASC"),OrderId_DESC("`order_id` DESC") | |||||
| ,Payment_ASC("`payment` ASC"),Payment_DESC("`payment` DESC") | |||||
| ,RealPayment_ASC("`real_payment` ASC"),RealPayment_DESC("`real_payment` DESC") | |||||
| ,RemainAmount_ASC("`remain_amount` ASC"),RemainAmount_DESC("`remain_amount` DESC") | |||||
| ,BeforeAmount_ASC("`before_amount` ASC"),BeforeAmount_DESC("`before_amount` DESC") | |||||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") | |||||
| ; | |||||
| private String value; | |||||
| Field(String value){ | |||||
| this.value = value; | |||||
| } | |||||
| public String getValue() { | |||||
| return value; | |||||
| } | |||||
| public void setCol(String value) { | |||||
| this.value = value; | |||||
| } | |||||
| @Override | |||||
| public String toString() { | |||||
| return this.getValue(); | |||||
| } | |||||
| } | |||||
| public void setSortColumns(WxCardSpend.Field... fields) | |||||
| { | |||||
| if (fields == null || fields.length == 0) { | |||||
| return; | |||||
| } | |||||
| for (int k = 0; k < fields.length; k++) { | |||||
| if (fields[k] == null) { | |||||
| return; | |||||
| } | |||||
| } | |||||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||||
| for (int k = 1; k < fields.length; k++) { | |||||
| sb.append(","); | |||||
| sb.append(fields[k].toString()); | |||||
| } | |||||
| this.sortColumns = sb.toString(); | |||||
| } | |||||
| public void setSortColumns(String sortColumns) | |||||
| { | |||||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||||
| return; | |||||
| } | |||||
| if (sortColumns.contains(",")) { | |||||
| String[] cols = sortColumns.split(","); | |||||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||||
| for (int k = 0; k < cols.length; k++) { | |||||
| fList.add(Field.valueOf(cols[k])); | |||||
| } | |||||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||||
| } else { | |||||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,133 @@ | |||||
| package com.iformall.domain.po; | |||||
| import lombok.Data; | |||||
| import javax.persistence.*; | |||||
| import java.util.*; | |||||
| import javax.persistence.Transient; | |||||
| import java.util.List; | |||||
| import javax.persistence.Id; | |||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_merchant_subsidy") | |||||
| @Data | |||||
| public class WxMerchantSubsidy implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @Id | |||||
| protected Long id; | |||||
| @Transient | |||||
| protected List<Long> ids; | |||||
| @Transient | |||||
| protected String sortColumns; | |||||
| /**订单ID*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId") | |||||
| private Long orderId; | |||||
| /**订单支付类型(0:券1:付款码支付,2:C扫码支付,3,储值卡)*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单支付类型(0:券1:付款码支付,2:C扫码支付,3,储值卡)",name="orderType") | |||||
| private Integer orderType; | |||||
| /**商户ID*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||||
| private Long merchantId; | |||||
| /**券包ID/存储卡ID*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券包ID/存储卡ID",name="couponOrderId") | |||||
| private Long couponOrderId; | |||||
| /**券包类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,7.类储值卡)*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券包类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,7.类储值卡)",name="couponType") | |||||
| private Integer couponType; | |||||
| /**订单金额*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单金额",name="orderPayment") | |||||
| private Integer orderPayment; | |||||
| /**接收金额(包含通道费)*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="接收金额(包含通道费)",name="receiverPayment") | |||||
| private Integer receiverPayment; | |||||
| /** 实收金额(不包含通道费)*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value=" 实收金额(不包含通道费)",name="realPayment") | |||||
| private Integer realPayment; | |||||
| /**补贴额(包含通道费)*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="补贴额(包含通道费)",name="subsidy") | |||||
| private Integer subsidy; | |||||
| /**线上补贴额/实收补贴额(通道费扣除)*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="线上补贴额/实收补贴额(通道费扣除)",name="realSubsidy") | |||||
| private Integer realSubsidy; | |||||
| /**状态(0:未补贴, 1:已补贴)*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="状态(0:未补贴, 1:已补贴)",name="status") | |||||
| private Integer status; | |||||
| /**创建时间*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| /**更新时间*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| public static enum Field | |||||
| { | |||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||||
| ,OrderId_ASC("`order_id` ASC"),OrderId_DESC("`order_id` DESC") | |||||
| ,OrderType_ASC("`order_type` ASC"),OrderType_DESC("`order_type` DESC") | |||||
| ,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_id` DESC") | |||||
| ,CouponOrderId_ASC("`coupon_order_id` ASC"),CouponOrderId_DESC("`coupon_order_id` DESC") | |||||
| ,CouponType_ASC("`coupon_type` ASC"),CouponType_DESC("`coupon_type` DESC") | |||||
| ,OrderPayment_ASC("`order_payment` ASC"),OrderPayment_DESC("`order_payment` DESC") | |||||
| ,ReceiverPayment_ASC("`receiver_payment` ASC"),ReceiverPayment_DESC("`receiver_payment` DESC") | |||||
| ,RealPayment_ASC("`real_payment` ASC"),RealPayment_DESC("`real_payment` DESC") | |||||
| ,Subsidy_ASC("`subsidy` ASC"),Subsidy_DESC("`subsidy` DESC") | |||||
| ,RealSubsidy_ASC("`real_subsidy` ASC"),RealSubsidy_DESC("`real_subsidy` DESC") | |||||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") | |||||
| ; | |||||
| private String value; | |||||
| Field(String value){ | |||||
| this.value = value; | |||||
| } | |||||
| public String getValue() { | |||||
| return value; | |||||
| } | |||||
| public void setCol(String value) { | |||||
| this.value = value; | |||||
| } | |||||
| @Override | |||||
| public String toString() { | |||||
| return this.getValue(); | |||||
| } | |||||
| } | |||||
| public void setSortColumns(WxMerchantSubsidy.Field... fields) | |||||
| { | |||||
| if (fields == null || fields.length == 0) { | |||||
| return; | |||||
| } | |||||
| for (int k = 0; k < fields.length; k++) { | |||||
| if (fields[k] == null) { | |||||
| return; | |||||
| } | |||||
| } | |||||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||||
| for (int k = 1; k < fields.length; k++) { | |||||
| sb.append(","); | |||||
| sb.append(fields[k].toString()); | |||||
| } | |||||
| this.sortColumns = sb.toString(); | |||||
| } | |||||
| public void setSortColumns(String sortColumns) | |||||
| { | |||||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||||
| return; | |||||
| } | |||||
| if (sortColumns.contains(",")) { | |||||
| String[] cols = sortColumns.split(","); | |||||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||||
| for (int k = 0; k < cols.length; k++) { | |||||
| fList.add(Field.valueOf(cols[k])); | |||||
| } | |||||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||||
| } else { | |||||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,16 @@ | |||||
| package com.iformall.mapper; | |||||
| import java.util.*; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxCardInfo; | |||||
| public interface WxCardInfoMapper extends CommonMapper<WxCardInfo, Long> { | |||||
| List<WxCardInfo> findList(WxCardInfo wxCardInfo); | |||||
| } | |||||
| @@ -0,0 +1,16 @@ | |||||
| package com.iformall.mapper; | |||||
| import java.util.*; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxCardSpend; | |||||
| public interface WxCardSpendMapper extends CommonMapper<WxCardSpend, Long> { | |||||
| List<WxCardSpend> findList(WxCardSpend wxCardSpend); | |||||
| } | |||||
| @@ -0,0 +1,16 @@ | |||||
| package com.iformall.mapper; | |||||
| import java.util.*; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxMerchantSubsidy; | |||||
| public interface WxMerchantSubsidyMapper extends CommonMapper<WxMerchantSubsidy, Long> { | |||||
| List<WxMerchantSubsidy> findList(WxMerchantSubsidy wxMerchantSubsidy); | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxCardInfo; | |||||
| public interface WxCardInfoService { | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxCardInfo> listAsPage(WxCardInfo record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxCardInfo getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void saveOrUpdate(WxCardInfo record); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| * @param id | |||||
| */ | |||||
| void deleteById(Long id); | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxCardSpend; | |||||
| public interface WxCardSpendService { | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxCardSpend> listAsPage(WxCardSpend record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxCardSpend getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void saveOrUpdate(WxCardSpend record); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| * @param id | |||||
| */ | |||||
| void deleteById(Long id); | |||||
| } | |||||
| @@ -0,0 +1,47 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxMerchantSubsidy; | |||||
| public interface WxMerchantSubsidyService { | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxMerchantSubsidy> listAsPage(WxMerchantSubsidy record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxMerchantSubsidy getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void saveOrUpdate(WxMerchantSubsidy record); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| * @param id | |||||
| */ | |||||
| void deleteById(Long id); | |||||
| } | |||||
| @@ -0,0 +1,53 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxCardInfo; | |||||
| import com.iformall.mapper.WxCardInfoMapper; | |||||
| import com.iformall.service.WxCardInfoService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.iformall.common.IdWorker; | |||||
| @Service | |||||
| public class WxCardInfoServiceImpl implements WxCardInfoService { | |||||
| @Autowired | |||||
| WxCardInfoMapper wxCardInfoMapper; | |||||
| @Override | |||||
| public PageInfo<WxCardInfo> listAsPage(WxCardInfo record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardInfoMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxCardInfo getById(Long id) { | |||||
| return wxCardInfoMapper.selectByPrimaryKey(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxCardInfo record) { | |||||
| if (record.getId() == null) { | |||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| wxCardInfoMapper.insertSelective(record); | |||||
| } else { | |||||
| wxCardInfoMapper.updateByPrimaryKeySelective(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| wxCardInfoMapper.deleteByPrimaryKey(id); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,53 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxCardSpend; | |||||
| import com.iformall.mapper.WxCardSpendMapper; | |||||
| import com.iformall.service.WxCardSpendService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.iformall.common.IdWorker; | |||||
| @Service | |||||
| public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| @Autowired | |||||
| WxCardSpendMapper wxCardSpendMapper; | |||||
| @Override | |||||
| public PageInfo<WxCardSpend> listAsPage(WxCardSpend record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardSpendMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxCardSpend getById(Long id) { | |||||
| return wxCardSpendMapper.selectByPrimaryKey(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxCardSpend record) { | |||||
| if (record.getId() == null) { | |||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| wxCardSpendMapper.insertSelective(record); | |||||
| } else { | |||||
| wxCardSpendMapper.updateByPrimaryKeySelective(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| wxCardSpendMapper.deleteByPrimaryKey(id); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,53 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxMerchantSubsidy; | |||||
| import com.iformall.mapper.WxMerchantSubsidyMapper; | |||||
| import com.iformall.service.WxMerchantSubsidyService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.iformall.common.IdWorker; | |||||
| @Service | |||||
| public class WxMerchantSubsidyServiceImpl implements WxMerchantSubsidyService { | |||||
| @Autowired | |||||
| WxMerchantSubsidyMapper wxMerchantSubsidyMapper; | |||||
| @Override | |||||
| public PageInfo<WxMerchantSubsidy> listAsPage(WxMerchantSubsidy record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantSubsidyMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxMerchantSubsidy getById(Long id) { | |||||
| return wxMerchantSubsidyMapper.selectByPrimaryKey(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxMerchantSubsidy record) { | |||||
| if (record.getId() == null) { | |||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| wxMerchantSubsidyMapper.insertSelective(record); | |||||
| } else { | |||||
| wxMerchantSubsidyMapper.updateByPrimaryKeySelective(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| wxMerchantSubsidyMapper.deleteByPrimaryKey(id); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,72 @@ | |||||
| <?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.WxCardInfoMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCardInfo"> | |||||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||||
| <result column="card_id" jdbcType="BIGINT" property="cardId" /> | |||||
| <result column="transaction_id" jdbcType="VARCHAR" property="transactionId" /> | |||||
| <result column="amount" jdbcType="INTEGER" property="amount" /> | |||||
| <result column="remaining_amount" jdbcType="INTEGER" property="remainingAmount" /> | |||||
| <result column="service_fee_amount" jdbcType="INTEGER" property="serviceFeeAmount" /> | |||||
| <result column="share_fee_amount" jdbcType="INTEGER" property="shareFeeAmount" /> | |||||
| <result column="remaing_share_fee_amount" jdbcType="INTEGER" property="remaingShareFeeAmount" /> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`card_id`,`transaction_id`,`amount`,`remaining_amount`,`service_fee_amount`,`share_fee_amount`,`remaing_share_fee_amount`,`create_date`,`update_date` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != cardId "> | |||||
| and `card_id` = #{cardId} | |||||
| </if> | |||||
| <if test=" null != transactionId "> | |||||
| and `transaction_id` like concat('%', #{transactionId},'%') | |||||
| </if> | |||||
| <if test=" null != amount "> | |||||
| and `amount` = #{amount} | |||||
| </if> | |||||
| <if test=" null != remainingAmount "> | |||||
| and `remaining_amount` = #{remainingAmount} | |||||
| </if> | |||||
| <if test=" null != serviceFeeAmount "> | |||||
| and `service_fee_amount` = #{serviceFeeAmount} | |||||
| </if> | |||||
| <if test=" null != shareFeeAmount "> | |||||
| and `share_fee_amount` = #{shareFeeAmount} | |||||
| </if> | |||||
| <if test=" null != remaingShareFeeAmount "> | |||||
| and `remaing_share_fee_amount` = #{remaingShareFeeAmount} | |||||
| </if> | |||||
| <if test=" null != createDate "> | |||||
| and `create_date` = #{createDate} | |||||
| </if> | |||||
| <if test=" null != updateDate "> | |||||
| and `update_date` = #{updateDate} | |||||
| </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.WxCardInfo" resultMap="BaseResultMap"> | |||||
| select <include refid="allColumns" /> from wx_card_info | |||||
| <include refid="dynamicWhereConditions" /> | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -0,0 +1,76 @@ | |||||
| <?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.WxCardSpendMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCardSpend"> | |||||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||||
| <result column="card_id" jdbcType="BIGINT" property="cardId" /> | |||||
| <result column="owner_id" jdbcType="BIGINT" property="ownerId" /> | |||||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||||
| <result column="order_id" jdbcType="BIGINT" property="orderId" /> | |||||
| <result column="payment" jdbcType="INTEGER" property="payment" /> | |||||
| <result column="real_payment" jdbcType="INTEGER" property="realPayment" /> | |||||
| <result column="remain_amount" jdbcType="INTEGER" property="remainAmount" /> | |||||
| <result column="before_amount" jdbcType="INTEGER" property="beforeAmount" /> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`card_id`,`owner_id`,`merchant_id`,`order_id`,`payment`,`real_payment`,`remain_amount`,`before_amount`,`create_date`,`update_date` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != cardId "> | |||||
| and `card_id` = #{cardId} | |||||
| </if> | |||||
| <if test=" null != ownerId "> | |||||
| and `owner_id` = #{ownerId} | |||||
| </if> | |||||
| <if test=" null != merchantId "> | |||||
| and `merchant_id` = #{merchantId} | |||||
| </if> | |||||
| <if test=" null != orderId "> | |||||
| and `order_id` = #{orderId} | |||||
| </if> | |||||
| <if test=" null != payment "> | |||||
| and `payment` = #{payment} | |||||
| </if> | |||||
| <if test=" null != realPayment "> | |||||
| and `real_payment` = #{realPayment} | |||||
| </if> | |||||
| <if test=" null != remainAmount "> | |||||
| and `remain_amount` = #{remainAmount} | |||||
| </if> | |||||
| <if test=" null != beforeAmount "> | |||||
| and `before_amount` = #{beforeAmount} | |||||
| </if> | |||||
| <if test=" null != createDate "> | |||||
| and `create_date` = #{createDate} | |||||
| </if> | |||||
| <if test=" null != updateDate "> | |||||
| and `update_date` = #{updateDate} | |||||
| </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.WxCardSpend" resultMap="BaseResultMap"> | |||||
| select <include refid="allColumns" /> from wx_card_spend | |||||
| <include refid="dynamicWhereConditions" /> | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -0,0 +1,88 @@ | |||||
| <?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.WxMerchantSubsidyMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMerchantSubsidy"> | |||||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||||
| <result column="order_id" jdbcType="BIGINT" property="orderId" /> | |||||
| <result column="order_type" jdbcType="INTEGER" property="orderType" /> | |||||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||||
| <result column="coupon_order_id" jdbcType="BIGINT" property="couponOrderId" /> | |||||
| <result column="coupon_type" jdbcType="INTEGER" property="couponType" /> | |||||
| <result column="order_payment" jdbcType="INTEGER" property="orderPayment" /> | |||||
| <result column="receiver_payment" jdbcType="INTEGER" property="receiverPayment" /> | |||||
| <result column="real_payment" jdbcType="INTEGER" property="realPayment" /> | |||||
| <result column="subsidy" jdbcType="INTEGER" property="subsidy" /> | |||||
| <result column="real_subsidy" jdbcType="INTEGER" property="realSubsidy" /> | |||||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`order_id`,`order_type`,`merchant_id`,`coupon_order_id`,`coupon_type`,`order_payment`,`receiver_payment`,`real_payment`,`subsidy`,`real_subsidy`,`status`,`create_date`,`update_date` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != orderId "> | |||||
| and `order_id` = #{orderId} | |||||
| </if> | |||||
| <if test=" null != orderType "> | |||||
| and `order_type` = #{orderType} | |||||
| </if> | |||||
| <if test=" null != merchantId "> | |||||
| and `merchant_id` = #{merchantId} | |||||
| </if> | |||||
| <if test=" null != couponOrderId "> | |||||
| and `coupon_order_id` = #{couponOrderId} | |||||
| </if> | |||||
| <if test=" null != couponType "> | |||||
| and `coupon_type` = #{couponType} | |||||
| </if> | |||||
| <if test=" null != orderPayment "> | |||||
| and `order_payment` = #{orderPayment} | |||||
| </if> | |||||
| <if test=" null != receiverPayment "> | |||||
| and `receiver_payment` = #{receiverPayment} | |||||
| </if> | |||||
| <if test=" null != realPayment "> | |||||
| and `real_payment` = #{realPayment} | |||||
| </if> | |||||
| <if test=" null != subsidy "> | |||||
| and `subsidy` = #{subsidy} | |||||
| </if> | |||||
| <if test=" null != realSubsidy "> | |||||
| and `real_subsidy` = #{realSubsidy} | |||||
| </if> | |||||
| <if test=" null != status "> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != createDate "> | |||||
| and `create_date` = #{createDate} | |||||
| </if> | |||||
| <if test=" null != updateDate "> | |||||
| and `update_date` = #{updateDate} | |||||
| </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.WxMerchantSubsidy" resultMap="BaseResultMap"> | |||||
| select <include refid="allColumns" /> from wx_merchant_subsidy | |||||
| <include refid="dynamicWhereConditions" /> | |||||
| </select> | |||||
| </mapper> | |||||