Files
zxjp-web/coolstore-partner-dao/src/main/resources/mapper/HyPartnerBaseInfoMapper.xml
2023-06-20 17:25:49 +08:00

250 lines
8.2 KiB
XML

<?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.cool.store.mapper.HyPartnerBaseInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerBaseInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
<result column="partner_line_id" jdbcType="BIGINT" property="partnerLineId" />
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="sex" jdbcType="BIT" property="sex" />
<result column="nation" jdbcType="VARCHAR" property="nation" />
<result column="birthdate" jdbcType="DATE" property="birthdate" />
<result column="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="id_card_photo_front" jdbcType="VARCHAR" property="idCardPhotoFront" />
<result column="id_card_photo_black" jdbcType="VARCHAR" property="idCardPhotoBlack" />
<result column="live_address" jdbcType="VARCHAR" property="liveAddress" />
<result column="user_portrait" jdbcType="VARCHAR" property="userPortrait" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="latest_log_message" jdbcType="VARCHAR" property="latestLogMessage" />
<result column="pass_reason" jdbcType="VARCHAR" property="passReason" />
<result column="certify_file" jdbcType="VARCHAR" property="certifyFile" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, partner_id, partner_line_id, mobile, username, sex, nation, birthdate, id_card,
id_card_photo_front, id_card_photo_black, live_address, user_portrait, status, latest_log_message,
pass_reason, certify_file, create_time, update_time
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_base_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null">
partner_id,
</if>
<if test="record.partnerLineId != null">
partner_line_id,
</if>
<if test="record.mobile != null">
mobile,
</if>
<if test="record.username != null">
username,
</if>
<if test="record.sex != null">
sex,
</if>
<if test="record.nation != null">
nation,
</if>
<if test="record.birthdate != null">
birthdate,
</if>
<if test="record.idCard != null">
id_card,
</if>
<if test="record.idCardPhotoFront != null">
id_card_photo_front,
</if>
<if test="record.idCardPhotoBlack != null">
id_card_photo_black,
</if>
<if test="record.liveAddress != null">
live_address,
</if>
<if test="record.userPortrait != null">
user_portrait,
</if>
<if test="record.status != null">
status,
</if>
<if test="record.latestLogMessage != null">
latest_log_message,
</if>
<if test="record.passReason != null">
pass_reason,
</if>
<if test="record.certifyFile != null">
certify_file,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null">
#{record.partnerId},
</if>
<if test="record.partnerLineId != null">
#{record.partnerLineId},
</if>
<if test="record.mobile != null">
#{record.mobile},
</if>
<if test="record.username != null">
#{record.username},
</if>
<if test="record.sex != null">
#{record.sex},
</if>
<if test="record.nation != null">
#{record.nation},
</if>
<if test="record.birthdate != null">
#{record.birthdate},
</if>
<if test="record.idCard != null">
#{record.idCard},
</if>
<if test="record.idCardPhotoFront != null">
#{record.idCardPhotoFront},
</if>
<if test="record.idCardPhotoBlack != null">
#{record.idCardPhotoBlack},
</if>
<if test="record.liveAddress != null">
#{record.liveAddress},
</if>
<if test="record.userPortrait != null">
#{record.userPortrait},
</if>
<if test="record.status != null">
#{record.status},
</if>
<if test="record.latestLogMessage != null">
#{record.latestLogMessage},
</if>
<if test="record.passReason != null">
#{record.passReason},
</if>
<if test="record.certifyFile != null">
#{record.certifyFile},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update hy_partner_base_info
<set>
<if test="record.partnerId != null">
partner_id = #{record.partnerId},
</if>
<if test="record.partnerLineId != null">
partner_line_id = #{record.partnerLineId},
</if>
<if test="record.mobile != null">
mobile = #{record.mobile},
</if>
<if test="record.username != null">
username = #{record.username},
</if>
<if test="record.sex != null">
sex = #{record.sex},
</if>
<if test="record.nation != null">
nation = #{record.nation},
</if>
<if test="record.birthdate != null">
birthdate = #{record.birthdate},
</if>
<if test="record.idCard != null">
id_card = #{record.idCard},
</if>
<if test="record.idCardPhotoFront != null">
id_card_photo_front = #{record.idCardPhotoFront},
</if>
<if test="record.idCardPhotoBlack != null">
id_card_photo_black = #{record.idCardPhotoBlack},
</if>
<if test="record.liveAddress != null">
live_address = #{record.liveAddress},
</if>
<if test="record.userPortrait != null">
user_portrait = #{record.userPortrait},
</if>
<if test="record.status != null">
status = #{record.status},
</if>
<if test="record.latestLogMessage != null">
latest_log_message = #{record.latestLogMessage},
</if>
<if test="record.passReason != null">
pass_reason = #{record.passReason},
</if>
<if test="record.certifyFile != null">
certify_file = #{record.certifyFile},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
</set>
where id = #{record.id}
</update>
<update id="updateByPartnerId">
update hy_partner_base_info
<set>
<if test="userName != null and userName!=''">
username = #{userName},
</if>
<if test="mobile != null and mobile!=''">
mobile = #{mobile},
</if>
</set>
where partner_id = #{partnerId}
</update>
<select id="getByPartnerIdAndLineId" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List"></include>
from hy_partner_base_info
where partner_id = #{partnerId} and partner_line_id = #{partnerLineId}
</select>
<select id="getByPartnerLineId" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List"></include>
from hy_partner_base_info
where partner_line_id = #{partnerLineId}
</select>
<select id="getLineIdByIdCard" resultType="java.lang.Long">
select
partner_line_id
from hy_partner_base_info
where id_card = #{idCard}
</select>
<update id="cleanIdCardInfoByPartnerLineId">
update hy_partner_base_info
set
id_card = #{idCard},
id_card_photo_front = #{idCardPhotoFront},
id_card_photo_black = #{idCardPhotoBlack}
where partner_line_id = #{partnerLineId}
</update>
</mapper>