|
@@ -0,0 +1,111 @@
|
|
|
+<?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.sooka.jnb.my.mapper.JnbNameAuthenticationMapper">
|
|
|
+
|
|
|
+ <resultMap type="JnbNameAuthentication" id="JnbNameAuthenticationResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="phone" column="phone" />
|
|
|
+ <result property="idCard" column="id_card" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="path" column="path" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectJnbNameAuthenticationVo">
|
|
|
+ select id, name, phone, id_card, create_by, create_time, update_by, update_time, status, del_flag from jnb_name_authentication
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectJnbNameAuthenticationList" parameterType="JnbNameAuthentication" resultMap="JnbNameAuthenticationResult">
|
|
|
+ <include refid="selectJnbNameAuthenticationVo"/>
|
|
|
+ where del_flag = 1
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
|
+ <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectJnbNameAuthenticationById" parameterType="String" resultMap="JnbNameAuthenticationResult">
|
|
|
+ select a.id, a.name, a.phone, a.id_card, a.status,GROUP_CONCAT(b.path) path
|
|
|
+ from jnb_name_authentication a
|
|
|
+ left join jnb_authentication_img b on a.id = b.authentication_id
|
|
|
+ where a.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertJnbNameAuthentication" parameterType="JnbNameAuthentication">
|
|
|
+ insert into jnb_name_authentication
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
+ <if test="phone != null and phone != ''">phone,</if>
|
|
|
+ <if test="idCard != null and idCard != ''">id_card,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
+ <if test="phone != null and phone != ''">#{phone},</if>
|
|
|
+ <if test="idCard != null and idCard != ''">#{idCard},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertJnbAuthenticationImg" parameterType="JnbAuthenticationImg">
|
|
|
+ insert into jnb_authentication_img
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="authenticationId != null and authenticationId != ''">authentication_id,</if>
|
|
|
+ <if test="path != null and path != ''">path,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="authenticationId != null and authenticationId != ''">#{authenticationId},</if>
|
|
|
+ <if test="path != null and path != ''">#{path},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateJnbNameAuthentication" parameterType="JnbNameAuthentication">
|
|
|
+ update jnb_name_authentication
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
+ <if test="phone != null and phone != ''">phone = #{phone},</if>
|
|
|
+ <if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteJnbNameAuthenticationById" parameterType="String">
|
|
|
+ delete from jnb_name_authentication where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteJnbNameAuthenticationByIds" parameterType="String">
|
|
|
+ update jnb_name_authentication set del_flag = 2
|
|
|
+ where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|