添加区域码和设备编码字段

This commit is contained in:
ALEI_ALEI 2024-12-19 19:54:34 +08:00
parent 5d8e9db6c1
commit d3aedb6399
13 changed files with 92 additions and 50 deletions

View File

@ -30,12 +30,12 @@ public class UserRechargeController extends BaseController {
/** /**
* 修改用户充值卡金额 * 修改用户充值卡金额
*/ */
@PreAuthorize("@ss.hasPermi('rechargecard:cards:edit')") /*@PreAuthorize("@ss.hasPermi('rechargecard:cards:edit')")
@PutMapping @PutMapping
@ApiOperation("修改用户充值卡") @ApiOperation("修改用户充值卡")
public AjaxResult result(@RequestBody RechargecardUser rechargecardUser) public AjaxResult result(@RequestBody RechargecardUser rechargecardUser)
{ {
return toAjax(userRechargeCardsService.updateUserRecharge(rechargecardUser)); return toAjax(userRechargeCardsService.updateUserRecharge(rechargecardUser));
} }*/
} }

View File

@ -84,4 +84,19 @@ public class NgUserRechargeRecords extends BaseEntity
@ApiModelProperty("充值机编码") @ApiModelProperty("充值机编码")
private String serialNumber; private String serialNumber;
/** 设备编码 */
@Excel(name = "设备编码")
@ApiModelProperty("设备编码")
private String deviceNumber;
/** 项目编码 */
@Excel(name = "项目编码")
@ApiModelProperty("项目编码")
private Long projectId;
/** 机构id */
@Excel(name = "机构id")
@ApiModelProperty("机构id")
private Long deptId;
} }

View File

@ -5,7 +5,6 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
@ -17,12 +16,11 @@ import com.fastbee.common.core.domain.BaseEntity;
* 用户充值卡账单明细记录对象 user_consumption_details * 用户充值卡账单明细记录对象 user_consumption_details
* *
* @author kerwincui * @author kerwincui
* @date 2024-12-18 * @date 2024-12-19
*/ */
@ApiModel(value = "UserConsumptionDetails",description = "用户充值卡账单明细记录 user_consumption_details") @ApiModel(value = "UserConsumptionDetails",description = "用户充值卡账单明细记录 user_consumption_details")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Builder
public class UserConsumptionDetails extends BaseEntity public class UserConsumptionDetails extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -101,19 +99,19 @@ public class UserConsumptionDetails extends BaseEntity
private BigDecimal billingPeriodDuration; private BigDecimal billingPeriodDuration;
/** 账单生成的日期 */ /** 账单生成的日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "账单生成的日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "账单生成的日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("账单生成的日期") @ApiModelProperty("账单生成的日期")
private Date billingDate; private Date billingDate;
/** 开泵时间 */ /** 开泵时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("开泵时间") @ApiModelProperty("开泵时间")
private Date startTime; private Date startTime;
/** 关泵时间 */ /** 关泵时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("关泵时间") @ApiModelProperty("关泵时间")
private Date endTime; private Date endTime;
@ -129,7 +127,7 @@ public class UserConsumptionDetails extends BaseEntity
private Integer paymentMethod; private Integer paymentMethod;
/** 账单支付的时间 */ /** 账单支付的时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = " 账单支付的时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = " 账单支付的时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(" 账单支付的时间") @ApiModelProperty(" 账单支付的时间")
private Date paymentTime; private Date paymentTime;
@ -139,9 +137,9 @@ public class UserConsumptionDetails extends BaseEntity
@ApiModelProperty("账单的当前状态0已支付、1已取消") @ApiModelProperty("账单的当前状态0已支付、1已取消")
private Integer status; private Integer status;
/** 关于账单的额外信息或备注 */ /** 区域码 */
@Excel(name = "关于账单的额外信息或备注") @Excel(name = "区域码")
@ApiModelProperty("关于账单的额外信息或备注") @ApiModelProperty("区域码")
private String remark; private String areaCode;
} }

View File

@ -20,6 +20,13 @@ public interface NgIrrigationControllersMapper
* @return 灌溉控制器信息 * @return 灌溉控制器信息
*/ */
public NgIrrigationControllers selectNgIrrigationControllersById(Long id); public NgIrrigationControllers selectNgIrrigationControllersById(Long id);
/**
* 查询灌溉控制器信息
*
* @param serialNumber 灌溉控制器编码
* @return 灌溉控制器信息
*/
public NgIrrigationControllers selectNgIrrigationControllersBySerialNumber(String serialNumber);
/** /**
* 查询灌溉控制器信息列表 * 查询灌溉控制器信息列表

View File

@ -28,6 +28,13 @@ public interface UserRechargeCardsMapper extends MPJBaseMapper<UserRechargeCards
* @return 用户充值卡 * @return 用户充值卡
*/ */
public UserRechargeCards selectUserRechargeCardsById(Long id); public UserRechargeCards selectUserRechargeCardsById(Long id);
/**
* 查询用户充值卡
*
* @param cardNumber
* @return 用户充值卡
*/
public UserRechargeCards selectUserRechargeCardsByCardNumber(String cardNumber);
/** /**
* card_number查询用户充值卡 * card_number查询用户充值卡

View File

@ -69,5 +69,5 @@ public interface IUserRechargeCardsService
* @return 结果 * @return 结果
*/ */
public int updateUserRecharge(RechargecardUser rechargecardUser); /*public int updateUserRecharge(RechargecardUser rechargecardUser);*/
} }

View File

@ -54,6 +54,8 @@ public class NgUserRechargeRecordsServiceImpl implements INgUserRechargeRecordsS
public int insertNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords) public int insertNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords)
{ {
ngUserRechargeRecords.setCreateTime(DateUtils.getNowDate()); ngUserRechargeRecords.setCreateTime(DateUtils.getNowDate());
ngUserRechargeRecordsMapper.insertNgUserRechargeRecords(ngUserRechargeRecords);
return ngUserRechargeRecordsMapper.insertNgUserRechargeRecords(ngUserRechargeRecords); return ngUserRechargeRecordsMapper.insertNgUserRechargeRecords(ngUserRechargeRecords);
} }

View File

@ -5,7 +5,9 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.fastbee.common.utils.DateUtils; import com.fastbee.common.utils.DateUtils;
import com.fastbee.iot.mapper.DeviceMapper; import com.fastbee.iot.mapper.DeviceMapper;
import com.fastbee.rechargecard.domain.NgIrrigationControllers;
import com.fastbee.rechargecard.domain.dto.UserIrrigationRecordDto; import com.fastbee.rechargecard.domain.dto.UserIrrigationRecordDto;
import com.fastbee.rechargecard.mapper.NgIrrigationControllersMapper;
import com.fastbee.system.mapper.SysUserMapper; import com.fastbee.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -27,7 +29,8 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
@Autowired @Autowired
private SysUserMapper sysUserMapper; private SysUserMapper sysUserMapper;
@Autowired @Autowired
private DeviceMapper deviceMapper; private NgIrrigationControllersMapper ngIrrigationControllersMapper;
@Override @Override
public List<UserIrrigationRecordDto> selectUserIrrigationRecordShowList(UserIrrigationRecord userIrrigationRecord) { public List<UserIrrigationRecordDto> selectUserIrrigationRecordShowList(UserIrrigationRecord userIrrigationRecord) {
@ -38,7 +41,7 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
UserIrrigationRecordDto temp=new UserIrrigationRecordDto(); UserIrrigationRecordDto temp=new UserIrrigationRecordDto();
temp.id=list.get(i).getId(); temp.id=list.get(i).getId();
temp.userName= sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName()==null ? "" :sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName(); temp.userName= sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName()==null ? "" :sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName();
temp.deviceName=deviceMapper.selectDeviceBySerialNumber(list.get(i).getDeviceNumber()).getDeviceName() == null ? "":deviceMapper.selectDeviceBySerialNumber(list.get(i).getDeviceNumber()).getDeviceName(); temp.deviceName=ngIrrigationControllersMapper.selectNgIrrigationControllersBySerialNumber(list.get(i).getDeviceNumber()).getControllerName() == null ? "":ngIrrigationControllersMapper.selectNgIrrigationControllersBySerialNumber(list.get(i).getDeviceNumber()).getControllerName();
temp.cardNumber=list.get(i).getCardNumber() == null ? "" : list.get(i).getCardNumber(); temp.cardNumber=list.get(i).getCardNumber() == null ? "" : list.get(i).getCardNumber();
temp.flow=list.get(i).getCurFlow()==null ? BigDecimal.valueOf(0) :list.get(i).getCurFlow(); temp.flow=list.get(i).getCurFlow()==null ? BigDecimal.valueOf(0) :list.get(i).getCurFlow();
temp.startTime=list.get(i).getStartTime()==null ? null : list.get(i).getStartTime(); temp.startTime=list.get(i).getStartTime()==null ? null : list.get(i).getStartTime();
@ -65,7 +68,7 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
UserIrrigationRecordDto temp=new UserIrrigationRecordDto(); UserIrrigationRecordDto temp=new UserIrrigationRecordDto();
temp.id=list.get(i).getId(); temp.id=list.get(i).getId();
temp.userName= sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName(); temp.userName= sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName();
temp.deviceName=deviceMapper.selectDeviceBySerialNumber(list.get(i).getDeviceNumber()).getDeviceName(); temp.deviceName=ngIrrigationControllersMapper.selectNgIrrigationControllersBySerialNumber(list.get(i).getDeviceNumber()).getControllerName();
temp.cardNumber=list.get(i).getCardNumber(); temp.cardNumber=list.get(i).getCardNumber();
temp.flow=list.get(i).getCurFlow(); temp.flow=list.get(i).getCurFlow();
temp.startTime=list.get(i).getStartTime(); temp.startTime=list.get(i).getStartTime();

View File

@ -116,7 +116,7 @@ public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
* *
* @return 结果 * @return 结果
*/ */
@Override /*@Override
public int updateUserRecharge(RechargecardUser rechargecardUser){ public int updateUserRecharge(RechargecardUser rechargecardUser){
// 根据id查询用户充值卡信息 // 根据id查询用户充值卡信息
@ -127,34 +127,17 @@ public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
} }
// 计算新的余额 // 计算新的余额
BigDecimal newBalance = rechargecardUser.getNumber().add(info.getBalance()); BigDecimal newBalance = rechargecardUser.getNumber().add(info.getBalance());
UserConsumptionDetails userConsumptionDetails = UserConsumptionDetails.builder() UserConsumptionDetails userConsumptionDetails= UserConsumptionDetails.builder()
.userId(info.getUserId()) .userId(info.getUserId()).deviceNumber(null).cardNumber(info.getCardNumber())
.deviceNumber(null) // 确保业务逻辑可以处理 null .projectId(null).deptId(null).billingType(0).pumpTime(null).unitPrice(null).totalPrice(null)
.cardNumber(info.getCardNumber()) .discount(null).taxAmount(null).amountDue(rechargecardUser.getNumber()).billingPeriodUnit(null).billingPeriodDuration(null)
.projectId(null) // 确保业务逻辑可以处理 null .billingDate(DateUtils.getNowDate()).startTime(null).endTime(null).paymentStatus(2).paymentMethod(rechargecardUser.getStatus())
.deptId(null) // 确保业务逻辑可以处理 null .paymentTime(DateUtils.getNowDate()).status(0).remark(null);
.billingType(0)
.pumpTime(null) // 确保业务逻辑可以处理 null
.unitPrice(null) // 确保业务逻辑可以处理 null
.totalPrice(null) // 确保业务逻辑可以处理 null
.discount(null) // 确保业务逻辑可以处理 null
.taxAmount(null) // 确保业务逻辑可以处理 null
.amountDue(rechargecardUser.getNumber())
.billingPeriodUnit(null) // 确保业务逻辑可以处理 null
.billingPeriodDuration(null) // 确保业务逻辑可以处理 null
.billingDate(DateUtils.getNowDate()) // 获取当前日期
.startTime(null) // 确保业务逻辑可以处理 null
.endTime(null) // 确保业务逻辑可以处理 null
.paymentStatus(2)
.paymentMethod(rechargecardUser.getStatus())
.paymentTime(DateUtils.getNowDate()) // 获取当前日期
.status(0)
.remark(null) // 确保业务逻辑可以处理 null
.build();
userConsumptionDetailsMapper.insertUserConsumptionDetails(userConsumptionDetails); userConsumptionDetailsMapper.insertUserConsumptionDetails(userConsumptionDetails);
// 更新用户充值卡信息包括新的余额 // 更新用户充值卡信息包括新的余额
info.setBalance(newBalance); info.setBalance(newBalance);
info.setUpdateTime(DateUtils.getNowDate()); info.setUpdateTime(DateUtils.getNowDate());
return userRechargeCardsMapper.updateUserRechargeCards(info); return userRechargeCardsMapper.updateUserRechargeCards(info);
} }*/
} }

View File

@ -42,6 +42,12 @@
where id = #{id} where id = #{id}
</select> </select>
<select id="selectNgIrrigationControllersBySerialNumber" parameterType="String" resultMap="NgIrrigationControllersResult">
<include refid="selectNgIrrigationControllersVo"/>
where serial_number = #{serialNumber}
</select>
<insert id="insertNgIrrigationControllers" parameterType="NgIrrigationControllers" useGeneratedKeys="true" keyProperty="id"> <insert id="insertNgIrrigationControllers" parameterType="NgIrrigationControllers" useGeneratedKeys="true" keyProperty="id">
insert into ng_irrigation_controllers insert into ng_irrigation_controllers
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

View File

@ -22,10 +22,13 @@
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="deviceNumber" column="device_number" />
<result property="projectId" column="project_id" />
<result property="deptId" column="dept_id" />
</resultMap> </resultMap>
<sql id="selectNgUserRechargeRecordsVo"> <sql id="selectNgUserRechargeRecordsVo">
select id, user_id, user_name, card_number, area_code, type, amount, balance, recharge_time, recharge_code, status, serial_number, remark, create_time, update_time, create_by, update_by from ng_user_recharge_records select id, user_id, user_name, card_number, area_code, type, amount, balance, recharge_time, recharge_code, status, serial_number, remark, create_time, update_time, create_by, update_by, device_number, project_id, dept_id from ng_user_recharge_records
</sql> </sql>
<select id="selectNgUserRechargeRecordsList" parameterType="NgUserRechargeRecords" resultMap="NgUserRechargeRecordsResult"> <select id="selectNgUserRechargeRecordsList" parameterType="NgUserRechargeRecords" resultMap="NgUserRechargeRecordsResult">
@ -42,6 +45,9 @@
<if test="rechargeCode != null and rechargeCode != ''"> and recharge_code = #{rechargeCode}</if> <if test="rechargeCode != null and rechargeCode != ''"> and recharge_code = #{rechargeCode}</if>
<if test="status != null "> and status = #{status}</if> <if test="status != null "> and status = #{status}</if>
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if> <if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
<if test="deviceNumber != null and deviceNumber != ''"> and device_number = #{deviceNumber}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
</where> </where>
</select> </select>
@ -69,6 +75,9 @@
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="deviceNumber != null">device_number,</if>
<if test="projectId != null">project_id,</if>
<if test="deptId != null">dept_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
@ -87,6 +96,9 @@
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="deviceNumber != null">#{deviceNumber},</if>
<if test="projectId != null">#{projectId},</if>
<if test="deptId != null">#{deptId},</if>
</trim> </trim>
</insert> </insert>
@ -109,6 +121,9 @@
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="deviceNumber != null">device_number = #{deviceNumber},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -32,10 +32,11 @@
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="areaCode" column="area_code" />
</resultMap> </resultMap>
<sql id="selectUserConsumptionDetailsVo"> <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, remark, create_time, update_time, create_by, update_by from user_consumption_details 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, remark, create_time, update_time, create_by, update_by, area_code from user_consumption_details
</sql> </sql>
<select id="selectUserConsumptionDetailsList" parameterType="UserConsumptionDetails" resultMap="UserConsumptionDetailsResult"> <select id="selectUserConsumptionDetailsList" parameterType="UserConsumptionDetails" resultMap="UserConsumptionDetailsResult">
@ -62,7 +63,7 @@
<if test="paymentMethod != null "> and payment_method = #{paymentMethod}</if> <if test="paymentMethod != null "> and payment_method = #{paymentMethod}</if>
<if test="paymentTime != null "> and payment_time = #{paymentTime}</if> <if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
<if test="status != null "> and status = #{status}</if> <if test="status != null "> and status = #{status}</if>
<if test="remark != null and remark != ''"> and remark = #{remark}</if> <if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
</where> </where>
</select> </select>
@ -73,9 +74,7 @@
<select id="selectUserConsumptionDetailsListById" parameterType="String" resultMap="UserConsumptionDetailsResult"> <select id="selectUserConsumptionDetailsListById" parameterType="String" resultMap="UserConsumptionDetailsResult">
<include refid="selectUserConsumptionDetailsVo"/> <include refid="selectUserConsumptionDetailsVo"/>
<where> where card_number = #{cardNumber}
card_number=#{cardNumber}
</where>
</select> </select>
<insert id="insertUserConsumptionDetails" parameterType="UserConsumptionDetails" useGeneratedKeys="true" keyProperty="id"> <insert id="insertUserConsumptionDetails" parameterType="UserConsumptionDetails" useGeneratedKeys="true" keyProperty="id">
@ -107,6 +106,7 @@
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="areaCode != null">area_code,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
@ -135,6 +135,7 @@
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="areaCode != null">#{areaCode},</if>
</trim> </trim>
</insert> </insert>
@ -167,6 +168,7 @@
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -58,6 +58,10 @@
<include refid="selectUserRechargeCardsVo"/> <include refid="selectUserRechargeCardsVo"/>
where card_number= #{cardnumber} where card_number= #{cardnumber}
</select> </select>
<select id="selectUserRechargeCardsByCardNumber" parameterType="String" resultMap="UserRechargeCardsResult">
<include refid="selectUserRechargeCardsVo"/>
where cardNumber = #{cardNumber}
</select>
<insert id="insertUserRechargeCards" parameterType="UserRechargeCards" useGeneratedKeys="true" keyProperty="id"> <insert id="insertUserRechargeCards" parameterType="UserRechargeCards" useGeneratedKeys="true" keyProperty="id">
insert into user_recharge_cards insert into user_recharge_cards
@ -129,7 +133,7 @@
</update> </update>
<delete id="deleteUserRechargeCardsById" parameterType="Long"> <delete id="deleteUserRechargeCardsById" parameterType="Long">
delete from user_recharge_cards where user_id = #{id} delete from user_recharge_cards where id = #{id}
</delete> </delete>
<delete id="deleteUserRechargeCardsByIds" parameterType="String"> <delete id="deleteUserRechargeCardsByIds" parameterType="String">