|
|
@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<result property="deptName" column="dept_name" /> |
|
|
|
<result property="faceName" column="face_name" /> |
|
|
|
<result property="age" column="age" /> |
|
|
|
<result property="birthDate" column="birth_date" /> |
|
|
|
<result property="facePhone" column="face_phone" /> |
|
|
|
<result property="faceUrl" column="face_url" /> |
|
|
|
<result property="isWork" column="is_work" /> |
|
|
@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="selectMineFaceVo"> |
|
|
|
select mf.id, mf.face_name, mf.age, mf.face_phone, mf.face_url, |
|
|
|
select mf.id, mf.face_name, mf.birth_date, FLOOR(TIMESTAMPDIFF(MONTH,mf.birth_date , SYSDATE()) / 12) AS age, mf.face_phone, mf.face_url, |
|
|
|
mf.is_work, mf.remark, mf.create_time,mf.use_time,mf.dept_id,d.dept_name |
|
|
|
from mine_face mf |
|
|
|
inner join sys_dept d on mf.dept_id = d.dept_id |
|
|
@ -37,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="isWork != null "> and mf.is_work = #{isWork}</if> |
|
|
|
<if test="deptIdStr != null "> and d.dept_id in (#{deptIdStr})</if> |
|
|
|
</where> |
|
|
|
order by mf.face_name |
|
|
|
order by d.dept_name desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectMineFaceById" parameterType="Long" resultMap="MineFaceResult"> |
|
|
@ -48,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
SELECT |
|
|
|
mf.id, |
|
|
|
mf.face_name, |
|
|
|
mf.age, |
|
|
|
FLOOR(TIMESTAMPDIFF(MONTH,mf.birth_date , SYSDATE()) / 12) AS age, |
|
|
|
mf.face_byte, |
|
|
|
mf.face_url, |
|
|
|
mf.face_phone, |
|
|
@ -65,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<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="birthDate != null">birth_date,</if> |
|
|
|
<if test="facePhone != null">face_phone,</if> |
|
|
|
<if test="faceUrl != null">face_url,</if> |
|
|
|
<if test="isWork != null">is_work,</if> |
|
|
@ -78,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<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="birthDate != null">#{birthDate},</if> |
|
|
|
<if test="facePhone != null">#{facePhone},</if> |
|
|
|
<if test="faceUrl != null">#{faceUrl},</if> |
|
|
|
<if test="isWork != null">#{isWork},</if> |
|
|
@ -94,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
update mine_face |
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
<if test="faceName != null">face_name = #{faceName},</if> |
|
|
|
<if test="age != null">age = #{age},</if> |
|
|
|
<if test="birthDate != null">birth_date = #{birthDate},</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> |
|
|
|