用户购水卡和用户充值卡账单明细的逻辑实现
This commit is contained in:
parent
fafd3ad8d3
commit
788bfb100a
@ -70,10 +70,14 @@
|
||||
<artifactId>javase</artifactId>
|
||||
<version>3.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fastbee</groupId>
|
||||
<artifactId>fastbee-rechargecard-service</artifactId>
|
||||
<version>3.8.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.fastbee</groupId>-->
|
||||
<!-- <artifactId>fastbee-project-service</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
@ -0,0 +1,123 @@
|
||||
package com.fastbee.data.controller.userRecharge;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.enums.BusinessType;
|
||||
import com.fastbee.rechargecard.domain.UserConsumptionDetails;
|
||||
import com.fastbee.rechargecard.service.IUserConsumptionDetailsService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户充值卡账单明细记录Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rechargecard/details")
|
||||
@Api(tags = "用户充值卡账单明细记录")
|
||||
public class UserConsumptionDetailsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IUserConsumptionDetailsService userConsumptionDetailsService;
|
||||
|
||||
/**
|
||||
* 查询用户充值卡账单明细记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:details:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询用户充值卡账单明细记录列表")
|
||||
public TableDataInfo list(UserConsumptionDetails userConsumptionDetails)
|
||||
{
|
||||
startPage();
|
||||
List<UserConsumptionDetails> list = userConsumptionDetailsService.selectUserConsumptionDetailsList(userConsumptionDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户充值卡账单明细记录列表
|
||||
*/
|
||||
@ApiOperation("导出用户充值卡账单明细记录列表")
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:details:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, UserConsumptionDetails userConsumptionDetails)
|
||||
{
|
||||
List<UserConsumptionDetails> list = userConsumptionDetailsService.selectUserConsumptionDetailsList(userConsumptionDetails);
|
||||
ExcelUtil<UserConsumptionDetails> util = new ExcelUtil<UserConsumptionDetails>(UserConsumptionDetails.class);
|
||||
util.exportExcel(response, list, "用户充值卡账单明细记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户充值卡账单明细记录详细信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:details:query')")
|
||||
@GetMapping(value = "/list/{cardNumber}")
|
||||
@ApiOperation("获取用户充值卡账单明细记录详细信息列表")
|
||||
public AjaxResult getInfo(@PathVariable("cardNumber") String cardNumber)
|
||||
{
|
||||
//return success(userConsumptionDetailsService.selectUserConsumptionDetailsById(cardNumber));
|
||||
return success(userConsumptionDetailsService.selectUserConsumptionDetailsListById(cardNumber));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户充值卡账单明细记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:details:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取用户充值卡账单明细记录详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
//return success(userConsumptionDetailsService.selectUserConsumptionDetailsById(cardNumber));
|
||||
return success(userConsumptionDetailsService.selectUserConsumptionDetailsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户充值卡账单明细记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:details:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增用户充值卡账单明细记录")
|
||||
public AjaxResult add(@RequestBody UserConsumptionDetails userConsumptionDetails)
|
||||
{
|
||||
return toAjax(userConsumptionDetailsService.insertUserConsumptionDetails(userConsumptionDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户充值卡账单明细记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:details:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改用户充值卡账单明细记录")
|
||||
public AjaxResult edit(@RequestBody UserConsumptionDetails userConsumptionDetails)
|
||||
{
|
||||
return toAjax(userConsumptionDetailsService.updateUserConsumptionDetails(userConsumptionDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户充值卡账单明细记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:details:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除用户充值卡账单明细记录")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(userConsumptionDetailsService.deleteUserConsumptionDetailsByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package com.fastbee.data.controller.userRecharge;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.rechargecard.domain.UserRechargeCards;
|
||||
import com.fastbee.rechargecard.service.IUserRechargeCardsService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户充值卡Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rechargecard/cards")
|
||||
@Api(tags = "用户充值卡")
|
||||
public class UserRechargeCardsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IUserRechargeCardsService userRechargeCardsService;
|
||||
|
||||
|
||||
/**
|
||||
* 测试
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:cards:query')")
|
||||
@GetMapping(value = "/test/{id}")
|
||||
@ApiOperation("获取用户充值卡详细信息")
|
||||
public AjaxResult test(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(userRechargeCardsService.test(id));
|
||||
//return success(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户充值卡列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:cards:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询用户充值卡列表")
|
||||
public TableDataInfo list(UserRechargeCards userRechargeCards)
|
||||
{
|
||||
startPage();
|
||||
List<UserRechargeCards> list = userRechargeCardsService.selectUserRechargeCardsList(userRechargeCards);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户充值卡列表
|
||||
*/
|
||||
@ApiOperation("导出用户充值卡列表")
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:cards:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, UserRechargeCards userRechargeCards)
|
||||
{
|
||||
List<UserRechargeCards> list = userRechargeCardsService.selectUserRechargeCardsList(userRechargeCards);
|
||||
ExcelUtil<UserRechargeCards> util = new ExcelUtil<UserRechargeCards>(UserRechargeCards.class);
|
||||
util.exportExcel(response, list, "用户充值卡数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户充值卡详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:cards:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取用户充值卡详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(userRechargeCardsService.selectUserRechargeCardsById(id));
|
||||
//return success(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户充值卡
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:cards:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增用户充值卡")
|
||||
public AjaxResult add(@RequestBody UserRechargeCards userRechargeCards)
|
||||
{
|
||||
return toAjax(userRechargeCardsService.insertUserRechargeCards(userRechargeCards));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户充值卡
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:cards:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改用户充值卡")
|
||||
public AjaxResult edit(@RequestBody UserRechargeCards userRechargeCards)
|
||||
{
|
||||
return toAjax(userRechargeCardsService.updateUserRechargeCards(userRechargeCards));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户充值卡
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:cards:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除用户充值卡")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(userRechargeCardsService.deleteUserRechargeCardsByIds(ids));
|
||||
}
|
||||
}
|
@ -11,10 +11,32 @@
|
||||
|
||||
<artifactId>fastbee-rechargecard-service</artifactId>
|
||||
|
||||
<description>
|
||||
费用管理
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.fastbee</groupId>
|
||||
<artifactId>fastbee-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fastbee</groupId>
|
||||
<artifactId>fastbee-ggroup-service</artifactId>
|
||||
<version>3.8.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,145 @@
|
||||
package com.fastbee.rechargecard.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fastbee.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户充值卡账单明细记录对象 user_consumption_details
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-18
|
||||
*/
|
||||
@ApiModel(value = "UserConsumptionDetails",description = "用户充值卡账单明细记录 user_consumption_details")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserConsumptionDetails extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 关联用户 */
|
||||
@Excel(name = "关联用户")
|
||||
@ApiModelProperty("关联用户")
|
||||
private Long userId;
|
||||
|
||||
/** 设备编码 */
|
||||
@Excel(name = "设备编码")
|
||||
@ApiModelProperty("设备编码")
|
||||
private String deviceNumber;
|
||||
|
||||
/** 购水卡卡号 */
|
||||
@Excel(name = "购水卡卡号")
|
||||
@ApiModelProperty("购水卡卡号")
|
||||
private String cardNumber;
|
||||
|
||||
/** 所属项目id */
|
||||
@Excel(name = "所属项目id")
|
||||
@ApiModelProperty("所属项目id")
|
||||
private Long projectId;
|
||||
|
||||
/** 所属机构 */
|
||||
@Excel(name = "所属机构")
|
||||
@ApiModelProperty("所属机构")
|
||||
private Long deptId;
|
||||
|
||||
/** 0充值,1刷卡(灌溉消费:刷卡开泵到刷卡关泵期间产生的消费) */
|
||||
@Excel(name = "0充值,1刷卡(灌溉消费:刷卡开泵到刷卡关泵期间产生的消费)")
|
||||
@ApiModelProperty("0充值,1刷卡(灌溉消费:刷卡开泵到刷卡关泵期间产生的消费)")
|
||||
private Integer billingType;
|
||||
|
||||
/** 开泵时长 */
|
||||
@Excel(name = "开泵时长")
|
||||
@ApiModelProperty("开泵时长")
|
||||
private BigDecimal pumpTime;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
@ApiModelProperty("单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价(数量 * 单价) */
|
||||
@Excel(name = "总价", readConverterExp = "数=量,*=,单=价")
|
||||
@ApiModelProperty("总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 折扣金额 */
|
||||
@Excel(name = "折扣金额")
|
||||
@ApiModelProperty("折扣金额")
|
||||
private BigDecimal discount;
|
||||
|
||||
/** 税金 */
|
||||
@Excel(name = "税金")
|
||||
@ApiModelProperty("税金")
|
||||
private BigDecimal taxAmount;
|
||||
|
||||
/** 应付金额(总价-折扣金额-税金) */
|
||||
@Excel(name = "应付金额", readConverterExp = "总=价-折扣金额-税金")
|
||||
@ApiModelProperty("应付金额")
|
||||
private BigDecimal amountDue;
|
||||
|
||||
/** 账单所属的周期单位,0:小时、1:天、2:周、3:月、4:季度、5:年 */
|
||||
@Excel(name = "账单所属的周期单位,0:小时、1:天、2:周、3:月、4:季度、5:年")
|
||||
@ApiModelProperty("账单所属的周期单位,0:小时、1:天、2:周、3:月、4:季度、5:年")
|
||||
private Integer billingPeriodUnit;
|
||||
|
||||
/** 账单周期时长 */
|
||||
@Excel(name = "账单周期时长")
|
||||
@ApiModelProperty("账单周期时长")
|
||||
private BigDecimal billingPeriodDuration;
|
||||
|
||||
/** 账单生成的日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "账单生成的日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("账单生成的日期")
|
||||
private Date billingDate;
|
||||
|
||||
/** 开泵时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("开泵时间")
|
||||
private Date startTime;
|
||||
|
||||
/** 关泵时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("关泵时间")
|
||||
private Date endTime;
|
||||
|
||||
/** 表明账单是否已支付,0:“未支付”、1:“部分支付”、2:“已支付” */
|
||||
@Excel(name = "表明账单是否已支付,0:“未支付”、1:“部分支付”、2:“已支付”")
|
||||
@ApiModelProperty("表明账单是否已支付,0:“未支付”、1:“部分支付”、2:“已支付”")
|
||||
private Integer paymentStatus;
|
||||
|
||||
/** 用户支付账单的方式1微信,2支付宝,3银联 */
|
||||
@Excel(name = "用户支付账单的方式1微信,2支付宝,3银联")
|
||||
@ApiModelProperty("用户支付账单的方式1微信,2支付宝,3银联")
|
||||
private Integer paymentMethod;
|
||||
|
||||
/** 账单支付的时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = " 账单支付的时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(" 账单支付的时间")
|
||||
private Date paymentTime;
|
||||
|
||||
/** 账单的当前状态,0:已支付、1:已取消 */
|
||||
@Excel(name = "账单的当前状态,0:已支付、1:已取消")
|
||||
@ApiModelProperty("账单的当前状态,0:已支付、1:已取消")
|
||||
private Integer status;
|
||||
|
||||
/** 关于账单的额外信息或备注 */
|
||||
@Excel(name = "关于账单的额外信息或备注")
|
||||
@ApiModelProperty("关于账单的额外信息或备注")
|
||||
private String remarks;
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.fastbee.rechargecard.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fastbee.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户充值卡对象 user_recharge_cards
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-17
|
||||
*/
|
||||
@ApiModel(value = "UserRechargeCards",description = "用户充值卡 user_recharge_cards")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserRechargeCards extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
@ApiModelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
/** 手机号 */
|
||||
@Excel(name = "手机号")
|
||||
@ApiModelProperty("手机号")
|
||||
private String phone;
|
||||
|
||||
/** 所属项目ID */
|
||||
@Excel(name = "所属项目ID")
|
||||
@ApiModelProperty("所属项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/** 所属机构ID */
|
||||
@Excel(name = "所属机构ID")
|
||||
@ApiModelProperty("所属机构ID")
|
||||
private Long deptId;
|
||||
|
||||
/** 账户余额 */
|
||||
@Excel(name = "账户余额")
|
||||
@ApiModelProperty("账户余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 充值卡号 */
|
||||
@Excel(name = "充值卡号")
|
||||
@ApiModelProperty("充值卡号")
|
||||
private String cardNumber;
|
||||
|
||||
/** 充值卡密码 */
|
||||
@Excel(name = "充值卡密码")
|
||||
@ApiModelProperty("充值卡密码")
|
||||
private String cardPassword;
|
||||
|
||||
/** 发行日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "发行日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("发行日期")
|
||||
private Date issueDate;
|
||||
|
||||
/** 有效期至 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "有效期至", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("有效期至")
|
||||
private Date expirationDate;
|
||||
|
||||
/** 状态,如:0正常使用,1禁用 */
|
||||
@Excel(name = "状态,如:0正常使用,1禁用")
|
||||
@ApiModelProperty("状态,如:0正常使用,1禁用")
|
||||
private Integer status;
|
||||
|
||||
/** 逻辑删除标志,0存在,2已删除 */
|
||||
private Integer delFlag;
|
||||
|
||||
/** 终端用户id */
|
||||
@Excel(name = "终端用户id")
|
||||
@ApiModelProperty("终端用户id")
|
||||
private Long userId;
|
||||
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package com.fastbee.rechargecard.domain;
|
||||
|
||||
public class test {
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.fastbee.rechargecard.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.rechargecard.domain.UserConsumptionDetails;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户充值卡账单明细记录Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserConsumptionDetailsMapper
|
||||
{
|
||||
/**
|
||||
* 根据卡号查询用户充值卡账单明细记录列表
|
||||
* @param cardNumber
|
||||
* @return
|
||||
*/
|
||||
public List<UserConsumptionDetails> selectUserConsumptionDetailsListById(String cardNumber);
|
||||
/**
|
||||
* 查询用户充值卡账单明细记录
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public UserConsumptionDetails selectUserConsumptionDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户充值卡账单明细记录列表
|
||||
*
|
||||
* @param userConsumptionDetails 用户充值卡账单明细记录
|
||||
* @return 用户充值卡账单明细记录集合
|
||||
*/
|
||||
public List<UserConsumptionDetails> selectUserConsumptionDetailsList(UserConsumptionDetails userConsumptionDetails);
|
||||
|
||||
/**
|
||||
* 新增用户充值卡账单明细记录
|
||||
*
|
||||
* @param userConsumptionDetails 用户充值卡账单明细记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUserConsumptionDetails(UserConsumptionDetails userConsumptionDetails);
|
||||
|
||||
/**
|
||||
* 修改用户充值卡账单明细记录
|
||||
*
|
||||
* @param userConsumptionDetails 用户充值卡账单明细记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserConsumptionDetails(UserConsumptionDetails userConsumptionDetails);
|
||||
|
||||
/**
|
||||
* 删除用户充值卡账单明细记录
|
||||
*
|
||||
* @param id 用户充值卡账单明细记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserConsumptionDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户充值卡账单明细记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserConsumptionDetailsByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.fastbee.rechargecard.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.rechargecard.domain.UserRechargeCards;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 用户充值卡Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-17
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserRechargeCardsMapper extends MPJBaseMapper<UserRechargeCards>
|
||||
{
|
||||
/**
|
||||
* 测试方法
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public Long test(Long id);
|
||||
/**
|
||||
* 查询用户充值卡
|
||||
*
|
||||
* @param id 用户充值卡主键
|
||||
* @return 用户充值卡
|
||||
*/
|
||||
public UserRechargeCards selectUserRechargeCardsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户充值卡列表
|
||||
*
|
||||
* @param userRechargeCards 用户充值卡
|
||||
* @return 用户充值卡集合
|
||||
*/
|
||||
public List<UserRechargeCards> selectUserRechargeCardsList(UserRechargeCards userRechargeCards);
|
||||
|
||||
/**
|
||||
* 新增用户充值卡
|
||||
*
|
||||
* @param userRechargeCards 用户充值卡
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUserRechargeCards(UserRechargeCards userRechargeCards);
|
||||
|
||||
/**
|
||||
* 修改用户充值卡
|
||||
*
|
||||
* @param userRechargeCards 用户充值卡
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserRechargeCards(UserRechargeCards userRechargeCards);
|
||||
|
||||
/**
|
||||
* 删除用户充值卡
|
||||
*
|
||||
* @param id 用户充值卡主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserRechargeCardsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户充值卡
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserRechargeCardsByIds(Long[] ids);
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package com.fastbee.rechargecard.mapper;
|
||||
|
||||
public interface test {
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.fastbee.rechargecard.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.rechargecard.domain.UserConsumptionDetails;
|
||||
|
||||
/**
|
||||
* 用户充值卡账单明细记录Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-18
|
||||
*/
|
||||
public interface IUserConsumptionDetailsService
|
||||
{
|
||||
/**
|
||||
* 根据卡号查询用户充值卡账单明细记录列表
|
||||
*
|
||||
* @param cardNumber 卡号
|
||||
* @return 用户充值卡账单明细记录
|
||||
*/
|
||||
public List<UserConsumptionDetails> selectUserConsumptionDetailsListById(String cardNumber);
|
||||
|
||||
/**
|
||||
* 查询用户充值卡账单明细记录
|
||||
*
|
||||
* @param id 用户充值卡账单明细记录主键
|
||||
* @return 用户充值卡账单明细记录
|
||||
*/
|
||||
public UserConsumptionDetails selectUserConsumptionDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户充值卡账单明细记录列表
|
||||
*
|
||||
* @param userConsumptionDetails 用户充值卡账单明细记录
|
||||
* @return 用户充值卡账单明细记录集合
|
||||
*/
|
||||
public List<UserConsumptionDetails> selectUserConsumptionDetailsList(UserConsumptionDetails userConsumptionDetails);
|
||||
|
||||
/**
|
||||
* 新增用户充值卡账单明细记录
|
||||
*
|
||||
* @param userConsumptionDetails 用户充值卡账单明细记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUserConsumptionDetails(UserConsumptionDetails userConsumptionDetails);
|
||||
|
||||
/**
|
||||
* 修改用户充值卡账单明细记录
|
||||
*
|
||||
* @param userConsumptionDetails 用户充值卡账单明细记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserConsumptionDetails(UserConsumptionDetails userConsumptionDetails);
|
||||
|
||||
/**
|
||||
* 批量删除用户充值卡账单明细记录
|
||||
*
|
||||
* @param ids 需要删除的用户充值卡账单明细记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserConsumptionDetailsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除用户充值卡账单明细记录信息
|
||||
*
|
||||
* @param id 用户充值卡账单明细记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserConsumptionDetailsById(Long id);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.fastbee.rechargecard.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.rechargecard.domain.UserRechargeCards;
|
||||
|
||||
/**
|
||||
* 用户充值卡Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-17
|
||||
*/
|
||||
|
||||
public interface IUserRechargeCardsService
|
||||
{
|
||||
|
||||
public Long test(Long id);
|
||||
/**
|
||||
* 查询用户充值卡
|
||||
*
|
||||
* @param id 用户充值卡主键
|
||||
* @return 用户充值卡
|
||||
*/
|
||||
public UserRechargeCards selectUserRechargeCardsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户充值卡列表
|
||||
*
|
||||
* @param userRechargeCards 用户充值卡
|
||||
* @return 用户充值卡集合
|
||||
*/
|
||||
public List<UserRechargeCards> selectUserRechargeCardsList(UserRechargeCards userRechargeCards);
|
||||
|
||||
/**
|
||||
* 新增用户充值卡
|
||||
*
|
||||
* @param userRechargeCards 用户充值卡
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUserRechargeCards(UserRechargeCards userRechargeCards);
|
||||
|
||||
/**
|
||||
* 修改用户充值卡
|
||||
*
|
||||
* @param userRechargeCards 用户充值卡
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserRechargeCards(UserRechargeCards userRechargeCards);
|
||||
|
||||
/**
|
||||
* 批量删除用户充值卡
|
||||
*
|
||||
* @param ids 需要删除的用户充值卡主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserRechargeCardsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除用户充值卡信息
|
||||
*
|
||||
* @param id 用户充值卡主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserRechargeCardsById(Long id);
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.fastbee.rechargecard.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fastbee.rechargecard.mapper.UserConsumptionDetailsMapper;
|
||||
import com.fastbee.rechargecard.domain.UserConsumptionDetails;
|
||||
import com.fastbee.rechargecard.service.IUserConsumptionDetailsService;
|
||||
|
||||
/**
|
||||
* 用户充值卡账单明细记录Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-18
|
||||
*/
|
||||
@Service
|
||||
public class UserConsumptionDetailsServiceImpl implements IUserConsumptionDetailsService
|
||||
{
|
||||
@Autowired
|
||||
private UserConsumptionDetailsMapper userConsumptionDetailsMapper;
|
||||
|
||||
/**
|
||||
* 根据卡号查询用户充值卡账单明细记录列表
|
||||
*
|
||||
* @param cardNumber 用户充值卡号
|
||||
* @return 用户充值卡账单明细记录
|
||||
*/
|
||||
@Override
|
||||
public List<UserConsumptionDetails> selectUserConsumptionDetailsListById(String cardNumber)
|
||||
{
|
||||
return userConsumptionDetailsMapper.selectUserConsumptionDetailsListById(cardNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户充值卡账单明细记录
|
||||
*
|
||||
* @param id 用户充值卡账单明细记录主键
|
||||
* @return 用户充值卡账单明细记录
|
||||
*/
|
||||
@Override
|
||||
public UserConsumptionDetails selectUserConsumptionDetailsById(Long id)
|
||||
{
|
||||
return userConsumptionDetailsMapper.selectUserConsumptionDetailsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户充值卡账单明细记录列表
|
||||
*
|
||||
* @param userConsumptionDetails 用户充值卡账单明细记录
|
||||
* @return 用户充值卡账单明细记录
|
||||
*/
|
||||
@Override
|
||||
public List<UserConsumptionDetails> selectUserConsumptionDetailsList(UserConsumptionDetails userConsumptionDetails)
|
||||
{
|
||||
return userConsumptionDetailsMapper.selectUserConsumptionDetailsList(userConsumptionDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户充值卡账单明细记录
|
||||
*
|
||||
* @param userConsumptionDetails 用户充值卡账单明细记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertUserConsumptionDetails(UserConsumptionDetails userConsumptionDetails)
|
||||
{
|
||||
userConsumptionDetails.setCreateTime(DateUtils.getNowDate());
|
||||
return userConsumptionDetailsMapper.insertUserConsumptionDetails(userConsumptionDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户充值卡账单明细记录
|
||||
*
|
||||
* @param userConsumptionDetails 用户充值卡账单明细记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUserConsumptionDetails(UserConsumptionDetails userConsumptionDetails)
|
||||
{
|
||||
userConsumptionDetails.setUpdateTime(DateUtils.getNowDate());
|
||||
return userConsumptionDetailsMapper.updateUserConsumptionDetails(userConsumptionDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户充值卡账单明细记录
|
||||
*
|
||||
* @param ids 需要删除的用户充值卡账单明细记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUserConsumptionDetailsByIds(Long[] ids)
|
||||
{
|
||||
return userConsumptionDetailsMapper.deleteUserConsumptionDetailsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户充值卡账单明细记录信息
|
||||
*
|
||||
* @param id 用户充值卡账单明细记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUserConsumptionDetailsById(Long id)
|
||||
{
|
||||
return userConsumptionDetailsMapper.deleteUserConsumptionDetailsById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.fastbee.rechargecard.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.lang.Console;
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fastbee.rechargecard.mapper.UserRechargeCardsMapper;
|
||||
import com.fastbee.rechargecard.domain.UserRechargeCards;
|
||||
import com.fastbee.rechargecard.service.IUserRechargeCardsService;
|
||||
|
||||
/**
|
||||
* 用户充值卡Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-17
|
||||
*/
|
||||
@Service
|
||||
public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
|
||||
{
|
||||
/*@Autowired
|
||||
private UserRechargeCardsMapper userRechargeCardsMapper;*/
|
||||
@Autowired
|
||||
private UserRechargeCardsMapper userRechargeCardsMapper;
|
||||
|
||||
@Override
|
||||
public Long test(Long id) {
|
||||
return userRechargeCardsMapper.test(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户充值卡
|
||||
*
|
||||
* @param id 用户充值卡主键
|
||||
* @return 用户充值卡
|
||||
*/
|
||||
@Override
|
||||
public UserRechargeCards selectUserRechargeCardsById(Long id)
|
||||
{
|
||||
//return userRechargeCardsMapper.selectUserRechargeCardsById(id);
|
||||
//return id;
|
||||
System.out.println("selectUserRechargeCardsById");
|
||||
UserRechargeCards info=userRechargeCardsMapper.selectUserRechargeCardsById(id);
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户充值卡列表
|
||||
*
|
||||
* @param userRechargeCards 用户充值卡
|
||||
* @return 用户充值卡
|
||||
*/
|
||||
@Override
|
||||
public List<UserRechargeCards> selectUserRechargeCardsList(UserRechargeCards userRechargeCards)
|
||||
{
|
||||
return userRechargeCardsMapper.selectUserRechargeCardsList(userRechargeCards);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户充值卡
|
||||
*
|
||||
* @param userRechargeCards 用户充值卡
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertUserRechargeCards(UserRechargeCards userRechargeCards)
|
||||
{
|
||||
userRechargeCards.setCreateTime(DateUtils.getNowDate());
|
||||
return userRechargeCardsMapper.insertUserRechargeCards(userRechargeCards);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户充值卡
|
||||
*
|
||||
* @param userRechargeCards 用户充值卡
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUserRechargeCards(UserRechargeCards userRechargeCards)
|
||||
{
|
||||
userRechargeCards.setUpdateTime(DateUtils.getNowDate());
|
||||
return userRechargeCardsMapper.updateUserRechargeCards(userRechargeCards);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户充值卡
|
||||
*
|
||||
* @param ids 需要删除的用户充值卡主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUserRechargeCardsByIds(Long[] ids)
|
||||
{
|
||||
return userRechargeCardsMapper.deleteUserRechargeCardsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户充值卡信息
|
||||
*
|
||||
* @param id 用户充值卡主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUserRechargeCardsById(Long id)
|
||||
{
|
||||
return userRechargeCardsMapper.deleteUserRechargeCardsById(id);
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package com.fastbee.rechargecard.service.impl;
|
||||
|
||||
public class testImpl {
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package com.fastbee.rechargecard.service;
|
||||
|
||||
public interface test {
|
||||
}
|
@ -0,0 +1,184 @@
|
||||
<?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.fastbee.rechargecard.mapper.UserConsumptionDetailsMapper">
|
||||
|
||||
<resultMap type="UserConsumptionDetails" id="UserConsumptionDetailsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="deviceNumber" column="device_number" />
|
||||
<result property="cardNumber" column="card_number" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="billingType" column="billing_type" />
|
||||
<result property="pumpTime" column="pump_time" />
|
||||
<result property="unitPrice" column="unit_price" />
|
||||
<result property="totalPrice" column="total_price" />
|
||||
<result property="discount" column="discount" />
|
||||
<result property="taxAmount" column="tax_amount" />
|
||||
<result property="amountDue" column="amount_due" />
|
||||
<result property="billingPeriodUnit" column="billing_period_unit" />
|
||||
<result property="billingPeriodDuration" column="billing_period_duration" />
|
||||
<result property="billingDate" column="billing_date" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="paymentStatus" column="payment_status" />
|
||||
<result property="paymentMethod" column="payment_method" />
|
||||
<result property="paymentTime" column="payment_time" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remarks" column="remarks" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserConsumptionDetailsVo">
|
||||
select id, user_id, device_number, card_number, project_id, dept_id, billing_type, pump_time, unit_price, total_price, discount, tax_amount, amount_due, billing_period_unit, billing_period_duration, billing_date, start_time, end_time, payment_status, payment_method, payment_time, status, remarks, create_time, update_time, create_by, update_by from user_consumption_details
|
||||
</sql>
|
||||
|
||||
<select id="selectUserConsumptionDetailsList" parameterType="UserConsumptionDetails" resultMap="UserConsumptionDetailsResult">
|
||||
<include refid="selectUserConsumptionDetailsVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="deviceNumber != null and deviceNumber != ''"> and device_number = #{deviceNumber}</if>
|
||||
<if test="cardNumber != null and cardNumber != ''"> and card_number = #{cardNumber}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="billingType != null "> and billing_type = #{billingType}</if>
|
||||
<if test="pumpTime != null "> and pump_time = #{pumpTime}</if>
|
||||
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
|
||||
<if test="totalPrice != null "> and total_price = #{totalPrice}</if>
|
||||
<if test="discount != null "> and discount = #{discount}</if>
|
||||
<if test="taxAmount != null "> and tax_amount = #{taxAmount}</if>
|
||||
<if test="amountDue != null "> and amount_due = #{amountDue}</if>
|
||||
<if test="billingPeriodUnit != null "> and billing_period_unit = #{billingPeriodUnit}</if>
|
||||
<if test="billingPeriodDuration != null "> and billing_period_duration = #{billingPeriodDuration}</if>
|
||||
<if test="billingDate != null "> and billing_date = #{billingDate}</if>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
<if test="paymentStatus != null "> and payment_status = #{paymentStatus}</if>
|
||||
<if test="paymentMethod != null "> and payment_method = #{paymentMethod}</if>
|
||||
<if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectUserConsumptionDetailsById" parameterType="Long" resultMap="UserConsumptionDetailsResult">
|
||||
<include refid="selectUserConsumptionDetailsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectUserConsumptionDetailsListById" parameterType="String" resultMap="UserConsumptionDetailsResult">
|
||||
<include refid="selectUserConsumptionDetailsVo"/>
|
||||
<where>
|
||||
card_number=#{cardNumber}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertUserConsumptionDetails" parameterType="UserConsumptionDetails" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into user_consumption_details
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="deviceNumber != null">device_number,</if>
|
||||
<if test="cardNumber != null">card_number,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="billingType != null">billing_type,</if>
|
||||
<if test="pumpTime != null">pump_time,</if>
|
||||
<if test="unitPrice != null">unit_price,</if>
|
||||
<if test="totalPrice != null">total_price,</if>
|
||||
<if test="discount != null">discount,</if>
|
||||
<if test="taxAmount != null">tax_amount,</if>
|
||||
<if test="amountDue != null">amount_due,</if>
|
||||
<if test="billingPeriodUnit != null">billing_period_unit,</if>
|
||||
<if test="billingPeriodDuration != null">billing_period_duration,</if>
|
||||
<if test="billingDate != null">billing_date,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="paymentStatus != null">payment_status,</if>
|
||||
<if test="paymentMethod != null">payment_method,</if>
|
||||
<if test="paymentTime != null">payment_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remarks != null">remarks,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="deviceNumber != null">#{deviceNumber},</if>
|
||||
<if test="cardNumber != null">#{cardNumber},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="billingType != null">#{billingType},</if>
|
||||
<if test="pumpTime != null">#{pumpTime},</if>
|
||||
<if test="unitPrice != null">#{unitPrice},</if>
|
||||
<if test="totalPrice != null">#{totalPrice},</if>
|
||||
<if test="discount != null">#{discount},</if>
|
||||
<if test="taxAmount != null">#{taxAmount},</if>
|
||||
<if test="amountDue != null">#{amountDue},</if>
|
||||
<if test="billingPeriodUnit != null">#{billingPeriodUnit},</if>
|
||||
<if test="billingPeriodDuration != null">#{billingPeriodDuration},</if>
|
||||
<if test="billingDate != null">#{billingDate},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="paymentStatus != null">#{paymentStatus},</if>
|
||||
<if test="paymentMethod != null">#{paymentMethod},</if>
|
||||
<if test="paymentTime != null">#{paymentTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remarks != null">#{remarks},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateUserConsumptionDetails" parameterType="UserConsumptionDetails">
|
||||
update user_consumption_details
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="deviceNumber != null">device_number = #{deviceNumber},</if>
|
||||
<if test="cardNumber != null">card_number = #{cardNumber},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="billingType != null">billing_type = #{billingType},</if>
|
||||
<if test="pumpTime != null">pump_time = #{pumpTime},</if>
|
||||
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
||||
<if test="totalPrice != null">total_price = #{totalPrice},</if>
|
||||
<if test="discount != null">discount = #{discount},</if>
|
||||
<if test="taxAmount != null">tax_amount = #{taxAmount},</if>
|
||||
<if test="amountDue != null">amount_due = #{amountDue},</if>
|
||||
<if test="billingPeriodUnit != null">billing_period_unit = #{billingPeriodUnit},</if>
|
||||
<if test="billingPeriodDuration != null">billing_period_duration = #{billingPeriodDuration},</if>
|
||||
<if test="billingDate != null">billing_date = #{billingDate},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="paymentStatus != null">payment_status = #{paymentStatus},</if>
|
||||
<if test="paymentMethod != null">payment_method = #{paymentMethod},</if>
|
||||
<if test="paymentTime != null">payment_time = #{paymentTime},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remarks != null">remarks = #{remarks},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserConsumptionDetailsById" parameterType="Long">
|
||||
delete from user_consumption_details where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserConsumptionDetailsByIds" parameterType="String">
|
||||
delete from user_consumption_details where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,131 @@
|
||||
<?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.fastbee.rechargecard.mapper.UserRechargeCardsMapper">
|
||||
|
||||
<resultMap type="UserRechargeCards" id="UserRechargeCardsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="name" column="name" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="cardNumber" column="card_number" />
|
||||
<result property="cardPassword" column="card_password" />
|
||||
<result property="issueDate" column="issue_date" />
|
||||
<result property="expirationDate" column="expiration_date" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="userId" column="user_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserRechargeCardsVo">
|
||||
select id, user_name, name, phone, project_id, dept_id, balance, card_number, card_password, issue_date, expiration_date, status, create_time, update_time, create_by, update_by, del_flag, user_id from user_recharge_cards
|
||||
</sql>
|
||||
|
||||
<select id="selectUserRechargeCardsList" parameterType="UserRechargeCards" resultMap="UserRechargeCardsResult">
|
||||
<include refid="selectUserRechargeCardsVo"/>
|
||||
<where>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="balance != null "> and balance = #{balance}</if>
|
||||
<if test="cardNumber != null and cardNumber != ''"> and card_number = #{cardNumber}</if>
|
||||
<if test="cardPassword != null and cardPassword != ''"> and card_password = #{cardPassword}</if>
|
||||
<if test="issueDate != null "> and issue_date = #{issueDate}</if>
|
||||
<if test="expirationDate != null "> and expiration_date = #{expirationDate}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectUserRechargeCardsById" parameterType="Long" resultMap="UserRechargeCardsResult">
|
||||
<include refid="selectUserRechargeCardsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertUserRechargeCards" parameterType="UserRechargeCards" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into user_recharge_cards
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="balance != null">balance,</if>
|
||||
<if test="cardNumber != null">card_number,</if>
|
||||
<if test="cardPassword != null">card_password,</if>
|
||||
<if test="issueDate != null">issue_date,</if>
|
||||
<if test="expirationDate != null">expiration_date,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="balance != null">#{balance},</if>
|
||||
<if test="cardNumber != null">#{cardNumber},</if>
|
||||
<if test="cardPassword != null">#{cardPassword},</if>
|
||||
<if test="issueDate != null">#{issueDate},</if>
|
||||
<if test="expirationDate != null">#{expirationDate},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateUserRechargeCards" parameterType="UserRechargeCards">
|
||||
update user_recharge_cards
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="balance != null">balance = #{balance},</if>
|
||||
<if test="cardNumber != null">card_number = #{cardNumber},</if>
|
||||
<if test="cardPassword != null">card_password = #{cardPassword},</if>
|
||||
<if test="issueDate != null">issue_date = #{issueDate},</if>
|
||||
<if test="expirationDate != null">expiration_date = #{expirationDate},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserRechargeCardsById" parameterType="Long">
|
||||
delete from user_recharge_cards where user_id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserRechargeCardsByIds" parameterType="String">
|
||||
delete from user_recharge_cards where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user