BdglPeopleRecallMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.supervision.peopleManage.mapper.BdglPeopleRecallMapper">
  6. <resultMap type="BdglPeopleRecall" id="BdglPeopleRecallResult">
  7. <result property="id" column="id" />
  8. <result property="peopleId" column="people_id" />
  9. <result property="filed1" column="filed1" />
  10. <result property="filed2" column="filed2" />
  11. <result property="cName" column="c_name" />
  12. <result property="createtime" column="createtime" />
  13. <result property="adminId" column="admin_id" />
  14. <association property="bdglPeopleRecallAuditlog" column="peopleId" javaType="BdglPeopleRecallAuditlog" resultMap="BdglPeopleRecallAuditlogResult" />
  15. </resultMap>
  16. <resultMap type="BdglPeopleRecallAuditlog" id="BdglPeopleRecallAuditlogResult">
  17. <result property="id" column="id" />
  18. <result property="pid" column="pid" />
  19. <result property="peopleId" column="people_id" />
  20. <result property="adminId" column="admin_id" />
  21. <result property="type" column="type" />
  22. <result property="contents" column="contents" />
  23. <result property="createtime" column="createtime" />
  24. <result property="updatetime" column="updatetime" />
  25. </resultMap>
  26. <sql id="selectBdglPeopleRecallVo">
  27. select id, filed1,filed2,people_id, c_name, createtime, admin_id from bdgl_people_recall
  28. </sql>
  29. <select id="selectBdglPeopleRecallList" parameterType="BdglPeopleRecall" resultMap="BdglPeopleRecallResult">
  30. <include refid="selectBdglPeopleRecallVo"/>
  31. <where>
  32. <if test="peopleId != null "> and people_id = #{peopleId}</if>
  33. <if test="filed1 != null and filed1 != ''"> and filed1 = #{filed1}</if>
  34. <if test="filed2 != null and filed2 != ''"> and filed2 = #{filed2}</if>
  35. <if test="cName != null and cName != ''"> and c_name like concat('%', #{cName}, '%')</if>
  36. <if test="createtime != null "> and createtime = #{createtime}</if>
  37. <if test="adminId != null "> and admin_id = #{adminId}</if>
  38. </where>
  39. </select>
  40. <select id="selectBdglPeopleRecallById" parameterType="Integer" resultMap="BdglPeopleRecallResult">
  41. <include refid="selectBdglPeopleRecallVo"/>
  42. where id = #{id}
  43. </select>
  44. <select id="selectBdglPeopleID" parameterType="BdglPeopleRecall" resultMap="BdglPeopleRecallResult">
  45. select z.id,z.people_id,z.c_name,f.id, f.pid, f.people_id, f.admin_id, f.type, f.contents, f.createtime, f.updatetime from bdgl_people_recall z,bdgl_people_recall_auditlog f
  46. <where>
  47. and z.people_id = f.people_id
  48. <if test="peopleId != null "> and z.people_id = #{peopleId}</if>
  49. </where>
  50. </select>
  51. <insert id="insertBdglPeopleRecall" parameterType="BdglPeopleRecall" useGeneratedKeys="true" keyProperty="id">
  52. insert into bdgl_people_recall
  53. <trim prefix="(" suffix=")" suffixOverrides=",">
  54. <if test="peopleId != null">people_id,</if>
  55. <if test="filed1 != null">filed1,</if>
  56. <if test="filed2 != null">filed2,</if>
  57. <if test="cName != null">c_name,</if>
  58. <if test="createtime != null">createtime,</if>
  59. <if test="adminId != null">admin_id,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="peopleId != null">#{peopleId},</if>
  63. <if test="filed1 != null">#{filed1},</if>
  64. <if test="filed2 != null">#{filed2},</if>
  65. <if test="cName != null">#{cName},</if>
  66. <if test="createtime != null">#{createtime},</if>
  67. <if test="adminId != null">#{adminId},</if>
  68. </trim>
  69. </insert>
  70. <update id="updateBdglPeopleRecall" parameterType="BdglPeopleRecall">
  71. update bdgl_people_recall
  72. <trim prefix="SET" suffixOverrides=",">
  73. <if test="peopleId != null">people_id = #{peopleId},</if>
  74. <if test="filed1 != null">filed1 = #{filed1},</if>
  75. <if test="filed2 != null">filed2 = #{filed2},</if>
  76. <if test="cName != null">c_name = #{cName},</if>
  77. <if test="createtime != null">createtime = #{createtime},</if>
  78. <if test="adminId != null">admin_id = #{adminId},</if>
  79. </trim>
  80. where id = #{id}
  81. </update>
  82. <delete id="deleteBdglPeopleRecallById" parameterType="Integer">
  83. delete from bdgl_people_recall where id = #{id}
  84. </delete>
  85. <delete id="deleteBdglPeopleRecallByIds" parameterType="String">
  86. delete from bdgl_people_recall where id in
  87. <foreach item="id" collection="array" open="(" separator="," close=")">
  88. #{id}
  89. </foreach>
  90. </delete>
  91. </mapper>