|
|
|
<?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="yq.system.mapper.MineFaceMapper">
|
|
|
|
|
|
|
|
<resultMap type="MineFace" id="MineFaceResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="faceName" column="face_name" />
|
|
|
|
<result property="age" column="age" />
|
|
|
|
<result property="facePhone" column="face_phone" />
|
|
|
|
<result property="faceUrl" column="face_url" />
|
|
|
|
<result property="isWork" column="is_work" />
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="groupId" column="group_id" />
|
|
|
|
<result property="mineGroupName" column="mine_group_name" />
|
|
|
|
<result property="useTime" column="use_time" />
|
|
|
|
<result property="faceByte" column="face_byte" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectMineFaceVo">
|
|
|
|
select mf.id, mf.face_name, mf.age, mf.face_phone, mf.face_url, mf.is_work, mf.remark, mf.create_time,mf.use_time, mf.group_id ,mg.mine_group_name from mine_face mf left join mine_group mg on mg.id =mf.group_id
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectMineFaceList" parameterType="MineFace" resultMap="MineFaceResult">
|
|
|
|
<include refid="selectMineFaceVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="faceName != null and faceName != ''"> and mf.face_name like concat('%', #{faceName}, '%')</if>
|
|
|
|
<if test="age != null "> and mf.age = #{age}</if>
|
|
|
|
<if test="facePhone != null and facePhone != ''"> and mf.face_phone = #{facePhone}</if>
|
|
|
|
<if test="faceUrl != null and faceUrl != ''"> and mf.face_url = #{faceUrl}</if>
|
|
|
|
<if test="isWork != null "> and mf.is_work = #{isWork}</if>
|
|
|
|
<if test="groupId != null "> and mf.group_id = #{groupId}</if>
|
|
|
|
</where>
|
|
|
|
order by mf.face_name
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectMineFaceById" parameterType="Long" resultMap="MineFaceResult">
|
|
|
|
<include refid="selectMineFaceVo"/>
|
|
|
|
where mf.id = #{id}
|
|
|
|
</select>
|
|
|
|
<select id="selectMineFaceByList" resultMap="MineFaceResult">
|
|
|
|
SELECT
|
|
|
|
mf.id,
|
|
|
|
mf.face_name,
|
|
|
|
mf.age,
|
|
|
|
mf.face_byte,
|
|
|
|
mf.face_phone,
|
|
|
|
mf.remark,
|
|
|
|
mf.group_id,
|
|
|
|
mg.mine_group_name
|
|
|
|
FROM
|
|
|
|
mine_face mf
|
|
|
|
LEFT JOIN mine_group mg ON mg.id = mf.group_id
|
|
|
|
WHERE mf.face_byte is not null
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertMineFace" parameterType="MineFace">
|
|
|
|
insert into mine_face
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">id,</if>
|
|
|
|
<if test="faceName != null">face_name,</if>
|
|
|
|
<if test="age != null">age,</if>
|
|
|
|
<if test="facePhone != null">face_phone,</if>
|
|
|
|
<if test="faceUrl != null">face_url,</if>
|
|
|
|
<if test="isWork != null">is_work,</if>
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
<if test="faceByte != null">face_byte,</if>
|
|
|
|
<if test="groupId != null">group_id,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">#{id},</if>
|
|
|
|
<if test="faceName != null">#{faceName},</if>
|
|
|
|
<if test="age != null">#{age},</if>
|
|
|
|
<if test="facePhone != null">#{facePhone},</if>
|
|
|
|
<if test="faceUrl != null">#{faceUrl},</if>
|
|
|
|
<if test="isWork != null">#{isWork},</if>
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="faceByte != null">#{faceByte},</if>
|
|
|
|
<if test="groupId != null">#{groupId},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateMineFace" parameterType="MineFace">
|
|
|
|
update mine_face
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="faceName != null">face_name = #{faceName},</if>
|
|
|
|
<if test="age != null">age = #{age},</if>
|
|
|
|
<if test="facePhone != null">face_phone = #{facePhone},</if>
|
|
|
|
<if test="faceUrl != null">face_url = #{faceUrl},</if>
|
|
|
|
<if test="isWork != null">is_work = #{isWork},</if>
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
<if test="groupId != null">group_id = #{groupId},</if>
|
|
|
|
<if test="faceByte != null">face_byte = #{faceByte},</if>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteMineFaceById" parameterType="Long">
|
|
|
|
delete from mine_face where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteMineFaceByIds" parameterType="String">
|
|
|
|
delete from mine_face where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|