Commit 15d84e8e by 吕明尚

增加充值和赠送金额的日志

parent af01395a
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.GiftAmountLog;
import share.system.domain.vo.GiftAmountLogVo;
import share.system.service.GiftAmountLogService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 赠送金额日志Controller
*
* @author wuwenlong
* @date 2024-10-08
*/
@RestController
@RequestMapping("/system/giftAmountLog")
public class GiftAmountLogController extends BaseController {
@Autowired
private GiftAmountLogService giftAmountLogService;
/**
* 查询赠送金额日志列表
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:list')")
@GetMapping("/list")
public TableDataInfo list(GiftAmountLogVo giftAmountLog) {
startPage();
List<GiftAmountLogVo> list = giftAmountLogService.selectGiftAmountLogList(giftAmountLog);
return getDataTable(list);
}
/**
* 导出赠送金额日志列表
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:export')")
@Log(title = "赠送金额日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, GiftAmountLogVo giftAmountLog) {
List<GiftAmountLogVo> list = giftAmountLogService.selectGiftAmountLogList(giftAmountLog);
ExcelUtil<GiftAmountLogVo> util = new ExcelUtil<GiftAmountLogVo>(GiftAmountLogVo.class);
util.exportExcel(response, list, "赠送金额日志数据");
}
/**
* 获取赠送金额日志详细信息
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(giftAmountLogService.selectGiftAmountLogById(id));
}
/**
* 新增赠送金额日志
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:add')")
@Log(title = "赠送金额日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody GiftAmountLog giftAmountLog) {
return toAjax(giftAmountLogService.insertGiftAmountLog(giftAmountLog));
}
/**
* 修改赠送金额日志
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:edit')")
@Log(title = "赠送金额日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody GiftAmountLog giftAmountLog) {
return toAjax(giftAmountLogService.updateGiftAmountLog(giftAmountLog));
}
/**
* 删除赠送金额日志
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:remove')")
@Log(title = "赠送金额日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(giftAmountLogService.deleteGiftAmountLogByIds(ids));
}
}
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.RechargeAmountLog;
import share.system.domain.vo.RechargeAmountLogVo;
import share.system.service.RechargeAmountLogService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 充值金额日志Controller
*
* @author wuwenlong
* @date 2024-10-08
*/
@RestController
@RequestMapping("/system/rechargeAmountLog")
public class RechargeAmountLogController extends BaseController {
@Autowired
private RechargeAmountLogService rechargeAmountLogService;
/**
* 查询充值金额日志列表
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:list')")
@GetMapping("/list")
public TableDataInfo list(RechargeAmountLogVo rechargeAmountLog) {
startPage();
List<RechargeAmountLogVo> list = rechargeAmountLogService.selectRechargeAmountLogList(rechargeAmountLog);
return getDataTable(list);
}
/**
* 导出充值金额日志列表
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:export')")
@Log(title = "充值金额日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RechargeAmountLogVo rechargeAmountLog) {
List<RechargeAmountLogVo> list = rechargeAmountLogService.selectRechargeAmountLogList(rechargeAmountLog);
ExcelUtil<RechargeAmountLogVo> util = new ExcelUtil<RechargeAmountLogVo>(RechargeAmountLogVo.class);
util.exportExcel(response, list, "充值金额日志数据");
}
/**
* 获取充值金额日志详细信息
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(rechargeAmountLogService.selectRechargeAmountLogById(id));
}
/**
* 新增充值金额日志
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:add')")
@Log(title = "充值金额日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RechargeAmountLog rechargeAmountLog) {
return toAjax(rechargeAmountLogService.insertRechargeAmountLog(rechargeAmountLog));
}
/**
* 修改充值金额日志
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:edit')")
@Log(title = "充值金额日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RechargeAmountLog rechargeAmountLog) {
return toAjax(rechargeAmountLogService.updateRechargeAmountLog(rechargeAmountLog));
}
/**
* 删除充值金额日志
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:remove')")
@Log(title = "充值金额日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(rechargeAmountLogService.deleteRechargeAmountLogByIds(ids));
}
}
......@@ -39,6 +39,18 @@ public class ConsumerWallet extends BaseEntity {
private BigDecimal balance;
/**
* 充值金额
*/
@Excel(name = "充值金额")
private BigDecimal rechargeAmount;
/**
* 赠送金额
*/
@Excel(name = "赠送金额")
private BigDecimal giftAmount;
/**
* 时长
*/
@Excel(name = "时长")
......
package share.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
/**
* 赠送金额日志对象 s_gift_amount_log
*
* @author wuwenlong
* @date 2024-10-08
*/
@Data
public class GiftAmountLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* 用户id
*/
private Long consumerId;
/**
* 当前金额
*/
@Excel(name = "当前金额")
private BigDecimal currentAmount;
/**
* 变动金额
*/
@Excel(name = "变动金额")
private BigDecimal variableAmount;
/**
* 操作类型
*/
@Excel(name = "操作类型")
private Long operationType;
/**
* 操作时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationTime;
/**
* 是否删除
*/
private Long isDelete;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("consumerId", getConsumerId())
.append("currentAmount", getCurrentAmount())
.append("variableAmount", getVariableAmount())
.append("operationType", getOperationType())
.append("operationTime", getOperationTime())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
/**
* 充值金额日志对象 s_recharge_amount_log
*
* @author wuwenlong
* @date 2024-10-08
*/
@Data
public class RechargeAmountLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* 用户id
*/
@Excel(name = "用户id")
private Long consumerId;
/**
* 当前金额
*/
@Excel(name = "当前金额")
private BigDecimal currentAmount;
/**
* 变动金额
*/
@Excel(name = "变动金额")
private BigDecimal variableAmount;
/**
* 操作类型
*/
@Excel(name = "操作类型")
private Long operationType;
/**
* 操作时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationTime;
/**
* 是否删除
*/
//逻辑删除注解(0 未删除 1 已删除)
@TableLogic
@TableField(select = false)
private Long isDelete;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("consumerId", getConsumerId())
.append("currentAmount", getCurrentAmount())
.append("variableAmount", getVariableAmount())
.append("operationType", getOperationType())
.append("operationTime", getOperationTime())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.GiftAmountLog;
@Data
public class GiftAmountLogVo extends GiftAmountLog {
private String nickName;
private String avatar;
private String phone;
}
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.RechargeAmountLog;
@Data
public class RechargeAmountLogVo extends RechargeAmountLog {
private String nickName;
private String avatar;
private String phone;
}
package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.GiftAmountLog;
import share.system.domain.vo.GiftAmountLogVo;
import java.util.List;
/**
* 赠送金额日志Mapper接口
*
* @author wuwenlong
* @date 2024-10-08
*/
public interface GiftAmountLogMapper extends BaseMapper<GiftAmountLog> {
/**
* 查询赠送金额日志
*
* @param id 赠送金额日志主键
* @return 赠送金额日志
*/
public GiftAmountLog selectGiftAmountLogById(Long id);
/**
* 查询赠送金额日志列表
*
* @param giftAmountLog 赠送金额日志
* @return 赠送金额日志集合
*/
public List<GiftAmountLogVo> selectGiftAmountLogList(GiftAmountLogVo giftAmountLog);
/**
* 新增赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
public int insertGiftAmountLog(GiftAmountLog giftAmountLog);
/**
* 修改赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
public int updateGiftAmountLog(GiftAmountLog giftAmountLog);
/**
* 删除赠送金额日志
*
* @param id 赠送金额日志主键
* @return 结果
*/
public int deleteGiftAmountLogById(Long id);
/**
* 批量删除赠送金额日志
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteGiftAmountLogByIds(Long[] ids);
}
package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.RechargeAmountLog;
import share.system.domain.vo.RechargeAmountLogVo;
import java.util.List;
/**
* 充值金额日志Mapper接口
*
* @author wuwenlong
* @date 2024-10-08
*/
public interface RechargeAmountLogMapper extends BaseMapper<RechargeAmountLog> {
/**
* 查询充值金额日志
*
* @param id 充值金额日志主键
* @return 充值金额日志
*/
public RechargeAmountLog selectRechargeAmountLogById(Long id);
/**
* 查询充值金额日志列表
*
* @param rechargeAmountLog 充值金额日志
* @return 充值金额日志集合
*/
public List<RechargeAmountLogVo> selectRechargeAmountLogList(RechargeAmountLogVo rechargeAmountLog);
/**
* 新增充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
public int insertRechargeAmountLog(RechargeAmountLog rechargeAmountLog);
/**
* 修改充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
public int updateRechargeAmountLog(RechargeAmountLog rechargeAmountLog);
/**
* 删除充值金额日志
*
* @param id 充值金额日志主键
* @return 结果
*/
public int deleteRechargeAmountLogById(Long id);
/**
* 批量删除充值金额日志
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteRechargeAmountLogByIds(Long[] ids);
}
package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.GiftAmountLog;
import share.system.domain.vo.GiftAmountLogVo;
import java.util.List;
/**
* 赠送金额日志Service接口
*
* @author wuwenlong
* @date 2024-10-08
*/
public interface GiftAmountLogService extends IService<GiftAmountLog> {
/**
* 查询赠送金额日志
*
* @param id 赠送金额日志主键
* @return 赠送金额日志
*/
public GiftAmountLog selectGiftAmountLogById(Long id);
/**
* 查询赠送金额日志列表
*
* @param giftAmountLog 赠送金额日志
* @return 赠送金额日志集合
*/
public List<GiftAmountLogVo> selectGiftAmountLogList(GiftAmountLogVo giftAmountLog);
/**
* 新增赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
public int insertGiftAmountLog(GiftAmountLog giftAmountLog);
/**
* 修改赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
public int updateGiftAmountLog(GiftAmountLog giftAmountLog);
/**
* 批量删除赠送金额日志
*
* @param ids 需要删除的赠送金额日志主键集合
* @return 结果
*/
public int deleteGiftAmountLogByIds(Long[] ids);
/**
* 删除赠送金额日志信息
*
* @param id 赠送金额日志主键
* @return 结果
*/
public int deleteGiftAmountLogById(Long id);
}
package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.RechargeAmountLog;
import share.system.domain.vo.RechargeAmountLogVo;
import java.util.List;
/**
* 充值金额日志Service接口
*
* @author wuwenlong
* @date 2024-10-08
*/
public interface RechargeAmountLogService extends IService<RechargeAmountLog> {
/**
* 查询充值金额日志
*
* @param id 充值金额日志主键
* @return 充值金额日志
*/
public RechargeAmountLog selectRechargeAmountLogById(Long id);
/**
* 查询充值金额日志列表
*
* @param rechargeAmountLog 充值金额日志
* @return 充值金额日志集合
*/
public List<RechargeAmountLogVo> selectRechargeAmountLogList(RechargeAmountLogVo rechargeAmountLog);
/**
* 新增充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
public int insertRechargeAmountLog(RechargeAmountLog rechargeAmountLog);
/**
* 修改充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
public int updateRechargeAmountLog(RechargeAmountLog rechargeAmountLog);
/**
* 批量删除充值金额日志
*
* @param ids 需要删除的充值金额日志主键集合
* @return 结果
*/
public int deleteRechargeAmountLogByIds(Long[] ids);
/**
* 删除充值金额日志信息
*
* @param id 充值金额日志主键
* @return 结果
*/
public int deleteRechargeAmountLogById(Long id);
}
package share.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.utils.DateUtils;
import share.system.domain.GiftAmountLog;
import share.system.domain.vo.GiftAmountLogVo;
import share.system.mapper.GiftAmountLogMapper;
import share.system.service.GiftAmountLogService;
import java.util.List;
/**
* 赠送金额日志Service业务层处理
*
* @author wuwenlong
* @date 2024-10-08
*/
@Service
public class GiftAmountLogServiceImpl extends ServiceImpl<GiftAmountLogMapper, GiftAmountLog> implements GiftAmountLogService {
@Autowired
private GiftAmountLogMapper giftAmountLogMapper;
/**
* 查询赠送金额日志
*
* @param id 赠送金额日志主键
* @return 赠送金额日志
*/
@Override
public GiftAmountLog selectGiftAmountLogById(Long id) {
return giftAmountLogMapper.selectGiftAmountLogById(id);
}
/**
* 查询赠送金额日志列表
*
* @param giftAmountLog 赠送金额日志
* @return 赠送金额日志
*/
@Override
public List<GiftAmountLogVo> selectGiftAmountLogList(GiftAmountLogVo giftAmountLog) {
return giftAmountLogMapper.selectGiftAmountLogList(giftAmountLog);
}
/**
* 新增赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
@Override
public int insertGiftAmountLog(GiftAmountLog giftAmountLog) {
giftAmountLog.setCreateTime(DateUtils.getNowDate());
return giftAmountLogMapper.insertGiftAmountLog(giftAmountLog);
}
/**
* 修改赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
@Override
public int updateGiftAmountLog(GiftAmountLog giftAmountLog) {
giftAmountLog.setUpdateTime(DateUtils.getNowDate());
return giftAmountLogMapper.updateGiftAmountLog(giftAmountLog);
}
/**
* 批量删除赠送金额日志
*
* @param ids 需要删除的赠送金额日志主键
* @return 结果
*/
@Override
public int deleteGiftAmountLogByIds(Long[] ids) {
return giftAmountLogMapper.deleteGiftAmountLogByIds(ids);
}
/**
* 删除赠送金额日志信息
*
* @param id 赠送金额日志主键
* @return 结果
*/
@Override
public int deleteGiftAmountLogById(Long id) {
return giftAmountLogMapper.deleteGiftAmountLogById(id);
}
}
package share.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.utils.DateUtils;
import share.system.domain.RechargeAmountLog;
import share.system.domain.vo.RechargeAmountLogVo;
import share.system.mapper.RechargeAmountLogMapper;
import share.system.service.RechargeAmountLogService;
import java.util.List;
/**
* 充值金额日志Service业务层处理
*
* @author wuwenlong
* @date 2024-10-08
*/
@Service
public class RechargeAmountLogServiceImpl extends ServiceImpl<RechargeAmountLogMapper, RechargeAmountLog> implements RechargeAmountLogService {
@Autowired
private RechargeAmountLogMapper rechargeAmountLogMapper;
/**
* 查询充值金额日志
*
* @param id 充值金额日志主键
* @return 充值金额日志
*/
@Override
public RechargeAmountLog selectRechargeAmountLogById(Long id) {
return rechargeAmountLogMapper.selectRechargeAmountLogById(id);
}
/**
* 查询充值金额日志列表
*
* @param rechargeAmountLog 充值金额日志
* @return 充值金额日志
*/
@Override
public List<RechargeAmountLogVo> selectRechargeAmountLogList(RechargeAmountLogVo rechargeAmountLog) {
return rechargeAmountLogMapper.selectRechargeAmountLogList(rechargeAmountLog);
}
/**
* 新增充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
@Override
public int insertRechargeAmountLog(RechargeAmountLog rechargeAmountLog) {
rechargeAmountLog.setCreateTime(DateUtils.getNowDate());
return rechargeAmountLogMapper.insertRechargeAmountLog(rechargeAmountLog);
}
/**
* 修改充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
@Override
public int updateRechargeAmountLog(RechargeAmountLog rechargeAmountLog) {
rechargeAmountLog.setUpdateTime(DateUtils.getNowDate());
return rechargeAmountLogMapper.updateRechargeAmountLog(rechargeAmountLog);
}
/**
* 批量删除充值金额日志
*
* @param ids 需要删除的充值金额日志主键
* @return 结果
*/
@Override
public int deleteRechargeAmountLogByIds(Long[] ids) {
return rechargeAmountLogMapper.deleteRechargeAmountLogByIds(ids);
}
/**
* 删除充值金额日志信息
*
* @param id 充值金额日志主键
* @return 结果
*/
@Override
public int deleteRechargeAmountLogById(Long id) {
return rechargeAmountLogMapper.deleteRechargeAmountLogById(id);
}
}
......@@ -11,6 +11,8 @@
<result property="avatar" column="avatar"/>
<result property="phone" column="phone"/>
<result property="balance" column="balance"/>
<result property="rechargeAmount" column="recharge_amount"/>
<result property="giftAmount" column="gift_amount"/>
<result property="remainingDuration" column="remaining_duration"/>
<result property="remainingIntegral" column="remaining_integral"/>
<result property="isDelete" column="is_delete"/>
......@@ -27,6 +29,8 @@
select id,
consumer_id,
balance,
recharge_amount,
gift_amount,
remaining_duration,
remaining_integral,
is_delete,
......@@ -47,6 +51,8 @@
c.phone,
c.avatar,
w.balance,
w.recharge_amount,
w.gift_amount,
w.remaining_duration,
w.remaining_integral,
w.is_delete,
......@@ -80,6 +86,8 @@
c.phone,
c.avatar,
w.balance,
w.recharge_amount,
w.gift_amount,
w.remaining_duration,
w.remaining_integral,
w.is_delete,
......@@ -109,6 +117,8 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="consumerId != null">consumer_id,</if>
<if test="balance != null">balance,</if>
<if test="rechargeAmount != null">recharge_amount,</if>
<if test="giftAmount != null">gift_amount,</if>
<if test="remainingDuration != null">remaining_duration,</if>
<if test="remainingIntegral != null">remaining_integral,</if>
<if test="isDelete != null">is_delete,</if>
......@@ -123,6 +133,8 @@
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerId != null">#{consumerId},</if>
<if test="balance != null">#{balance},</if>
<if test="rechargeAmount != null">#{rechargeAmount},</if>
<if test="giftAmount != null">#{giftAmount},</if>
<if test="remainingDuration != null">#{remainingDuration},</if>
<if test="remainingIntegral != null">#{remainingIntegral},</if>
<if test="isDelete != null">#{isDelete},</if>
......@@ -141,6 +153,8 @@
<trim prefix="SET" suffixOverrides=",">
<if test="consumerId != null">consumer_id = #{consumerId},</if>
<if test="balance != null">balance = #{balance},</if>
<if test="rechargeAmount != null">recharge_amount = #{rechargeAmount},</if>
<if test="giftAmount != null">gift_amount = #{giftAmount},</if>
<if test="remainingDuration != null">remaining_duration = #{remainingDuration},</if>
<if test="remainingIntegral != null">remaining_integral = #{remainingIntegral},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
......
<?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="share.system.mapper.GiftAmountLogMapper">
<resultMap type="GiftAmountLogVo" id="GiftAmountLogResult">
<result property="id" column="id"/>
<result property="consumerId" column="consumer_id"/>
<result property="nickName" column="nick_name"/>
<result property="phone" column="phone"/>
<result property="avatar" column="avatar"/>
<result property="currentAmount" column="current_amount"/>
<result property="variableAmount" column="variable_amount"/>
<result property="operationType" column="operation_type"/>
<result property="operationTime" column="operation_time"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectGiftAmountLogVo">
select id,
consumer_id,
current_amount,
variable_amount,
operation_type,
operation_time,
is_delete,
create_by,
create_time,
update_by,
update_time,
remark
from s_gift_amount_log
</sql>
<select id="selectGiftAmountLogList" parameterType="GiftAmountLogVo" resultMap="GiftAmountLogResult">
select b.id,
b.consumer_id,
c.nick_name,
c.phone,
c.avatar,
b.variable_amount,
b.current_amount,
b.operation_type,
b.operation_time,
b. is_delete,
b. create_by,
b. create_time,
b. update_by,
b.update_time,
b. remark
from s_gift_amount_log b join s_consumer c on b.consumer_id = c.id
<where>
<if test="nickName != null and nickName != ''">and c.nick_name like concat('%', #{nickName},'%')</if>
<if test="phone != null and phone != ''">and c.phone like concat('%', #{phone},'%')</if>
</where>
ORDER BY b.operation_time DESC
</select>
<select id="selectGiftAmountLogById" parameterType="Long" resultMap="GiftAmountLogResult">
<include refid="selectGiftAmountLogVo"/>
where id = #{id}
</select>
<insert id="insertGiftAmountLog" parameterType="GiftAmountLog" useGeneratedKeys="true" keyProperty="id">
insert into s_gift_amount_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="consumerId != null">consumer_id,</if>
<if test="currentAmount != null">current_amount,</if>
<if test="variableAmount != null">variable_amount,</if>
<if test="operationType != null">operation_type,</if>
<if test="operationTime != null">operation_time,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerId != null">#{consumerId},</if>
<if test="currentAmount != null">#{currentAmount},</if>
<if test="variableAmount != null">#{variableAmount},</if>
<if test="operationType != null">#{operationType},</if>
<if test="operationTime != null">#{operationTime},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateGiftAmountLog" parameterType="GiftAmountLog">
update s_gift_amount_log
<trim prefix="SET" suffixOverrides=",">
<if test="consumerId != null">consumer_id = #{consumerId},</if>
<if test="currentAmount != null">current_amount = #{currentAmount},</if>
<if test="variableAmount != null">variable_amount = #{variableAmount},</if>
<if test="operationType != null">operation_type = #{operationType},</if>
<if test="operationTime != null">operation_time = #{operationTime},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteGiftAmountLogById" parameterType="Long">
delete
from s_gift_amount_log
where id = #{id}
</delete>
<delete id="deleteGiftAmountLogByIds" parameterType="String">
delete from s_gift_amount_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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="share.system.mapper.RechargeAmountLogMapper">
<resultMap type="RechargeAmountLogVo" id="RechargeAmountLogResult">
<result property="id" column="id"/>
<result property="consumerId" column="consumer_id"/>
<result property="nickName" column="nick_name"/>
<result property="phone" column="phone"/>
<result property="avatar" column="avatar"/>
<result property="currentAmount" column="current_amount"/>
<result property="variableAmount" column="variable_amount"/>
<result property="operationType" column="operation_type"/>
<result property="operationTime" column="operation_time"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectRechargeAmountLogVo">
select id,
consumer_id,
current_amount,
variable_amount,
operation_type,
operation_time,
is_delete,
create_by,
create_time,
update_by,
update_time,
remark
from s_recharge_amount_log
</sql>
<select id="selectRechargeAmountLogList" parameterType="RechargeAmountLogVo" resultMap="RechargeAmountLogResult">
select b.id,
b.consumer_id,
c.nick_name,
c.phone,
c.avatar,
b.variable_amount,
b.current_amount,
b.operation_type,
b.operation_time,
b. is_delete,
b. create_by,
b. create_time,
b. update_by,
b.update_time,
b. remark
from s_recharge_amount_log b join s_consumer c on b.consumer_id = c.id
<where>
<if test="nickName != null and nickName != ''">and c.nick_name like concat('%', #{nickName},'%')</if>
<if test="phone != null and phone != ''">and c.phone like concat('%', #{phone},'%')</if>
<if test="currentAmount != null ">and b.current_amount = #{currentAmount}</if>
<if test="variableAmount != null ">and b.variable_amount = #{variableAmount}</if>
</where>
ORDER BY b.operation_time DESC
</select>
<select id="selectRechargeAmountLogById" parameterType="Long" resultMap="RechargeAmountLogResult">
<include refid="selectRechargeAmountLogVo"/>
where id = #{id}
</select>
<insert id="insertRechargeAmountLog" parameterType="RechargeAmountLog" useGeneratedKeys="true" keyProperty="id">
insert into s_recharge_amount_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="consumerId != null">consumer_id,</if>
<if test="currentAmount != null">current_amount,</if>
<if test="variableAmount != null">variable_amount,</if>
<if test="operationType != null">operation_type,</if>
<if test="operationTime != null">operation_time,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerId != null">#{consumerId},</if>
<if test="currentAmount != null">#{currentAmount},</if>
<if test="variableAmount != null">#{variableAmount},</if>
<if test="operationType != null">#{operationType},</if>
<if test="operationTime != null">#{operationTime},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateRechargeAmountLog" parameterType="RechargeAmountLog">
update s_recharge_amount_log
<trim prefix="SET" suffixOverrides=",">
<if test="consumerId != null">consumer_id = #{consumerId},</if>
<if test="currentAmount != null">current_amount = #{currentAmount},</if>
<if test="variableAmount != null">variable_amount = #{variableAmount},</if>
<if test="operationType != null">operation_type = #{operationType},</if>
<if test="operationTime != null">operation_time = #{operationTime},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRechargeAmountLogById" parameterType="Long">
delete
from s_recharge_amount_log
where id = #{id}
</delete>
<delete id="deleteRechargeAmountLogByIds" parameterType="String">
delete from s_recharge_amount_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment