123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <?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.juxiao.xchat.module.xbd.mapper.users.UserRealNameMapper" >
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UserRealName" >
- <id column="uid" property="uid" jdbcType="BIGINT" />
- <result column="real_name" property="realName" jdbcType="VARCHAR" />
- <result column="id_card_no" property="idCardNo" jdbcType="VARCHAR" />
- <result column="id_card_front" property="idCardFront" jdbcType="VARCHAR" />
- <result column="id_card_opposite" property="idCardOpposite" jdbcType="VARCHAR" />
- <result column="id_card_handheld" property="idCardHandheld" jdbcType="VARCHAR" />
- <result column="phone" property="phone" jdbcType="VARCHAR" />
- <result column="audit_status" property="auditStatus" jdbcType="BIT" />
- <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
- <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
- <result column="admin_id" property="adminId" jdbcType="INTEGER" />
- <result column="is_first" property="isFirst" jdbcType="BIT" />
- </resultMap>
- <sql id="Base_Column_List" >
- uid, real_name, id_card_no, id_card_front, id_card_opposite, id_card_handheld, phone,
- audit_status, create_date, update_date, admin_id, is_first
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from user_real_name
- where uid = #{uid,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
- delete from user_real_name
- where uid = #{uid,jdbcType=BIGINT}
- </delete>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserRealName" >
- insert into user_real_name (uid, real_name, id_card_no,
- id_card_front, id_card_opposite, id_card_handheld,
- phone, audit_status, create_date,
- update_date, admin_id, is_first
- )
- values (#{uid,jdbcType=BIGINT}, #{realName,jdbcType=VARCHAR}, #{idCardNo,jdbcType=VARCHAR},
- #{idCardFront,jdbcType=VARCHAR}, #{idCardOpposite,jdbcType=VARCHAR}, #{idCardHandheld,jdbcType=VARCHAR},
- #{phone,jdbcType=VARCHAR}, #{auditStatus,jdbcType=BIT}, #{createDate,jdbcType=TIMESTAMP},
- #{updateDate,jdbcType=TIMESTAMP}, #{adminId,jdbcType=INTEGER}, #{isFirst,jdbcType=BIT}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserRealName" >
- insert into user_real_name
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- uid,
- </if>
- <if test="realName != null" >
- real_name,
- </if>
- <if test="idCardNo != null" >
- id_card_no,
- </if>
- <if test="idCardFront != null" >
- id_card_front,
- </if>
- <if test="idCardOpposite != null" >
- id_card_opposite,
- </if>
- <if test="idCardHandheld != null" >
- id_card_handheld,
- </if>
- <if test="phone != null" >
- phone,
- </if>
- <if test="auditStatus != null" >
- audit_status,
- </if>
- <if test="createDate != null" >
- create_date,
- </if>
- <if test="updateDate != null" >
- update_date,
- </if>
- <if test="adminId != null" >
- admin_id,
- </if>
- <if test="isFirst != null" >
- is_first,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="realName != null" >
- #{realName,jdbcType=VARCHAR},
- </if>
- <if test="idCardNo != null" >
- #{idCardNo,jdbcType=VARCHAR},
- </if>
- <if test="idCardFront != null" >
- #{idCardFront,jdbcType=VARCHAR},
- </if>
- <if test="idCardOpposite != null" >
- #{idCardOpposite,jdbcType=VARCHAR},
- </if>
- <if test="idCardHandheld != null" >
- #{idCardHandheld,jdbcType=VARCHAR},
- </if>
- <if test="phone != null" >
- #{phone,jdbcType=VARCHAR},
- </if>
- <if test="auditStatus != null" >
- #{auditStatus,jdbcType=BIT},
- </if>
- <if test="createDate != null" >
- #{createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="updateDate != null" >
- #{updateDate,jdbcType=TIMESTAMP},
- </if>
- <if test="adminId != null" >
- #{adminId,jdbcType=INTEGER},
- </if>
- <if test="isFirst != null" >
- #{isFirst,jdbcType=BIT},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserRealName" >
- update user_real_name
- <set >
- <if test="realName != null" >
- real_name = #{realName,jdbcType=VARCHAR},
- </if>
- <if test="idCardNo != null" >
- id_card_no = #{idCardNo,jdbcType=VARCHAR},
- </if>
- <if test="idCardFront != null" >
- id_card_front = #{idCardFront,jdbcType=VARCHAR},
- </if>
- <if test="idCardOpposite != null" >
- id_card_opposite = #{idCardOpposite,jdbcType=VARCHAR},
- </if>
- <if test="idCardHandheld != null" >
- id_card_handheld = #{idCardHandheld,jdbcType=VARCHAR},
- </if>
- <if test="phone != null" >
- phone = #{phone,jdbcType=VARCHAR},
- </if>
- <if test="auditStatus != null" >
- audit_status = #{auditStatus,jdbcType=BIT},
- </if>
- <if test="createDate != null" >
- create_date = #{createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="updateDate != null" >
- update_date = #{updateDate,jdbcType=TIMESTAMP},
- </if>
- <if test="adminId != null" >
- admin_id = #{adminId,jdbcType=INTEGER},
- </if>
- <if test="isFirst != null" >
- is_first = #{isFirst,jdbcType=BIT},
- </if>
- </set>
- where uid = #{uid,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserRealName" >
- update user_real_name
- set real_name = #{realName,jdbcType=VARCHAR},
- id_card_no = #{idCardNo,jdbcType=VARCHAR},
- id_card_front = #{idCardFront,jdbcType=VARCHAR},
- id_card_opposite = #{idCardOpposite,jdbcType=VARCHAR},
- id_card_handheld = #{idCardHandheld,jdbcType=VARCHAR},
- phone = #{phone,jdbcType=VARCHAR},
- audit_status = #{auditStatus,jdbcType=BIT},
- create_date = #{createDate,jdbcType=TIMESTAMP},
- update_date = #{updateDate,jdbcType=TIMESTAMP},
- admin_id = #{adminId,jdbcType=INTEGER},
- is_first = #{isFirst,jdbcType=BIT}
- where uid = #{uid,jdbcType=BIGINT}
- </update>
- <select id="selectUsersRealNameByList" resultType="com.juxiao.xchat.module.xbd.vo.UserRealNameInfoVO">
- SELECT
- urn.uid AS uid,
- urn.real_name AS realName,
- urn.id_card_no AS idCardNo,
- urn.id_card_front AS idCardFront,
- urn.id_card_opposite AS idCardOpposite,
- urn.id_card_handheld AS idCardHandheld,
- urn.audit_status AS auditStatus,
- urn.create_date AS createDate,
- urn.update_date AS updateDate,
- urn.phone,
- u.erban_no AS erbanNo,
- urn.admin_id as adminId,
- su.user_name as adminName
- FROM
- user_real_name urn
- LEFT JOIN users u ON urn.uid = u.uid
- left join sys_user su on su.user_id = urn.admin_id
- <where>
- 1=1
- <if test="erBanNo != null">
- AND u.erban_no = #{erBanNo}
- </if>
- <if test="status != null">
- AND urn.audit_status = #{status}
- </if>
- <if test="idCard != null and idCard != ''">
- AND urn.id_card_no = #{idCard}
- </if>
- <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
- AND urn.create_date between #{beginTime} and #{endTime}
- </if>
- <if test="adminName != null and adminName != ''">
- AND su.user_name = #{adminName}
- </if>
- </where>
- ORDER BY createDate desc
- </select>
- <select id="countByIdCardNoOrIsFirst" resultType="java.lang.Integer">
- select count(*) from user_real_name where id_card_no = #{idCardNo} and is_first = #{isFirst}
- </select>
- </mapper>
|