PersonMapper.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.persagy.fm.person.dao.PersonMapper">
  4. <resultMap id="PersonMap" type="com.persagy.fm.person.model.Person">
  5. <result column="id" property="id"/>
  6. <result column="name" property="name"/>
  7. <result column="username" property="username"/>
  8. <result column="id_number" property="idNumber"/>
  9. <result column="gender" property="gender"/>
  10. <result column="birthday" property="birthday"/>
  11. <result column="other_account" property="otherAccount"/>
  12. <result column="user_from" property="userFrom"/>
  13. <result column="remark" property="remark"/>
  14. <result column="profession" property="profession"/>
  15. <result column="ts" property="ts"/>
  16. <result column="creation_time" property="creationTime"/>
  17. <result column="creator" property="creator"/>
  18. <result column="modifier" property="modifier"/>
  19. <result column="modified_time" property="modifiedTime"/>
  20. <result column="valid" property="valid"/>
  21. </resultMap>
  22. <resultMap id="SimplePersonMap" type="com.persagy.fm.person.model.Person">
  23. <result column="id" property="id"/>
  24. <result column="name" property="name"/>
  25. <result column="profession" property="profession"/>
  26. </resultMap>
  27. <select id="queryPersonList" parameterType="com.persagy.fm.person.model.dto.PageQueryPersonDTO"
  28. resultType="com.persagy.fm.person.model.Person">
  29. select p.id as id, p.name as name, p.profession as profession
  30. from person p,
  31. work_resume w
  32. where p.id = w.person_id
  33. <if test="depId != null">
  34. and w.dep_id = #{depId}
  35. </if>
  36. <if test="state != null">
  37. and w.state = #{state}
  38. </if>
  39. <if test="name != null">
  40. and p.name = #{name}
  41. </if>
  42. order by w.is_leader desc, p.name_pinyin
  43. </select>
  44. <select id="queryCount" parameterType="com.persagy.fm.person.model.dto.PageQueryPersonDTO"
  45. resultType="int">
  46. select count(*) total
  47. from person p,
  48. work_resume w
  49. where p.id = w.person_id
  50. <if test="depId != null">
  51. and w.dep_id = #{depId}
  52. </if>
  53. <if test="state != null">
  54. and w.state = #{state}
  55. </if>
  56. <if test="name != null">
  57. and p.name = #{name}
  58. </if>
  59. </select>
  60. </mapper>