This commit is contained in:
2023-12-01 13:29:35 +08:00
parent dc8caa7716
commit 5ea4130718
14 changed files with 666 additions and 105 deletions

View File

@@ -8,7 +8,7 @@ import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.pile.dto.MemberRegisterAndLoginDTO;
import com.jsowell.pile.dto.PileAuthCardDTO;
import com.jsowell.pile.service.IPileAuthCardService;
import com.jsowell.pile.service.PileAuthCardService;
import com.jsowell.pile.vo.uniapp.AuthCardVO;
import com.jsowell.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -29,7 +29,7 @@ import java.util.List;
public class AuthCardController extends BaseController {
@Autowired
private IPileAuthCardService pileAuthCardService;
private PileAuthCardService pileAuthCardService;
@Autowired
private MemberService memberService;

View File

@@ -78,7 +78,7 @@ public class MemberService {
private IMemberPlateNumberRelationService memberPlateNumberRelationService;
@Autowired
private IPileAuthCardService pileAuthCardService;
private PileAuthCardService pileAuthCardService;
@Autowired
private IMemberInvoiceTitleService memberInvoiceTitleService;

View File

@@ -10,7 +10,7 @@ import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.poi.ExcelUtil;
import com.jsowell.pile.domain.PileAuthCard;
import com.jsowell.pile.dto.PileAuthCardDTO;
import com.jsowell.pile.service.IPileAuthCardService;
import com.jsowell.pile.service.PileAuthCardService;
import com.jsowell.pile.vo.web.PileAuthCardVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -29,7 +29,7 @@ import java.util.List;
@RequestMapping("/pile/card")
public class PileAuthCardController extends BaseController {
@Autowired
private IPileAuthCardService pileAuthCardService;
private PileAuthCardService pileAuthCardService;
/**
* 查询充电站鉴权卡列表

View File

@@ -101,6 +101,7 @@ import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ActiveProfiles("dev")
@SpringBootTest(classes = JsowellApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@@ -180,14 +181,11 @@ public class SpringBootTestController {
private RedisCache redisCache;
@Autowired
private IPileAuthCardService pileAuthCardService;
private PileAuthCardService pileAuthCardService;
@Autowired
private LianLianService lianLianService;
@Autowired
private IMemberTransactionRecordService memberTransactionRecordService;
@Autowired
private IMemberPlateNumberRelationService memberPlateNumberRelationService;
@@ -1258,7 +1256,7 @@ public class SpringBootTestController {
public void testQueryCorpMember() {
List<AdapayMemberAccount> accountList = adapayMemberAccountService.selectAdapayMemberAccountList(new AdapayMemberAccount());
if (CollectionUtils.isNotEmpty(accountList)) {
Long[] ids = accountList.stream().map(AdapayMemberAccount::getId).toArray(Long[]::new);
List<String> ids = accountList.stream().map(x -> x.getId() + "").collect(Collectors.toList());
adapayMemberAccountService.deleteAdapayMemberAccountByIds(ids);
}

View File

@@ -19,8 +19,8 @@ import com.jsowell.pile.domain.PileAuthCard;
import com.jsowell.pile.dto.GenerateOrderDTO;
import com.jsowell.pile.service.IMemberPlateNumberRelationService;
import com.jsowell.pile.service.IOrderBasicInfoService;
import com.jsowell.pile.service.IPileAuthCardService;
import com.jsowell.pile.service.IPileMsgRecordService;
import com.jsowell.pile.service.PileAuthCardService;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -41,7 +41,7 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{
private final String type = YKCUtils.frameType2Str(YKCFrameTypeCode.REQUEST_START_CHARGING_CODE.getBytes());
@Autowired
private IPileAuthCardService pileAuthCardService;
private PileAuthCardService pileAuthCardService;
@Autowired
private IOrderBasicInfoService orderBasicInfoService;

View File

@@ -1,70 +1,76 @@
package com.jsowell.pile.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jsowell.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.*;
import java.util.Date;
/**
* 充电站鉴权卡对象 pile_auth_card
*
* @author jsowell
* @date 2023-03-16
* 充电站鉴权卡
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PileAuthCard {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
private Integer id;
/**
* 逻辑卡号
*/
@Excel(name = "逻辑卡号")
private String logicCard;
/**
* 物理卡号
*/
@Excel(name = "物理卡号")
private String physicsCard;
/**
* 卡状态
* 卡状态(0-待激活1-正常使用2-启动锁定9-停用)
*/
@Excel(name = "卡状态")
private String status;
/**
* 密钥
*/
private String secretKey;
/**
* 所属用户的会员id
*/
@Excel(name = "所属用户的会员id")
private String memberId;
/**
* 所属运营商id
*/
private String merchantId;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建人
*/
private String createBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 更新人
*/
private String updateBy;
/**
* 删除标识0-正常1-删除)
*/
private String delFlag;
@JsonFormat( pattern="yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String createBy;
private Date updateTime;
private String updateBy;
}
}

View File

@@ -12,7 +12,7 @@ import java.util.List;
*/
@Data
public class PileAuthCardDTO {
private Long id;
private Integer id;
private String logicCard;
@@ -28,7 +28,14 @@ public class PileAuthCardDTO {
private String verificationCode;
/**
* 运营商id
* 创建时传过来
*/
private String merchantId;
/**
* 有权限的运营商id列表
*/
private List<String> merchantIdList;
}

View File

@@ -1,7 +1,5 @@
package com.jsowell.pile.mapper;
import java.util.List;
import com.jsowell.pile.domain.PileAuthCard;
import com.jsowell.pile.dto.PileAuthCardDTO;
import com.jsowell.pile.vo.uniapp.AuthCardVO;
@@ -9,14 +7,66 @@ import com.jsowell.pile.vo.web.PileAuthCardVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* 充电站鉴权卡Mapper接口
*
* @author jsowell
* @date 2023-03-16
*/
import java.util.List;
@Repository
public interface PileAuthCardMapper {
/**
* delete by primary key
*
* @param id primaryKey
* @return deleteCount
*/
int deleteByPrimaryKey(Integer id);
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
int insert(PileAuthCard record);
int insertOrUpdate(PileAuthCard record);
int insertOrUpdateSelective(PileAuthCard record);
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
int insertSelective(PileAuthCard record);
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
PileAuthCard selectByPrimaryKey(Integer id);
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(PileAuthCard record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(PileAuthCard record);
int updateBatch(List<PileAuthCard> list);
int batchInsert(@Param("list") List<PileAuthCard> list);
/**
* 查询充电站鉴权卡
*
@@ -26,12 +76,14 @@ public interface PileAuthCardMapper {
// public PileAuthCard selectPileAuthCardById(Long id);
PileAuthCardVO getCardInfoById(Long id);
/**
* 查询充电站鉴权卡信息
*
* @param pileAuthCard
* @return
*/
PileAuthCard selectPileAuthCardInfo (PileAuthCard pileAuthCard);
PileAuthCard selectPileAuthCardInfo(PileAuthCard pileAuthCard);
/**
* 查询充电站鉴权卡列表
@@ -39,7 +91,7 @@ public interface PileAuthCardMapper {
* @param pileAuthCard 充电站鉴权卡
* @return 充电站鉴权卡集合
*/
public List<PileAuthCard> selectPileAuthCardList(PileAuthCard pileAuthCard);
List<PileAuthCard> selectPileAuthCardList(PileAuthCard pileAuthCard);
/**
* 查询充电站鉴权卡列表
@@ -47,7 +99,7 @@ public interface PileAuthCardMapper {
* @param dto 充电站鉴权卡
* @return 充电站鉴权卡集合
*/
public List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCardDTO dto);
List<PileAuthCardVO> getPileAuthCardInfoList(PileAuthCardDTO dto);
/**
* 新增充电站鉴权卡
@@ -55,7 +107,7 @@ public interface PileAuthCardMapper {
* @param pileAuthCard 充电站鉴权卡
* @return 结果
*/
public int insertPileAuthCard(PileAuthCard pileAuthCard);
int insertPileAuthCard(PileAuthCard pileAuthCard);
/**
* 修改充电站鉴权卡
@@ -63,7 +115,7 @@ public interface PileAuthCardMapper {
* @param pileAuthCard 充电站鉴权卡
* @return 结果
*/
public int updatePileAuthCard(PileAuthCard pileAuthCard);
int updatePileAuthCard(PileAuthCard pileAuthCard);
/**
* 删除充电站鉴权卡
@@ -71,10 +123,11 @@ public interface PileAuthCardMapper {
* @param id 充电站鉴权卡主键
* @return 结果
*/
public int deletePileAuthCardById(Long id);
int deletePileAuthCardById(Long id);
/**
* 停用某张卡
*
* @param id
* @return
*/
@@ -86,12 +139,13 @@ public interface PileAuthCardMapper {
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deletePileAuthCardByIds(Long[] ids);
int deletePileAuthCardByIds(Long[] ids);
int unBindingCard(PileAuthCard pileAuthCard);
/**
* 根据逻辑卡号查询某状态的鉴权卡信息
*
* @param status
* @param logicCard
* @return
@@ -100,8 +154,9 @@ public interface PileAuthCardMapper {
/**
* 通过memberId查询鉴权卡列表 (小程序用)
*
* @param memberId
* @return
*/
List<AuthCardVO> getAuthCardListByMemberId(@Param("memberId") String memberId);
}
}

View File

@@ -1,19 +1,34 @@
package com.jsowell.pile.service;
import java.util.List;
import com.jsowell.pile.domain.PileAuthCard;
import com.jsowell.pile.dto.PileAuthCardDTO;
import com.jsowell.pile.vo.uniapp.AuthCardVO;
import com.jsowell.pile.vo.web.PileAuthCardVO;
/**
* 充电站鉴权卡Service接口
*
* @author jsowell
* @date 2023-03-16
*/
public interface IPileAuthCardService {
import java.util.List;
public interface PileAuthCardService{
int deleteByPrimaryKey(Integer id);
int insert(PileAuthCard record);
int insertOrUpdate(PileAuthCard record);
int insertOrUpdateSelective(PileAuthCard record);
int insertSelective(PileAuthCard record);
PileAuthCard selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(PileAuthCard record);
int updateByPrimaryKey(PileAuthCard record);
int updateBatch(List<PileAuthCard> list);
int batchInsert(List<PileAuthCard> list);
/**
* 查询充电站鉴权卡
*
@@ -132,4 +147,5 @@ public interface IPileAuthCardService {
* @return
*/
int unbindAuthCard(PileAuthCardDTO dto);
}

View File

@@ -97,8 +97,6 @@ public class AdapayMemberAccountServiceImpl implements AdapayMemberAccountServic
return adapayMemberAccountMapper.deleteAdapayMemberAccountByIds(ids);
}
@Override
public AdapayMemberAccount selectByMerchantId(String merchantId) {
if (StringUtils.isBlank(merchantId)) {

View File

@@ -132,7 +132,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
private IPileBillingTemplateService pileBillingTemplateService;
@Autowired
private IPileAuthCardService pileAuthCardService;
private PileAuthCardService pileAuthCardService;
@Autowired
private OrderMonitorDataService orderMonitorDataService;

View File

@@ -9,7 +9,7 @@ import com.jsowell.pile.domain.PileAuthCard;
import com.jsowell.pile.dto.PileAuthCardDTO;
import com.jsowell.pile.mapper.PileAuthCardMapper;
import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IPileAuthCardService;
import com.jsowell.pile.service.PileAuthCardService;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.LoginUserDetailVO;
import com.jsowell.pile.vo.base.MerchantInfoVO;
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
* @date 2023-03-16
*/
@Service
public class PileAuthCardServiceImpl implements IPileAuthCardService {
public class PileAuthCardServiceImpl implements PileAuthCardService {
@Autowired
private PileAuthCardMapper pileAuthCardMapper;
@@ -48,7 +48,6 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
// public PileAuthCard selectPileAuthCardById(Long id) {
// return pileAuthCardMapper.selectPileAuthCardById(id);
// }
@Override
public PileAuthCardVO getCardInfoById(Long id) {
return pileAuthCardMapper.getCardInfoById(id);
@@ -56,6 +55,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
/**
* 查询充电站鉴权卡信息
*
* @param pileAuthCard
* @return
*/
@@ -112,7 +112,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
String logicCard = dto.getLogicCard();
// 根据卡号查询数据库
PileAuthCard cardInfo = pileAuthCardMapper.selectSomeStatusCardInfo(null, logicCard);
if(cardInfo != null) {
if (cardInfo != null) {
// 不为空说明此卡已存在
throw new BusinessException(ReturnCodeEnum.CODE_AUTH_CARD_CODE_EXIST);
}
@@ -136,10 +136,11 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
PileAuthCard pileAuthCard = PileAuthCard.builder()
.logicCard(logicCard)
.memberId(memberId)
.merchantId(dto.getMerchantId())
.status(status)
.secretKey(secretKey)
.build();
return pileAuthCardMapper.insertPileAuthCard(pileAuthCard);
return pileAuthCardMapper.insertSelective(pileAuthCard);
}
/**
@@ -167,7 +168,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
.memberId(memberBasicInfo.getMemberId())
.status("1")
.build();
return pileAuthCardMapper.updatePileAuthCard(pileAuthCard);
return pileAuthCardMapper.updateByPrimaryKeySelective(pileAuthCard);
}
/**
@@ -204,6 +205,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
/**
* 根据逻辑卡号查询某状态的鉴权卡信息
*
* @param status
* @param logicCard
* @return
@@ -215,6 +217,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
/**
* 通过逻辑卡号查询卡信息
*
* @param logicCard
* @return
*/
@@ -225,6 +228,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
/**
* 通过memberId查询鉴权卡列表 (小程序用)
*
* @param memberId
* @return
*/
@@ -239,6 +243,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
/**
* 用户绑定鉴权卡
*
* @param dto
*/
@Override
@@ -266,6 +271,7 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
/**
* 用户解绑鉴权卡
*
* @param dto
* @return
*/
@@ -287,4 +293,55 @@ public class PileAuthCardServiceImpl implements IPileAuthCardService {
pileAuthCard.setSecretKey(secretKey);
return updatePileAuthCard(pileAuthCard);
}
@Override
public int deleteByPrimaryKey(Integer id) {
return pileAuthCardMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(PileAuthCard record) {
return pileAuthCardMapper.insert(record);
}
@Override
public int insertOrUpdate(PileAuthCard record) {
return pileAuthCardMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(PileAuthCard record) {
return pileAuthCardMapper.insertOrUpdateSelective(record);
}
@Override
public int insertSelective(PileAuthCard record) {
return pileAuthCardMapper.insertSelective(record);
}
@Override
public PileAuthCard selectByPrimaryKey(Integer id) {
return pileAuthCardMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(PileAuthCard record) {
return pileAuthCardMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(PileAuthCard record) {
return pileAuthCardMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<PileAuthCard> list) {
return pileAuthCardMapper.updateBatch(list);
}
@Override
public int batchInsert(List<PileAuthCard> list) {
return pileAuthCardMapper.batchInsert(list);
}
}

View File

@@ -88,7 +88,7 @@ public abstract class AbstractOrderLogic implements InitializingBean {
protected AdapayCallbackRecordService adapayCallbackRecordService;
@Autowired
protected IPileAuthCardService pileAuthCardService;
protected PileAuthCardService pileAuthCardService;
@Autowired
protected IMemberPlateNumberRelationService memberPlateNumberRelationService;

View File

@@ -1,33 +1,457 @@
<?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">
<mapper namespace="com.jsowell.pile.mapper.PileAuthCardMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.PileAuthCard">
<!--@mbg.generated-->
<!--@Table pile_auth_card-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="logic_card" jdbcType="VARCHAR" property="logicCard" />
<result column="physics_card" jdbcType="VARCHAR" property="physicsCard" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="secret_key" jdbcType="VARCHAR" property="secretKey" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="del_flag" jdbcType="VARCHAR" property="delFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, logic_card, physics_card, `status`, secret_key, member_id, merchant_id, create_time,
create_by, update_time, update_by, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from pile_auth_card
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from pile_auth_card
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileAuthCard" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into pile_auth_card (logic_card, physics_card, `status`,
secret_key, member_id, merchant_id,
create_time, create_by, update_time,
update_by, del_flag)
values (#{logicCard,jdbcType=VARCHAR}, #{physicsCard,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{secretKey,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileAuthCard" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into pile_auth_card
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="logicCard != null">
logic_card,
</if>
<if test="physicsCard != null">
physics_card,
</if>
<if test="status != null">
`status`,
</if>
<if test="secretKey != null">
secret_key,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="merchantId != null">
merchant_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="logicCard != null">
#{logicCard,jdbcType=VARCHAR},
</if>
<if test="physicsCard != null">
#{physicsCard,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="secretKey != null">
#{secretKey,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
#{merchantId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.PileAuthCard">
<!--@mbg.generated-->
update pile_auth_card
<set>
<if test="logicCard != null">
logic_card = #{logicCard,jdbcType=VARCHAR},
</if>
<if test="physicsCard != null">
physics_card = #{physicsCard,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="secretKey != null">
secret_key = #{secretKey,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.PileAuthCard">
<!--@mbg.generated-->
update pile_auth_card
set logic_card = #{logicCard,jdbcType=VARCHAR},
physics_card = #{physicsCard,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
secret_key = #{secretKey,jdbcType=VARCHAR},
member_id = #{memberId,jdbcType=VARCHAR},
merchant_id = #{merchantId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
del_flag = #{delFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update pile_auth_card
<trim prefix="set" suffixOverrides=",">
<trim prefix="logic_card = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.logicCard,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="physics_card = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.physicsCard,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="secret_key = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.secretKey,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="member_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="merchant_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="del_flag = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into pile_auth_card
(logic_card, physics_card, `status`, secret_key, member_id, merchant_id, create_time,
create_by, update_time, update_by, del_flag)
values
<foreach collection="list" item="item" separator=",">
(#{item.logicCard,jdbcType=VARCHAR}, #{item.physicsCard,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR},
#{item.secretKey,jdbcType=VARCHAR}, #{item.memberId,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.createBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.updateBy,jdbcType=VARCHAR}, #{item.delFlag,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileAuthCard" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into pile_auth_card
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
logic_card,
physics_card,
`status`,
secret_key,
member_id,
merchant_id,
create_time,
create_by,
update_time,
update_by,
del_flag,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{logicCard,jdbcType=VARCHAR},
#{physicsCard,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR},
#{secretKey,jdbcType=VARCHAR},
#{memberId,jdbcType=VARCHAR},
#{merchantId,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR},
#{delFlag,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
logic_card = #{logicCard,jdbcType=VARCHAR},
physics_card = #{physicsCard,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
secret_key = #{secretKey,jdbcType=VARCHAR},
member_id = #{memberId,jdbcType=VARCHAR},
merchant_id = #{merchantId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
del_flag = #{delFlag,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.PileAuthCard" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into pile_auth_card
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="logicCard != null">
logic_card,
</if>
<if test="physicsCard != null">
physics_card,
</if>
<if test="status != null">
`status`,
</if>
<if test="secretKey != null">
secret_key,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="merchantId != null">
merchant_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="logicCard != null">
#{logicCard,jdbcType=VARCHAR},
</if>
<if test="physicsCard != null">
#{physicsCard,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="secretKey != null">
#{secretKey,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
#{merchantId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="logicCard != null">
logic_card = #{logicCard,jdbcType=VARCHAR},
</if>
<if test="physicsCard != null">
physics_card = #{physicsCard,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="secretKey != null">
secret_key = #{secretKey,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<resultMap type="com.jsowell.pile.domain.PileAuthCard" id="PileAuthCardResult">
<result property="id" column="id" />
<result property="logicCard" column="logic_card" />
<result property="physicsCard" column="physics_card" />
<result property="status" column="status" />
<result property="secretKey" column="secret_key" />
<result property="memberId" column="member_id" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
<resultMap id="PileAuthCardResult" type="com.jsowell.pile.domain.PileAuthCard">
<result column="id" property="id" />
<result column="logic_card" property="logicCard" />
<result column="physics_card" property="physicsCard" />
<result column="status" property="status" />
<result column="secret_key" property="secretKey" />
<result column="member_id" property="memberId" />
<result column="create_time" property="createTime" />
<result column="create_by" property="createBy" />
<result column="update_time" property="updateTime" />
<result column="update_by" property="updateBy" />
<result column="del_flag" property="delFlag" />
</resultMap>
<sql id="selectPileAuthCardVo">
select id, logic_card, physics_card, status, secret_key, member_id, create_time, create_by, update_time, update_by, del_flag from pile_auth_card
</sql>
<sql id="Base_Column_List" >
<sql id="Base_Column_List">
id, logic_card, physics_card, status, secret_key, member_id, create_time, create_by, update_time, update_by, del_flag
</sql>
<select id="selectPileAuthCardList" parameterType="com.jsowell.pile.domain.PileAuthCard" resultMap="PileAuthCardResult">
<include refid="selectPileAuthCardVo"/>
<include refid="selectPileAuthCardVo" />
<where>
<if test="logicCard != null and logicCard != ''"> and logic_card = #{logicCard}</if>
<if test="physicsCard != null and physicsCard != ''"> and physics_card = #{physicsCard}</if>
@@ -37,10 +461,10 @@
</where>
</select>
<!-- <select id="selectPileAuthCardById" parameterType="Long" resultMap="PileAuthCardResult">-->
<!-- <include refid="selectPileAuthCardVo"/>-->
<!-- &lt;select id="selectPileAuthCardById" parameterType="Long" resultMap="PileAuthCardResult"&gt;-->
<!-- &lt;include refid="selectPileAuthCardVo"/&gt;-->
<!-- where id = #{id}-->
<!-- </select>-->
<!-- &lt;/select&gt;-->
<select id="getCardInfoById" parameterType="Long" resultType="com.jsowell.pile.vo.web.PileAuthCardVO">
select
@@ -60,7 +484,7 @@
</select>
<insert id="insertPileAuthCard" parameterType="com.jsowell.pile.domain.PileAuthCard" useGeneratedKeys="true" keyProperty="id">
<insert id="insertPileAuthCard" keyProperty="id" parameterType="com.jsowell.pile.domain.PileAuthCard" useGeneratedKeys="true">
insert into pile_auth_card
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="logicCard != null">logic_card,</if>
@@ -116,14 +540,14 @@
<delete id="deletePileAuthCardByIds" parameterType="String">
delete from pile_auth_card where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
<foreach close=")" collection="array" item="id" open="(" separator=",">
#{id}
</foreach>
</delete>
<select id="selectPileAuthCardInfo" resultMap="PileAuthCardResult">
select
<include refid="Base_Column_List"/>
<include refid="Base_Column_List" />
from pile_auth_card
where del_flag = '0'
<if test="memberId != null and memberId != ''">
@@ -146,7 +570,7 @@
<select id="selectSomeStatusCardInfo" resultMap="PileAuthCardResult">
select
<include refid="Base_Column_List"/>
<include refid="Base_Column_List" />
from
pile_auth_card
where del_flag = '0'
@@ -180,7 +604,7 @@
<if test="memberId != null and memberId != ''"> and t1.member_id = #{memberId}</if>
<if test="merchantIdList != null and merchantIdList.size() != 0">
and t1.merchant_id in
<foreach collection="merchantIdList" item="merchantId" open="(" separator="," close=")">
<foreach close=")" collection="merchantIdList" item="merchantId" open="(" separator=",">
#{merchantId,jdbcType=VARCHAR}
</foreach>
</if>