卡片管理
This commit is contained in:
parent
25e8e7a67e
commit
8cc276ae19
|
|
@ -0,0 +1,119 @@
|
||||||
|
package com.bonus.canteen.core.account.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.canteen.core.common.annotation.PreventRepeatSubmit;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
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.bonus.common.log.annotation.SysLog;
|
||||||
|
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.bonus.canteen.core.account.domain.AccCardHis;
|
||||||
|
import com.bonus.canteen.core.account.service.IAccCardHisService;
|
||||||
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员换卡历史记录Controller
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2025-04-23
|
||||||
|
*/
|
||||||
|
@Api(tags = "人员换卡历史记录接口")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/acc_card_his")
|
||||||
|
public class AccCardHisController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IAccCardHisService accCardHisService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员换卡历史记录列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询人员换卡历史记录列表")
|
||||||
|
//@RequiresPermissions("account:his:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(AccCardHis accCardHis) {
|
||||||
|
startPage();
|
||||||
|
List<AccCardHis> list = accCardHisService.selectAccCardHisList(accCardHis);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出人员换卡历史记录列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "导出人员换卡历史记录列表")
|
||||||
|
//@PreventRepeatSubmit
|
||||||
|
//@RequiresPermissions("account:his:export")
|
||||||
|
@SysLog(title = "人员换卡历史记录", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出人员换卡历史记录")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, AccCardHis accCardHis) {
|
||||||
|
List<AccCardHis> list = accCardHisService.selectAccCardHisList(accCardHis);
|
||||||
|
ExcelUtil<AccCardHis> util = new ExcelUtil<AccCardHis>(AccCardHis.class);
|
||||||
|
util.exportExcel(response, list, "人员换卡历史记录数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取人员换卡历史记录详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取人员换卡历史记录详细信息")
|
||||||
|
//@RequiresPermissions("account:his:query")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
|
return success(accCardHisService.selectAccCardHisById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增人员换卡历史记录
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增人员换卡历史记录")
|
||||||
|
//@PreventRepeatSubmit
|
||||||
|
//@RequiresPermissions("account:his:add")
|
||||||
|
@SysLog(title = "人员换卡历史记录", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增人员换卡历史记录")
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody AccCardHis accCardHis) {
|
||||||
|
try {
|
||||||
|
return toAjax(accCardHisService.insertAccCardHis(accCardHis));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error("系统错误, " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人员换卡历史记录
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改人员换卡历史记录")
|
||||||
|
//@PreventRepeatSubmit
|
||||||
|
//@RequiresPermissions("account:his:edit")
|
||||||
|
@SysLog(title = "人员换卡历史记录", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改人员换卡历史记录")
|
||||||
|
@PostMapping("/edit")
|
||||||
|
public AjaxResult edit(@RequestBody AccCardHis accCardHis) {
|
||||||
|
try {
|
||||||
|
return toAjax(accCardHisService.updateAccCardHis(accCardHis));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error("系统错误, " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除人员换卡历史记录
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除人员换卡历史记录")
|
||||||
|
//@PreventRepeatSubmit
|
||||||
|
//@RequiresPermissions("account:his:remove")
|
||||||
|
@SysLog(title = "人员换卡历史记录", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除人员换卡历史记录")
|
||||||
|
@PostMapping("/del/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
|
return toAjax(accCardHisService.deleteAccCardHisByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.bonus.canteen.core.account.domain;
|
||||||
|
|
||||||
|
import com.bonus.common.core.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员换卡历史记录对象 acc_card_his
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2025-04-23
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class AccCardHis extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键自增 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 账户id */
|
||||||
|
@Excel(name = "账户id")
|
||||||
|
@ApiModelProperty(value = "账户id")
|
||||||
|
private Long accId;
|
||||||
|
|
||||||
|
/** 人员id */
|
||||||
|
@Excel(name = "人员id")
|
||||||
|
@ApiModelProperty(value = "人员id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/** 卡号 */
|
||||||
|
@Excel(name = "卡号")
|
||||||
|
@ApiModelProperty(value = "卡号")
|
||||||
|
private String cardNum;
|
||||||
|
|
||||||
|
/** 卡序列号 */
|
||||||
|
@Excel(name = "卡序列号")
|
||||||
|
@ApiModelProperty(value = "卡序列号")
|
||||||
|
private String serialNum;
|
||||||
|
|
||||||
|
/** 卡类型 */
|
||||||
|
@Excel(name = "卡类型")
|
||||||
|
@ApiModelProperty(value = "卡类型")
|
||||||
|
private Long cardType;
|
||||||
|
|
||||||
|
/** 记录类型 1-发卡2-退卡3-换卡 */
|
||||||
|
@Excel(name = "记录类型 1-发卡2-退卡3-换卡")
|
||||||
|
@ApiModelProperty(value = "记录类型 1-发卡2-退卡3-换卡")
|
||||||
|
private Long recordType;
|
||||||
|
|
||||||
|
/** 押金 单位分 */
|
||||||
|
@Excel(name = "押金 单位分")
|
||||||
|
@ApiModelProperty(value = "押金 单位分")
|
||||||
|
private Long deposit;
|
||||||
|
|
||||||
|
/** 工本费 单位分 */
|
||||||
|
@Excel(name = "工本费 单位分")
|
||||||
|
@ApiModelProperty(value = "工本费 单位分")
|
||||||
|
private Long productCost;
|
||||||
|
|
||||||
|
/** 押金、工本费支付方式 */
|
||||||
|
@Excel(name = "押金、工本费支付方式 ")
|
||||||
|
@ApiModelProperty(value = "押金、工本费支付方式 ")
|
||||||
|
private Integer payType;
|
||||||
|
|
||||||
|
/** 押金、工本费支付渠道 */
|
||||||
|
@Excel(name = "押金、工本费支付渠道")
|
||||||
|
@ApiModelProperty(value = "押金、工本费支付渠道")
|
||||||
|
private Integer payChannel;
|
||||||
|
|
||||||
|
/** 卡面号 */
|
||||||
|
@Excel(name = "卡面号")
|
||||||
|
@ApiModelProperty(value = "卡面号")
|
||||||
|
private String cardFaceNum;
|
||||||
|
|
||||||
|
/** 乐观锁 */
|
||||||
|
@Excel(name = "乐观锁")
|
||||||
|
@ApiModelProperty(value = "乐观锁")
|
||||||
|
private Long revision;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.bonus.canteen.core.account.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.bonus.canteen.core.account.domain.AccCardHis;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员换卡历史记录Mapper接口
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2025-04-23
|
||||||
|
*/
|
||||||
|
public interface AccCardHisMapper {
|
||||||
|
/**
|
||||||
|
* 查询人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param id 人员换卡历史记录主键
|
||||||
|
* @return 人员换卡历史记录
|
||||||
|
*/
|
||||||
|
public AccCardHis selectAccCardHisById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员换卡历史记录列表
|
||||||
|
*
|
||||||
|
* @param accCardHis 人员换卡历史记录
|
||||||
|
* @return 人员换卡历史记录集合
|
||||||
|
*/
|
||||||
|
public List<AccCardHis> selectAccCardHisList(AccCardHis accCardHis);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param accCardHis 人员换卡历史记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAccCardHis(AccCardHis accCardHis);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param accCardHis 人员换卡历史记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAccCardHis(AccCardHis accCardHis);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param id 人员换卡历史记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAccCardHisById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAccCardHisByIds(Long[] ids);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.bonus.canteen.core.account.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.bonus.canteen.core.account.domain.AccCardHis;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员换卡历史记录Service接口
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2025-04-23
|
||||||
|
*/
|
||||||
|
public interface IAccCardHisService {
|
||||||
|
/**
|
||||||
|
* 查询人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param id 人员换卡历史记录主键
|
||||||
|
* @return 人员换卡历史记录
|
||||||
|
*/
|
||||||
|
public AccCardHis selectAccCardHisById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员换卡历史记录列表
|
||||||
|
*
|
||||||
|
* @param accCardHis 人员换卡历史记录
|
||||||
|
* @return 人员换卡历史记录集合
|
||||||
|
*/
|
||||||
|
public List<AccCardHis> selectAccCardHisList(AccCardHis accCardHis);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param accCardHis 人员换卡历史记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAccCardHis(AccCardHis accCardHis);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param accCardHis 人员换卡历史记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAccCardHis(AccCardHis accCardHis);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的人员换卡历史记录主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAccCardHisByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除人员换卡历史记录信息
|
||||||
|
*
|
||||||
|
* @param id 人员换卡历史记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAccCardHisById(Long id);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.bonus.canteen.core.account.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.bonus.canteen.core.account.mapper.AccCardHisMapper;
|
||||||
|
import com.bonus.canteen.core.account.domain.AccCardHis;
|
||||||
|
import com.bonus.canteen.core.account.service.IAccCardHisService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员换卡历史记录Service业务层处理
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2025-04-23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AccCardHisServiceImpl implements IAccCardHisService {
|
||||||
|
@Autowired
|
||||||
|
private AccCardHisMapper accCardHisMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param id 人员换卡历史记录主键
|
||||||
|
* @return 人员换卡历史记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AccCardHis selectAccCardHisById(Long id) {
|
||||||
|
return accCardHisMapper.selectAccCardHisById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询人员换卡历史记录列表
|
||||||
|
*
|
||||||
|
* @param accCardHis 人员换卡历史记录
|
||||||
|
* @return 人员换卡历史记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AccCardHis> selectAccCardHisList(AccCardHis accCardHis) {
|
||||||
|
return accCardHisMapper.selectAccCardHisList(accCardHis);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param accCardHis 人员换卡历史记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertAccCardHis(AccCardHis accCardHis) {
|
||||||
|
accCardHis.setCreateTime(DateUtils.getNowDate());
|
||||||
|
try {
|
||||||
|
return accCardHisMapper.insertAccCardHis(accCardHis);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ServiceException("错误信息描述, " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param accCardHis 人员换卡历史记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateAccCardHis(AccCardHis accCardHis) {
|
||||||
|
accCardHis.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
try {
|
||||||
|
return accCardHisMapper.updateAccCardHis(accCardHis);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ServiceException("错误信息描述, " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除人员换卡历史记录
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的人员换卡历史记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAccCardHisByIds(Long[] ids) {
|
||||||
|
return accCardHisMapper.deleteAccCardHisByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除人员换卡历史记录信息
|
||||||
|
*
|
||||||
|
* @param id 人员换卡历史记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAccCardHisById(Long id) {
|
||||||
|
return accCardHisMapper.deleteAccCardHisById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,130 @@
|
||||||
|
<?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.bonus.canteen.core.account.mapper.AccCardHisMapper">
|
||||||
|
<resultMap type="com.bonus.canteen.core.account.domain.AccCardHis" id="AccCardHisResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="accId" column="acc_id" />
|
||||||
|
<result property="userId" column="user_id" />
|
||||||
|
<result property="cardNum" column="card_num" />
|
||||||
|
<result property="serialNum" column="serial_num" />
|
||||||
|
<result property="cardType" column="card_type" />
|
||||||
|
<result property="recordType" column="record_type" />
|
||||||
|
<result property="deposit" column="deposit" />
|
||||||
|
<result property="productCost" column="product_cost" />
|
||||||
|
<result property="payType" column="pay_type" />
|
||||||
|
<result property="payChannel" column="pay_channel" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="cardFaceNum" column="card_face_num" />
|
||||||
|
<result property="revision" column="revision" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectAccCardHisVo">
|
||||||
|
select id, acc_id, user_id, card_num, serial_num, card_type, record_type, deposit, product_cost, pay_type, pay_channel, remark, card_face_num, revision, create_by, create_time, update_by, update_time from acc_card_his
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAccCardHisList" parameterType="com.bonus.canteen.core.account.domain.AccCardHis" resultMap="AccCardHisResult">
|
||||||
|
<include refid="selectAccCardHisVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="accId != null "> and acc_id = #{accId}</if>
|
||||||
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||||||
|
<if test="cardNum != null and cardNum != ''"> and card_num = #{cardNum}</if>
|
||||||
|
<if test="serialNum != null and serialNum != ''"> and serial_num = #{serialNum}</if>
|
||||||
|
<if test="cardType != null "> and card_type = #{cardType}</if>
|
||||||
|
<if test="recordType != null "> and record_type = #{recordType}</if>
|
||||||
|
<if test="deposit != null "> and deposit = #{deposit}</if>
|
||||||
|
<if test="productCost != null "> and product_cost = #{productCost}</if>
|
||||||
|
<if test="payType != null "> and pay_type = #{payType}</if>
|
||||||
|
<if test="payChannel != null "> and pay_channel = #{payChannel}</if>
|
||||||
|
<if test="cardFaceNum != null and cardFaceNum != ''"> and card_face_num = #{cardFaceNum}</if>
|
||||||
|
<if test="revision != null "> and revision = #{revision}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAccCardHisById" parameterType="Long" resultMap="AccCardHisResult">
|
||||||
|
<include refid="selectAccCardHisVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertAccCardHis" parameterType="com.bonus.canteen.core.account.domain.AccCardHis" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into acc_card_his
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="accId != null">acc_id,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="cardNum != null and cardNum != ''">card_num,</if>
|
||||||
|
<if test="serialNum != null and serialNum != ''">serial_num,</if>
|
||||||
|
<if test="cardType != null">card_type,</if>
|
||||||
|
<if test="recordType != null">record_type,</if>
|
||||||
|
<if test="deposit != null">deposit,</if>
|
||||||
|
<if test="productCost != null">product_cost,</if>
|
||||||
|
<if test="payType != null">pay_type,</if>
|
||||||
|
<if test="payChannel != null">pay_channel,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="cardFaceNum != null">card_face_num,</if>
|
||||||
|
<if test="revision != null">revision,</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>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="accId != null">#{accId},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="cardNum != null and cardNum != ''">#{cardNum},</if>
|
||||||
|
<if test="serialNum != null and serialNum != ''">#{serialNum},</if>
|
||||||
|
<if test="cardType != null">#{cardType},</if>
|
||||||
|
<if test="recordType != null">#{recordType},</if>
|
||||||
|
<if test="deposit != null">#{deposit},</if>
|
||||||
|
<if test="productCost != null">#{productCost},</if>
|
||||||
|
<if test="payType != null">#{payType},</if>
|
||||||
|
<if test="payChannel != null">#{payChannel},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="cardFaceNum != null">#{cardFaceNum},</if>
|
||||||
|
<if test="revision != null">#{revision},</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>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateAccCardHis" parameterType="com.bonus.canteen.core.account.domain.AccCardHis">
|
||||||
|
update acc_card_his
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="accId != null">acc_id = #{accId},</if>
|
||||||
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
|
<if test="cardNum != null and cardNum != ''">card_num = #{cardNum},</if>
|
||||||
|
<if test="serialNum != null and serialNum != ''">serial_num = #{serialNum},</if>
|
||||||
|
<if test="cardType != null">card_type = #{cardType},</if>
|
||||||
|
<if test="recordType != null">record_type = #{recordType},</if>
|
||||||
|
<if test="deposit != null">deposit = #{deposit},</if>
|
||||||
|
<if test="productCost != null">product_cost = #{productCost},</if>
|
||||||
|
<if test="payType != null">pay_type = #{payType},</if>
|
||||||
|
<if test="payChannel != null">pay_channel = #{payChannel},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="cardFaceNum != null">card_face_num = #{cardFaceNum},</if>
|
||||||
|
<if test="revision != null">revision = #{revision},</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>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteAccCardHisById" parameterType="Long">
|
||||||
|
delete from acc_card_his where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteAccCardHisByIds" parameterType="String">
|
||||||
|
delete from acc_card_his where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue