You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
5.5 KiB

6 months ago
<?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" />
5 months ago
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name" />
6 months ago
<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" />
6 months ago
<result property="faceByte" column="face_byte" />
6 months ago
</resultMap>
<sql id="selectMineFaceVo">
5 months ago
select mf.id, mf.face_name,mg.dept_id,d.dept_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
inner join mine_group mg on mg.id =mf.group_id
inner join sys_dept d on mg.dept_id = d.dept_id
6 months ago
</sql>
<select id="selectMineFaceList" parameterType="MineFace" resultMap="MineFaceResult">
<include refid="selectMineFaceVo"/>
<where>
6 months ago
<if test="faceName != null and faceName != ''"> and mf.face_name like concat('%', #{faceName}, '%')</if>
<if test="age != null "> and mf.age = #{age}</if>
5 months ago
<if test="deptId != null "> and d.dept_id =#{deptId}</if>
6 months ago
<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>
6 months ago
</where>
6 months ago
order by mf.face_name
6 months ago
</select>
<select id="selectMineFaceById" parameterType="Long" resultMap="MineFaceResult">
<include refid="selectMineFaceVo"/>
where mf.id = #{id}
</select>
6 months ago
<select id="selectMineFaceByList" resultMap="MineFaceResult">
6 months ago
SELECT
mf.id,
mf.face_name,
mf.age,
mf.face_byte,
6 months ago
mf.face_url,
6 months ago
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>
6 months ago
<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>
6 months ago
<if test="useTime != null">use_time,</if>
6 months ago
<if test="faceByte != null">face_byte,</if>
6 months ago
<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>
6 months ago
<if test="useTime != null">#{useTime},</if>
6 months ago
<if test="faceByte != null">#{faceByte},</if>
6 months ago
<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>
6 months ago
<if test="useTime != null">use_time=#{useTime},</if>
6 months ago
<if test="faceByte != null">face_byte = #{faceByte},</if>
6 months ago
</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>