<?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.basic.analy.dao.BbPersonTemporaryDao" >
|
|
<sql id="table"> bb_person_temporary </sql>
|
|
<resultMap id="BaseResultMap" type="com.basic.analy.model.BbPerson" >
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
<result column="orgId" property="orgId" jdbcType="INTEGER" />
|
<result column="officeId" property="officeId" jdbcType="INTEGER" />
|
<result column="userId" property="userId" jdbcType="INTEGER" />
|
<result column="userName" property="userName" jdbcType="VARCHAR" />
|
<result column="cardId" property="cardId" jdbcType="VARCHAR" />
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
<result column="no" property="no" jdbcType="VARCHAR" />
|
<result column="mnemonicCode" property="mnemonicCode" jdbcType="VARCHAR" />
|
<result column="gender" property="gender" jdbcType="VARCHAR" />
|
<result column="nation" property="nation" jdbcType="VARCHAR" />
|
<result column="phone" property="phone" jdbcType="VARCHAR" />
|
<result column="type" property="type" jdbcType="VARCHAR" />
|
<result column="photos" property="photos" jdbcType="VARCHAR" />
|
<result column="faceIds" property="faceIds" jdbcType="VARCHAR" />
|
<result column="registerAddress" property="registerAddress" jdbcType="VARCHAR" />
|
<result column="distributionIds" property="distributionIds" jdbcType="VARCHAR" />
|
<result column="distributionNames" property="distributionNames" jdbcType="VARCHAR" />
|
<result column="createBy" property="createBy" jdbcType="VARCHAR" />
|
<result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
|
<result column="updateBy" property="updateBy" jdbcType="VARCHAR" />
|
<result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="remarks" property="remarks" jdbcType="VARCHAR" />
|
<result column="delFlag" property="delFlag" jdbcType="VARCHAR" />
|
<result column="rev_json" property="revJson" jdbcType="OTHER" />
|
</resultMap>
|
|
<resultMap id="BaseMap" extends="BaseResultMap" type="Map">
|
|
<result column="feature" property="feature" jdbcType="BLOB"/>
|
|
</resultMap>
|
|
<sql id="Base_Column_List" >
|
id, orgId, officeId, cardId, userId, userName,name, no, mnemonicCode, gender, nation, phone, type, photos,
|
faceIds, registerAddress, distributionIds, distributionNames, createBy, createTime,
|
updateBy, updateTime, remarks, delFlag, rev_json
|
</sql>
|
|
<sql id="where">
|
<where>
|
t.delFlag = '0'
|
<if test="name != null and name != ''">
|
and t.name like concat('%', #{name}, '%')
|
</if>
|
<if test="no != null and no != ''">
|
and t.no like concat('%', #{no}, '%')
|
</if>
|
<if test="orgId != null and orgId != ''">
|
and t.orgId = #{orgId}
|
</if>
|
<if test="officeId != null and officeId != ''">
|
and t.officeId = #{officeId}
|
</if>
|
<if test="cardId != null and cardId != ''">
|
and t.cardId = #{cardId}
|
</if>
|
<if test="gender != null and gender != ''">
|
and t.gender = #{gender}
|
</if>
|
|
</where>
|
</sql>
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
select
|
<include refid="Base_Column_List" />
|
from <include refid="table" />
|
where id = #{id,jdbcType=VARCHAR}
|
</select>
|
|
<select id="findData" resultType="com.basic.analy.model.BbPerson">
|
select
|
<include refid="Base_Column_List" />
|
from <include refid="table" /> t
|
<include refid="where" />
|
order by t.id desc
|
limit #{start}, #{length}
|
</select>
|
|
<select id="selectAllAndFeature" resultMap="BaseMap">
|
select p.id,p.cardId,p.name,p.no,p.photos,p.faceIds,f.*
|
from <include refid="table" /> p inner join bb_face f
|
on p.faceIds = f.resourceId
|
|
</select>
|
|
<!-- <select id="selectAllAndFeature" resultMap="BaseMap">
|
select p.id,p.cardId,p.name,p.photos,p.faceIds,f.*
|
from bb_person p left join bb_face f
|
on p.faceIds = f.resourceId
|
|
</select>-->
|
<select id="count" resultType="int">
|
select count(*) from <include refid="table" /> t
|
<include refid="where" />
|
</select>
|
|
<select id="isContainId" resultType="int">
|
select count(*) from <include refid="table" /> t
|
where id=#{id,jdbcType=VARCHAR} and delFlag = '0'
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
delete from <include refid="table" />
|
where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
|
<insert id="insertSelective" parameterType="com.basic.analy.model.BbPerson" >/*keyProperty="id" useGeneratedKeys="true"*/
|
insert into <include refid="table" />
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="orgId != null" >
|
orgId,
|
</if>
|
<if test="officeId != null" >
|
officeId,
|
</if>
|
<if test="cardId != null" >
|
cardId,
|
</if>
|
<if test="userId != null" >
|
userId,
|
</if>
|
<if test="userName != null" >
|
userName,
|
</if>
|
<if test="name != null" >
|
name,
|
</if>
|
<if test="no != null" >
|
no,
|
</if>
|
<if test="mnemonicCode != null" >
|
mnemonicCode,
|
</if>
|
<if test="gender != null" >
|
gender,
|
</if>
|
<if test="nation != null" >
|
nation,
|
</if>
|
<if test="phone != null" >
|
phone,
|
</if>
|
<if test="type != null" >
|
type,
|
</if>
|
<if test="photos != null" >
|
photos,
|
</if>
|
<if test="faceIds != null" >
|
faceIds,
|
</if>
|
<if test="registerAddress != null" >
|
registerAddress,
|
</if>
|
<if test="distributionIds != null" >
|
distributionIds,
|
</if>
|
<if test="distributionNames != null" >
|
distributionNames,
|
</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="remarks != null" >
|
remarks,
|
</if>
|
<if test="delFlag != null" >
|
delFlag,
|
</if>
|
<if test="revJson != null" >
|
rev_json,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="orgId != null" >
|
#{orgId,jdbcType=INTEGER},
|
</if>
|
<if test="officeId != null" >
|
#{officeId,jdbcType=INTEGER},
|
</if>
|
<if test="cardId != null" >
|
#{cardId,jdbcType=VARCHAR},
|
</if>
|
<if test="userId != null" >
|
#{userId,jdbcType=INTEGER},
|
</if>
|
<if test="userName != null" >
|
#{userName,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null" >
|
#{name,jdbcType=VARCHAR},
|
</if>
|
<if test="no != null" >
|
#{no,jdbcType=VARCHAR},
|
</if>
|
<if test="mnemonicCode != null" >
|
#{mnemonicCode,jdbcType=VARCHAR},
|
</if>
|
<if test="gender != null" >
|
#{gender,jdbcType=VARCHAR},
|
</if>
|
<if test="nation != null" >
|
#{nation,jdbcType=VARCHAR},
|
</if>
|
<if test="phone != null" >
|
#{phone,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null" >
|
#{type,jdbcType=VARCHAR},
|
</if>
|
<if test="photos != null" >
|
#{photos,jdbcType=VARCHAR},
|
</if>
|
<if test="faceIds != null" >
|
#{faceIds,jdbcType=VARCHAR},
|
</if>
|
<if test="registerAddress != null" >
|
#{registerAddress,jdbcType=VARCHAR},
|
</if>
|
<if test="distributionIds != null" >
|
#{distributionIds,jdbcType=VARCHAR},
|
</if>
|
<if test="distributionNames != null" >
|
#{distributionNames,jdbcType=VARCHAR},
|
</if>
|
<if test="createBy != null" >
|
#{createBy,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null" >
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateBy != null" >
|
#{updateBy,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null" >
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="remarks != null" >
|
#{remarks,jdbcType=VARCHAR},
|
</if>
|
<if test="delFlag != null" >
|
#{delFlag,jdbcType=VARCHAR},
|
</if>
|
<if test="revJson != null" >
|
#{revJson,jdbcType=OTHER},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.basic.analy.model.BbPerson" >
|
update <include refid="table" />
|
<set >
|
<if test="orgId != null" >
|
orgId = #{orgId,jdbcType=INTEGER},
|
</if>
|
<if test="officeId != null" >
|
officeId = #{officeId,jdbcType=INTEGER},
|
</if>
|
<if test="cardId != null" >
|
cardId = #{cardId,jdbcType=VARCHAR},
|
</if>
|
<if test="userId != null" >
|
userId,
|
</if>
|
<if test="userName != null" >
|
userName,
|
</if>
|
<if test="name != null" >
|
name = #{name,jdbcType=VARCHAR},
|
</if>
|
<if test="no != null" >
|
no = #{no,jdbcType=VARCHAR},
|
</if>
|
<if test="mnemonicCode != null" >
|
mnemonicCode = #{mnemonicCode,jdbcType=VARCHAR},
|
</if>
|
<if test="gender != null" >
|
gender = #{gender,jdbcType=VARCHAR},
|
</if>
|
<if test="nation != null" >
|
nation = #{nation,jdbcType=VARCHAR},
|
</if>
|
<if test="phone != null" >
|
phone = #{phone,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null" >
|
type = #{type,jdbcType=VARCHAR},
|
</if>
|
<if test="photos != null" >
|
photos = #{photos,jdbcType=VARCHAR},
|
</if>
|
<if test="faceIds != null" >
|
faceIds = #{faceIds,jdbcType=VARCHAR},
|
</if>
|
<if test="registerAddress != null" >
|
registerAddress = #{registerAddress,jdbcType=VARCHAR},
|
</if>
|
<if test="distributionIds != null" >
|
distributionIds = #{distributionIds,jdbcType=VARCHAR},
|
</if>
|
<if test="distributionNames != null" >
|
distributionNames = #{distributionNames,jdbcType=VARCHAR},
|
</if>
|
<if test="createBy != null" >
|
createBy = #{createBy,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null" >
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateBy != null" >
|
updateBy = #{updateBy,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null" >
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="remarks != null" >
|
remarks = #{remarks,jdbcType=VARCHAR},
|
</if>
|
<if test="delFlag != null" >
|
delFlag = #{delFlag,jdbcType=VARCHAR},
|
</if>
|
<if test="revJson != null" >
|
rev_json = #{revJson,jdbcType=OTHER},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
<!--逻辑删除-->
|
<update id="updateByPrimaryKey" parameterType="String" >
|
update <include refid="table" />
|
set
|
delFlag = '1'
|
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
</mapper>
|