Files
jsowell-charger-web/jsowell-pile/src/main/resources/mapper/pile/PileAuthCardMapper.xml

625 lines
24 KiB
XML
Raw Normal View History

2023-12-01 13:29:35 +08:00
<?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">
2023-03-16 13:19:27 +08:00
<mapper namespace="com.jsowell.pile.mapper.PileAuthCardMapper">
2023-12-01 13:29:35 +08:00
<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>
2023-03-16 13:19:27 +08:00
2023-12-01 13:29:35 +08:00
<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" />
2023-03-16 13:19:27 +08:00
</resultMap>
<sql id="selectPileAuthCardVo">
2023-03-28 14:31:31 +08:00
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>
2023-03-16 13:19:27 +08:00
<select id="selectPileAuthCardList" parameterType="com.jsowell.pile.domain.PileAuthCard" resultMap="PileAuthCardResult">
2023-12-01 13:29:35 +08:00
<include refid="selectPileAuthCardVo" />
2023-03-16 13:19:27 +08:00
<where>
<if test="logicCard != null and logicCard != ''"> and logic_card = #{logicCard}</if>
<if test="physicsCard != null and physicsCard != ''"> and physics_card = #{physicsCard}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
2023-03-28 14:31:31 +08:00
<if test="secretKey != null and secretKey != ''"> and secret_key = #{secretKey}</if>
2023-03-16 13:19:27 +08:00
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
</where>
</select>
2023-12-01 13:29:35 +08:00
<!-- &lt;select id="selectPileAuthCardById" parameterType="Long" resultMap="PileAuthCardResult"&gt;-->
<!-- &lt;include refid="selectPileAuthCardVo"/&gt;-->
2023-03-24 13:15:52 +08:00
<!-- where id = #{id}-->
2023-12-01 13:29:35 +08:00
<!-- &lt;/select&gt;-->
2023-03-24 13:15:52 +08:00
<select id="getCardInfoById" parameterType="Long" resultType="com.jsowell.pile.vo.web.PileAuthCardVO">
select
t1.id,
t1.logic_card as logicCard,
t1.physics_card as physicsCard,
t1.status,
2023-03-28 14:31:31 +08:00
t1.secret_key as secretKey,
2023-03-24 13:15:52 +08:00
t1.create_time as createTime,
t1.member_id as memberId,
t2.mobile_number as phoneNumber,
t2.nick_name as nickName
from pile_auth_card t1
left join member_basic_info t2 on t1.member_id = t2.member_id
2023-03-24 13:15:52 +08:00
where t1.del_flag = '0'
and t1.id = #{id}
2023-03-16 13:19:27 +08:00
</select>
2023-03-24 13:15:52 +08:00
2023-12-01 13:29:35 +08:00
<insert id="insertPileAuthCard" keyProperty="id" parameterType="com.jsowell.pile.domain.PileAuthCard" useGeneratedKeys="true">
2023-03-16 13:19:27 +08:00
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>
2023-03-28 14:31:31 +08:00
<if test="secretKey != null">secret_key,</if>
2023-03-16 13:19:27 +08:00
<if test="memberId != null">member_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},</if>
<if test="physicsCard != null">#{physicsCard},</if>
<if test="status != null">#{status},</if>
2023-03-28 14:31:31 +08:00
<if test="secretKey != null">#{secretKey},</if>
2023-03-16 13:19:27 +08:00
<if test="memberId != null">#{memberId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updatePileAuthCard" parameterType="com.jsowell.pile.domain.PileAuthCard">
update pile_auth_card
<trim prefix="SET" suffixOverrides=",">
<if test="logicCard != null">logic_card = #{logicCard},</if>
<if test="physicsCard != null">physics_card = #{physicsCard},</if>
<if test="status != null">status = #{status},</if>
2023-03-16 13:19:27 +08:00
<if test="memberId != null">member_id = #{memberId},</if>
2023-11-28 16:47:19 +08:00
<if test="secretKey != null">secret_key = #{secretKey},</if>
2023-03-16 13:19:27 +08:00
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileAuthCardById" parameterType="Long">
delete from pile_auth_card where id = #{id}
</delete>
2023-03-28 14:31:31 +08:00
<update id="deactivateCard" parameterType="Long">
update pile_auth_card
set status = '9'
where id = #{id,jdbcType=BIGINT}
</update>
2023-03-16 13:19:27 +08:00
<delete id="deletePileAuthCardByIds" parameterType="String">
delete from pile_auth_card where id in
2023-12-01 13:29:35 +08:00
<foreach close=")" collection="array" item="id" open="(" separator=",">
2023-03-16 13:19:27 +08:00
#{id}
</foreach>
</delete>
<select id="selectPileAuthCardInfo" resultMap="PileAuthCardResult">
select
2023-12-01 13:29:35 +08:00
<include refid="Base_Column_List" />
from pile_auth_card
2023-11-29 14:31:17 +08:00
where del_flag = '0'
<if test="memberId != null and memberId != ''">
and member_id = #{memberId,jdbcType=VARCHAR}
</if>
<if test="physicsCard != null and physicsCard != ''">
and physics_card = #{physicsCard,jdbcType=VARCHAR}
</if>
<if test="logicCard != null and logicCard != ''">
and logic_card = #{logicCard,jdbcType=VARCHAR}
</if>
limit 1
</select>
2023-03-20 17:02:30 +08:00
<update id="unBindingCard">
update pile_auth_card
2023-11-29 14:31:17 +08:00
set status = '0', member_id = null
where id = #{id,jdbcType=BIGINT}
2023-03-20 17:02:30 +08:00
</update>
2023-03-23 10:09:22 +08:00
2023-03-30 11:09:17 +08:00
<select id="selectSomeStatusCardInfo" resultMap="PileAuthCardResult">
2023-03-30 10:54:02 +08:00
select
2023-12-01 13:29:35 +08:00
<include refid="Base_Column_List" />
2023-03-30 10:54:02 +08:00
from
pile_auth_card
2023-11-28 16:39:39 +08:00
where del_flag = '0'
2023-03-30 10:54:02 +08:00
<if test="status != null and status != ''">
and status = #{status,jdbcType=VARCHAR}
</if>
<if test="logicCard != null and logicCard != ''">
and logic_card = #{logicCard,jdbcType=VARCHAR}
</if>
limit 1
</select>
2023-03-23 10:09:22 +08:00
<select id="getPileAuthCardInfoList" resultType="com.jsowell.pile.vo.web.PileAuthCardVO">
select
t1.id,
t1.logic_card as logicCard,
t1.physics_card as physicsCard,
2023-03-24 13:15:52 +08:00
t1.status,
2023-03-28 14:31:31 +08:00
t1.secret_key as secretKey,
2023-03-24 13:15:52 +08:00
t1.create_time as createTime,
2023-03-23 10:09:22 +08:00
t1.member_id as memberId,
2023-03-24 13:15:52 +08:00
t2.mobile_number as phoneNumber,
2023-03-23 10:09:22 +08:00
t2.nick_name as nickName
from pile_auth_card t1
left join member_basic_info t2 on t1.member_id = t2.member_id
2023-03-23 10:09:22 +08:00
where t1.del_flag = '0'
2023-03-24 13:15:52 +08:00
<if test="logicCard != null and logicCard != ''"> and t1.logic_card = #{logicCard}</if>
<if test="physicsCard != null and physicsCard != ''"> and t1.physics_card = #{physicsCard}</if>
<if test="status != null and status != ''"> and t1.status = #{status}</if>
<if test="phoneNumber != null and phoneNumber != ''"> and t2.mobile_number = #{phoneNumber}</if>
<if test="memberId != null and memberId != ''"> and t1.member_id = #{memberId}</if>
2023-12-01 10:11:19 +08:00
<if test="merchantIdList != null and merchantIdList.size() != 0">
and t1.merchant_id in
2023-12-01 13:29:35 +08:00
<foreach close=")" collection="merchantIdList" item="merchantId" open="(" separator=",">
2023-12-01 10:11:19 +08:00
#{merchantId,jdbcType=VARCHAR}
</foreach>
</if>
2023-03-23 10:09:22 +08:00
</select>
2024-03-05 16:41:56 +08:00
<select id="getAuthCardListByMemberId" resultType="com.jsowell.pile.vo.uniapp.AuthCardVO">
SELECT t1.member_id AS memberId,
t1.mobile_number AS phoneNumber,
t2.logic_card AS logicCard,
t2.status as status,
t3.wallet_code AS walletCode,
t3.merchant_id as merchantId,
t3.principal_balance AS principalBalance,
t3.gift_balance AS giftBalance,
t2.create_time AS createTime
FROM member_basic_info t1
JOIN pile_auth_card t2 ON t1.member_id = t2.member_id and t2.del_flag = '0'
JOIN member_wallet_info t3 ON t2.member_id = t3.member_id AND t3.merchant_id = t2.merchant_id
WHERE t1.del_flag = '0'
AND t1.member_id = #{memberId,jdbcType=VARCHAR};
</select>
2023-03-16 13:19:27 +08:00
</mapper>