完成绑定联网卡接口
This commit is contained in:
parent
b6b4fddb12
commit
1e8a803dba
@ -72,19 +72,19 @@ public class XhpcCardController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定联网卡回显信息接口
|
||||
* 绑定联网卡时回显信息接口
|
||||
*
|
||||
* @author WH
|
||||
* @date 2022/1/26 10:37
|
||||
* @since version-1.0
|
||||
*/
|
||||
@GetMapping("/non-bind/{cardId}")
|
||||
public R<BindCardEcho> bindCard(@PathVariable("cardId") Long cardId) {
|
||||
public R<BindCardEcho> noBindCard(@PathVariable("cardId") Long cardId) {
|
||||
|
||||
if (cardId == null) {
|
||||
return R.fail("cardId不能为null");
|
||||
}
|
||||
return xhpcCardService.bindCard(cardId);
|
||||
return xhpcCardService.noBindCardInfo(cardId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,5 +100,14 @@ public class XhpcCardController extends BaseController {
|
||||
return xhpcCardService.searchCardUser(queryCondition);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定联网卡
|
||||
*/
|
||||
@PostMapping("/online/bind")
|
||||
public R<Object> onlineCardBind(@RequestBody BindCardInfo bindCardInfo) {
|
||||
|
||||
return xhpcCardService.onlineCardBind(bindCardInfo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -53,5 +53,10 @@ public class BindCardEcho {
|
||||
*/
|
||||
@JsonProperty("cashPledge")
|
||||
private Long cashPledge;
|
||||
/**
|
||||
* 卡记录id
|
||||
*/
|
||||
@JsonProperty("cardRecordId")
|
||||
private Integer cardRecordId;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
package com.xhpc.card.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class BindCardInfo {
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
* ( 0 C端用户 1 流量方用户 2社区用户 3 B端用户)
|
||||
*/
|
||||
@JsonProperty("userType")
|
||||
@NotNull(message = "userType的参数名不正确或者userType的值为空,请检查传入参数")
|
||||
private Integer userType;
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@JsonProperty("userAccount")
|
||||
@NotNull(message = "userAccount的参数名不正确或者userAccount的值为空,请检查传入参数")
|
||||
@NotBlank(message = "userAccount的参数不能为''字符串,请检查传入参数")
|
||||
private String userAccount;
|
||||
/**
|
||||
* 卡序列号
|
||||
*/
|
||||
@JsonProperty("cardId")
|
||||
@NotNull(message = "cardId的参数名不正确或者cardId的值为空,请检查传入参数")
|
||||
@NotBlank(message = "cardId的参数不能为''字符串,请检查传入参数")
|
||||
private String cardId;
|
||||
/**
|
||||
* 卡编号
|
||||
*/
|
||||
@JsonProperty("cardNo")
|
||||
@NotNull(message = "cardNo的参数名不正确或者cardNo的值为空,请检查传入参数")
|
||||
@NotBlank(message = "cardNo的参数不能为''字符串,请检查传入参数")
|
||||
private String cardNo;
|
||||
/**
|
||||
* 卡类型(离线还是联网 0,离线,1联网)
|
||||
*/
|
||||
@JsonProperty("cardType")
|
||||
@NotNull(message = "cardType的参数名不正确或者cardType的值为空,请检查传入参数")
|
||||
private Integer cardType;
|
||||
/**
|
||||
* 卡分类 0表示平台,1表示运营商
|
||||
*/
|
||||
@JsonProperty("cardClassification")
|
||||
@NotNull(message = "cardClassification的参数名不正确或者cardClassification的值为空,请检查传入参数")
|
||||
private Integer cardClassification;
|
||||
/**
|
||||
* 卡记录id
|
||||
*/
|
||||
@JsonProperty("cardRecordId")
|
||||
@NotNull(message = "cardRecordId的参数名不正确或者cardRecordId的值为空,请检查传入参数")
|
||||
private Integer cardRecordId;
|
||||
|
||||
}
|
||||
@ -1,16 +1,26 @@
|
||||
package com.xhpc.card.mapper;
|
||||
|
||||
import com.xhpc.card.pojo.XhpcIcCardInfo;
|
||||
import com.xhpc.common.domain.IccardInfo;
|
||||
import com.xhpc.common.domain.XhpcIcCardInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2022/1/20 13:45
|
||||
*/
|
||||
public interface XhpcCardMapper {
|
||||
|
||||
IccardInfo getIccardInfoCardno(@Param("cardno")String cardno);
|
||||
IccardInfo getIccardInfoCardno(@Param("cardno") String cardno);
|
||||
|
||||
XhpcIcCardInfo getXhpcIcCardInfo(@Param("tIccardInfoId")String tIccardInfoId);
|
||||
}
|
||||
XhpcIcCardInfo getXhpcIcCardInfo(@Param("tIccardInfoId") String tIccardInfoId);
|
||||
|
||||
int deleteByPrimaryKey(Long icCardInfoId);
|
||||
|
||||
int insert(XhpcIcCardInfo record);
|
||||
|
||||
int insertSelective(XhpcIcCardInfo record);
|
||||
|
||||
XhpcIcCardInfo selectByPrimaryKey(Long icCardInfoId);
|
||||
|
||||
int updateByPrimaryKeySelective(XhpcIcCardInfo record);
|
||||
|
||||
int updateByPrimaryKey(XhpcIcCardInfo record);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.xhpc.card.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* xhpc_ic_card_info
|
||||
*
|
||||
* @author
|
||||
*/
|
||||
@Data
|
||||
public class XhpcIcCardInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* 记录id
|
||||
*/
|
||||
private Long icCardInfoId;
|
||||
|
||||
/**
|
||||
* t_iccard_info表中的卡记录的id
|
||||
*/
|
||||
private String tIccardInfoId;
|
||||
|
||||
/**
|
||||
* 卡使用状态(0未使用,1已绑定)
|
||||
*/
|
||||
private Long useStatus;
|
||||
|
||||
/**
|
||||
* 绑卡日期
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 用户账户
|
||||
*/
|
||||
private String userAccount;
|
||||
|
||||
/**
|
||||
* 用户类型(0 C端用户 1 流量方用户 2社区用户 3B端用户)
|
||||
*/
|
||||
private Long userType;
|
||||
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户身份证
|
||||
*/
|
||||
private String userIdCard;
|
||||
|
||||
/**
|
||||
* 用户年龄
|
||||
*/
|
||||
private Long userAge;
|
||||
|
||||
/**
|
||||
* 用户性别(0女,1男)
|
||||
*/
|
||||
private Long userSex;
|
||||
|
||||
/**
|
||||
* 用户手机号码
|
||||
*/
|
||||
private String userPhone;
|
||||
|
||||
/**
|
||||
* 用户车牌号码
|
||||
*/
|
||||
private String userVehicle;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段(默认为0,1为删除)
|
||||
*/
|
||||
private Long delFlag;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@ -61,7 +61,7 @@ public interface IXhpcCardService {
|
||||
* @date 2022/1/28 10:44
|
||||
* @since version-1.0
|
||||
*/
|
||||
R<BindCardEcho> bindCard(Long cardId);
|
||||
R<BindCardEcho> noBindCardInfo(Long cardId);
|
||||
|
||||
/**
|
||||
* 平台、运营商选择用户时,查询指定类型下的所有用户数据
|
||||
@ -74,4 +74,15 @@ public interface IXhpcCardService {
|
||||
*/
|
||||
R<SearchCardResponse> searchCardUser(SearchCardUserQueryCondition queryCondition);
|
||||
|
||||
/**
|
||||
* 联网卡绑定
|
||||
*
|
||||
* @param bindCardInfo 要绑定的联网卡信息
|
||||
* @return 操作结果
|
||||
* @author WH
|
||||
* @date 2022/2/9 10:48
|
||||
* @since version-1.0
|
||||
*/
|
||||
R<Object> onlineCardBind(BindCardInfo bindCardInfo);
|
||||
|
||||
}
|
||||
|
||||
@ -6,15 +6,14 @@ import com.xhpc.card.pojo.*;
|
||||
import com.xhpc.card.service.IXhpcCardService;
|
||||
import com.xhpc.card.utils.MyPagingUtil;
|
||||
import com.xhpc.common.api.CardHistoryOrderService;
|
||||
import com.xhpc.common.core.constant.Constants;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
import com.xhpc.common.domain.IccardInfo;
|
||||
import com.xhpc.common.domain.XhpcIcCardInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -27,7 +26,6 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
||||
|
||||
@Resource
|
||||
private XhpcCardMapper xhpcCardMapper;
|
||||
|
||||
@Resource
|
||||
private CardHistoryOrderService cardHistoryOrderService;
|
||||
@Resource
|
||||
@ -46,47 +44,53 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
||||
private XhpcCustomersPersonnelMapper xhpcCustomersPersonnelMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 卡启动充电判断
|
||||
*
|
||||
* @param cardno
|
||||
* @param serialNumber
|
||||
* @return
|
||||
*/
|
||||
///**
|
||||
// * 卡启动充电判断
|
||||
// *
|
||||
// * @param cardno
|
||||
// * @param serialNumber
|
||||
// * @return
|
||||
// */
|
||||
//@Override
|
||||
//public R cardStartup(String cardno, String serialNumber) {
|
||||
//
|
||||
// IccardInfo iccardInfo = xhpcCardMapper.getIccardInfoCardno(cardno);
|
||||
// if(iccardInfo !=null){
|
||||
// if(iccardInfo.getCardtype()==0){
|
||||
// return R.fail(Constants.OFFLINE_CARD);
|
||||
// }
|
||||
// if(iccardInfo.getStatus()==0){
|
||||
// return R.fail(Constants.ZERO_CARD);
|
||||
// }
|
||||
// if(iccardInfo.getStatus()==2){
|
||||
// return R.fail(Constants.TWO_CARD);
|
||||
// }
|
||||
// if(iccardInfo.getStatus()==3){
|
||||
// return R.fail(Constants.THREE_CARD);
|
||||
// }
|
||||
// if(iccardInfo.getStatus()==4){
|
||||
// return R.fail(Constants.FOUR_CARD);
|
||||
// }
|
||||
// }else{
|
||||
// return R.fail(Constants.LNVALID_CARD);
|
||||
// }
|
||||
// //查询卡号对应的用户
|
||||
// XhpcIcCardInfo xhpcIcCardInfo = xhpcCardMapper.getXhpcIcCardInfo(iccardInfo.getId().toString());
|
||||
// if (xhpcIcCardInfo == null) {
|
||||
// return R.fail(Constants.LNVALID_USER);
|
||||
// }
|
||||
// Long userId = xhpcIcCardInfo.getUserId();
|
||||
// Integer userType = xhpcIcCardInfo.getUserType();
|
||||
// String tenantId = xhpcIcCardInfo.getTenantId();
|
||||
// Integer type = 1;
|
||||
// String grantOperator = xhpcIcCardInfo.getGrantOperatorId();
|
||||
// return cardHistoryOrderService.cardStartup(userId, serialNumber, userType, tenantId, type, grantOperator);
|
||||
//}
|
||||
|
||||
@Override
|
||||
public R cardStartup(String cardno, String serialNumber) {
|
||||
|
||||
IccardInfo iccardInfo = xhpcCardMapper.getIccardInfoCardno(cardno);
|
||||
if(iccardInfo !=null){
|
||||
if(iccardInfo.getCardtype()==0){
|
||||
return R.fail(Constants.OFFLINE_CARD);
|
||||
}
|
||||
if(iccardInfo.getStatus()==0){
|
||||
return R.fail(Constants.ZERO_CARD);
|
||||
}
|
||||
if(iccardInfo.getStatus()==2){
|
||||
return R.fail(Constants.TWO_CARD);
|
||||
}
|
||||
if(iccardInfo.getStatus()==3){
|
||||
return R.fail(Constants.THREE_CARD);
|
||||
}
|
||||
if(iccardInfo.getStatus()==4){
|
||||
return R.fail(Constants.FOUR_CARD);
|
||||
}
|
||||
}else{
|
||||
return R.fail(Constants.LNVALID_CARD);
|
||||
}
|
||||
//查询卡号对应的用户
|
||||
XhpcIcCardInfo xhpcIcCardInfo = xhpcCardMapper.getXhpcIcCardInfo(iccardInfo.getId().toString());
|
||||
if (xhpcIcCardInfo == null) {
|
||||
return R.fail(Constants.LNVALID_USER);
|
||||
}
|
||||
Long userId = xhpcIcCardInfo.getUserId();
|
||||
Integer userType = xhpcIcCardInfo.getUserType();
|
||||
String tenantId = xhpcIcCardInfo.getTenantId();
|
||||
Integer type = 1;
|
||||
String grantOperator = xhpcIcCardInfo.getGrantOperatorId();
|
||||
return cardHistoryOrderService.cardStartup(userId, serialNumber, userType, tenantId, type, grantOperator);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -183,7 +187,7 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<BindCardEcho> bindCard(Long cardId) {
|
||||
public R<BindCardEcho> noBindCardInfo(Long cardId) {
|
||||
|
||||
BindCardEcho bindCardEcho = new BindCardEcho();
|
||||
TIccardInfo tIccardInfo = tIccardInfoMapper.selectByPrimaryKey(Math.toIntExact(cardId));
|
||||
@ -209,6 +213,8 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
||||
List<Integer> userType = Arrays.stream(userTypeArray).boxed().collect(Collectors.toList());
|
||||
bindCardEcho.setUserType(userType);
|
||||
}
|
||||
bindCardEcho.setCashPledge(Long.valueOf(tIccardInfo.getCashpledge()));
|
||||
bindCardEcho.setCardRecordId(tIccardInfo.getId());
|
||||
return R.ok(bindCardEcho);
|
||||
}
|
||||
|
||||
@ -258,9 +264,8 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
return R.fail("没有此用户类型");
|
||||
}
|
||||
return R.ok(searchCardResponse);
|
||||
} else if (queryCondition.getCardClassification() == 1) {
|
||||
XhpcOperator operator = xhpcOperatorMapper.selectByName(queryCondition.getGrantOperatorName());
|
||||
if (operator == null) {
|
||||
@ -292,11 +297,30 @@ public class XhpcCardServiceImpl implements IXhpcCardService {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
return R.fail("没有此用户类型");
|
||||
}
|
||||
return R.ok(searchCardResponse);
|
||||
}
|
||||
return R.fail("没有此卡类型");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<Object> onlineCardBind(BindCardInfo bindCardInfo) {
|
||||
//check card type is online card
|
||||
if (bindCardInfo.getCardType() != 1) {
|
||||
R.fail("该卡不是联网卡");
|
||||
}
|
||||
//build an association
|
||||
XhpcIcCardInfo xhpcIcCardInfo = new XhpcIcCardInfo();
|
||||
xhpcIcCardInfo.setTIccardInfoId(String.valueOf(bindCardInfo.getCardRecordId()));
|
||||
xhpcIcCardInfo.setUseStatus(1L);
|
||||
xhpcIcCardInfo.setCreateTime(new Date());
|
||||
TIccardInfo tIccardInfo = tIccardInfoMapper.selectByPrimaryKey(bindCardInfo.getCardRecordId());
|
||||
xhpcIcCardInfo.setUserId(tIccardInfo.getUserindex());
|
||||
xhpcIcCardInfo.setUserAccount(bindCardInfo.getUserAccount());
|
||||
xhpcIcCardInfo.setUserType(Long.valueOf(bindCardInfo.getUserType()));
|
||||
xhpcCardMapper.insertSelective(xhpcIcCardInfo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,37 +1,214 @@
|
||||
<?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">
|
||||
<?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">
|
||||
<!--suppress ALL -->
|
||||
<mapper namespace="com.xhpc.card.mapper.XhpcCardMapper">
|
||||
<resultMap id="BaseResultMap" type="com.xhpc.card.pojo.XhpcIcCardInfo">
|
||||
<id column="ic_card_info_id" jdbcType="BIGINT" property="icCardInfoId"/>
|
||||
<result column="t_iccard_info_id" jdbcType="VARCHAR" property="tIccardInfoId"/>
|
||||
<result column="use_status" jdbcType="BIGINT" property="useStatus"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="user_id" jdbcType="INTEGER" property="userId"/>
|
||||
<result column="user_account" jdbcType="VARCHAR" property="userAccount"/>
|
||||
<result column="user_type" jdbcType="BIGINT" property="userType"/>
|
||||
<result column="user_name" jdbcType="VARCHAR" property="userName"/>
|
||||
<result column="user_id_card" jdbcType="VARCHAR" property="userIdCard"/>
|
||||
<result column="user_age" jdbcType="BIGINT" property="userAge"/>
|
||||
<result column="user_sex" jdbcType="BIGINT" property="userSex"/>
|
||||
<result column="user_phone" jdbcType="VARCHAR" property="userPhone"/>
|
||||
<result column="user_vehicle" jdbcType="VARCHAR" property="userVehicle"/>
|
||||
<result column="del_flag" jdbcType="BIGINT" property="delFlag"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
ic_card_info_id
|
||||
, t_iccard_info_id, use_status, create_time, user_id, user_account,
|
||||
user_type, user_name, user_id_card, user_age, user_sex, user_phone, user_vehicle,
|
||||
del_flag
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from xhpc_ic_card_info
|
||||
where ic_card_info_id = #{icCardInfoId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from xhpc_ic_card_info
|
||||
where ic_card_info_id = #{icCardInfoId,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="ic_card_info_id" keyProperty="icCardInfoId"
|
||||
parameterType="com.xhpc.card.pojo.XhpcIcCardInfo" useGeneratedKeys="true">
|
||||
insert into xhpc_ic_card_info (t_iccard_info_id, use_status, create_time,
|
||||
user_id, user_account, user_type,
|
||||
user_name, user_id_card, user_age,
|
||||
user_sex, user_phone, user_vehicle,
|
||||
del_flag)
|
||||
values (#{tIccardInfoId,jdbcType=VARCHAR}, #{useStatus,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{userId,jdbcType=INTEGER}, #{userAccount,jdbcType=VARCHAR}, #{userType,jdbcType=BIGINT},
|
||||
#{userName,jdbcType=VARCHAR}, #{userIdCard,jdbcType=VARCHAR}, #{userAge,jdbcType=BIGINT},
|
||||
#{userSex,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, #{userVehicle,jdbcType=VARCHAR},
|
||||
#{delFlag,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="ic_card_info_id" keyProperty="icCardInfoId"
|
||||
parameterType="com.xhpc.card.pojo.XhpcIcCardInfo" useGeneratedKeys="true">
|
||||
insert into xhpc_ic_card_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="tIccardInfoId != null">
|
||||
t_iccard_info_id,
|
||||
</if>
|
||||
<if test="useStatus != null">
|
||||
use_status,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="userAccount != null">
|
||||
user_account,
|
||||
</if>
|
||||
<if test="userType != null">
|
||||
user_type,
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name,
|
||||
</if>
|
||||
<if test="userIdCard != null">
|
||||
user_id_card,
|
||||
</if>
|
||||
<if test="userAge != null">
|
||||
user_age,
|
||||
</if>
|
||||
<if test="userSex != null">
|
||||
user_sex,
|
||||
</if>
|
||||
<if test="userPhone != null">
|
||||
user_phone,
|
||||
</if>
|
||||
<if test="userVehicle != null">
|
||||
user_vehicle,
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="tIccardInfoId != null">
|
||||
#{tIccardInfoId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="useStatus != null">
|
||||
#{useStatus,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userAccount != null">
|
||||
#{userAccount,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userType != null">
|
||||
#{userType,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
#{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userIdCard != null">
|
||||
#{userIdCard,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userAge != null">
|
||||
#{userAge,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userSex != null">
|
||||
#{userSex,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userPhone != null">
|
||||
#{userPhone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userVehicle != null">
|
||||
#{userVehicle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
#{delFlag,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.card.pojo.XhpcIcCardInfo">
|
||||
update xhpc_ic_card_info
|
||||
<set>
|
||||
<if test="tIccardInfoId != null">
|
||||
t_iccard_info_id = #{tIccardInfoId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="useStatus != null">
|
||||
use_status = #{useStatus,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userAccount != null">
|
||||
user_account = #{userAccount,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userType != null">
|
||||
user_type = #{userType,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userIdCard != null">
|
||||
user_id_card = #{userIdCard,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userAge != null">
|
||||
user_age = #{userAge,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userSex != null">
|
||||
user_sex = #{userSex,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userPhone != null">
|
||||
user_phone = #{userPhone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userVehicle != null">
|
||||
user_vehicle = #{userVehicle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag = #{delFlag,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where ic_card_info_id = #{icCardInfoId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.xhpc.card.pojo.XhpcIcCardInfo">
|
||||
update xhpc_ic_card_info
|
||||
set t_iccard_info_id = #{tIccardInfoId,jdbcType=VARCHAR},
|
||||
use_status = #{useStatus,jdbcType=BIGINT},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
user_account = #{userAccount,jdbcType=VARCHAR},
|
||||
user_type = #{userType,jdbcType=BIGINT},
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
user_id_card = #{userIdCard,jdbcType=VARCHAR},
|
||||
user_age = #{userAge,jdbcType=BIGINT},
|
||||
user_sex = #{userSex,jdbcType=BIGINT},
|
||||
user_phone = #{userPhone,jdbcType=VARCHAR},
|
||||
user_vehicle = #{userVehicle,jdbcType=VARCHAR},
|
||||
del_flag = #{delFlag,jdbcType=BIGINT}
|
||||
where ic_card_info_id = #{icCardInfoId,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<resultMap type="com.xhpc.common.domain.XhpcIcCardInfo" id="XhpcIcCardInfoResult">
|
||||
<result column="ic_card_info_id" property="icCardInfoId"/>
|
||||
<result column="t_iccard_info_id" property="tIccardInfoId"/>
|
||||
<result column="use_status" property="useStatus"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="grant_operator_id" property="grantOperatorId"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="user_account" property="userName"/>
|
||||
<result column="user_type" property="userType"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
<result column="user_id_card" property="userIdCard"/>
|
||||
<result column="user_age" property="userAge"/>
|
||||
<result column="user_sex" property="userSex"/>
|
||||
<result column="user_phone" property="userPhone"/>
|
||||
<result column="user_vehicle" property="userVehicle"/>
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
</resultMap>
|
||||
<select id="getIccardInfoCardno" resultType="com.xhpc.common.domain.IccardInfo">
|
||||
select *
|
||||
from t_iccard_info
|
||||
where cardNo = #{cardno}
|
||||
order by createTime desc limit 1
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getIccardInfoCardno" resultType="com.xhpc.common.domain.IccardInfo">
|
||||
select * from t_iccard_info where cardNo=#{cardno} order by createTime desc limit 1
|
||||
</select>
|
||||
|
||||
<select id="getXhpcIcCardInfo" resultMap="XhpcIcCardInfoResult">
|
||||
select * from xhpc_ic_card_info where t_iccard_info_id=#{tIccardInfoId} and del_flag=0 order by create_time desc limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
<select id="getXhpcIcCardInfo" resultMap="BaseResultMap">
|
||||
select *
|
||||
from xhpc_ic_card_info
|
||||
where t_iccard_info_id = #{tIccardInfoId}
|
||||
and del_flag = 0
|
||||
order by create_time desc limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user