ReligionPersonMapper.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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.ruoyi.project.religion.person.mapper.ReligionPersonMapper">
  6. <resultMap type="ReligionPerson" id="ReligionPersonResult">
  7. <result property="personId" column="person_id" />
  8. <result property="placeId" column="place_id" />
  9. <result property="name" column="name" />
  10. <result property="religionType" column="religion_type" />
  11. <result property="gender" column="gender" />
  12. <result property="idNumber" column="id_number" />
  13. <result property="birthday" column="birthday" />
  14. <result property="county" column="county" />
  15. <result property="address" column="address" />
  16. <result property="politicalStatus" column="political_status" />
  17. <result property="eduNational" column="edu_national" />
  18. <result property="eduReligious" column="edu_religious" />
  19. <result property="joinTime" column="join_time" />
  20. <result property="phone" column="phone" />
  21. <result property="domicile" column="domicile" />
  22. <result property="nativePlace" column="native_place" />
  23. <result property="orgName" column="org_name" />
  24. <result property="orgAddress" column="org_address" />
  25. <result property="status" column="status" />
  26. <result property="createBy" column="create_by" />
  27. <result property="createTime" column="create_time" />
  28. <result property="updateBy" column="update_by" />
  29. <result property="updateTime" column="update_time" />
  30. </resultMap>
  31. <sql id="selectReligionPersonVo">
  32. select person_id, place_id, name, religion_type, gender, id_number, birthday, county, address, political_status, edu_national, edu_religious, join_time, phone, domicile, native_place, org_name, org_address, status, create_by, create_time, update_by, update_time from religion_person
  33. </sql>
  34. <select id="selectReligionPersonList" parameterType="ReligionPerson" resultMap="ReligionPersonResult">
  35. <include refid="selectReligionPersonVo"/>
  36. <where>
  37. <if test="placeId != null "> and place_id = #{placeId}</if>
  38. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  39. <if test="religionType != null and religionType != ''"> and religion_type = #{religionType}</if>
  40. <if test="gender != null and gender != ''"> and gender = #{gender}</if>
  41. <if test="idNumber != null and idNumber != ''"> and id_number = #{idNumber}</if>
  42. <if test="birthday != null "> and birthday = #{birthday}</if>
  43. <if test="county != null and county != ''"> and county = #{county}</if>
  44. <if test="address != null and address != ''"> and address = #{address}</if>
  45. <if test="politicalStatus != null and politicalStatus != ''"> and political_status = #{politicalStatus}</if>
  46. <if test="eduNational != null and eduNational != ''"> and edu_national = #{eduNational}</if>
  47. <if test="eduReligious != null and eduReligious != ''"> and edu_religious = #{eduReligious}</if>
  48. <if test="joinTime != null "> and join_time = #{joinTime}</if>
  49. <if test="phone != null and phone != ''"> and phone = #{phone}</if>
  50. <if test="domicile != null and domicile != ''"> and domicile = #{domicile}</if>
  51. <if test="nativePlace != null and nativePlace != ''"> and native_place = #{nativePlace}</if>
  52. <if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if>
  53. <if test="orgAddress != null and orgAddress != ''"> and org_address = #{orgAddress}</if>
  54. <if test="status != null and status != ''"> and status = #{status}</if>
  55. </where>
  56. </select>
  57. <select id="selectReligionPersonByPersonId" parameterType="Long" resultMap="ReligionPersonResult">
  58. <include refid="selectReligionPersonVo"/>
  59. where person_id = #{personId}
  60. </select>
  61. <insert id="insertReligionPerson" parameterType="ReligionPerson" useGeneratedKeys="true" keyProperty="personId">
  62. insert into religion_person
  63. <trim prefix="(" suffix=")" suffixOverrides=",">
  64. <if test="placeId != null">place_id,</if>
  65. <if test="name != null and name != ''">name,</if>
  66. <if test="religionType != null and religionType != ''">religion_type,</if>
  67. <if test="gender != null">gender,</if>
  68. <if test="idNumber != null and idNumber != ''">id_number,</if>
  69. <if test="birthday != null">birthday,</if>
  70. <if test="county != null">county,</if>
  71. <if test="address != null">address,</if>
  72. <if test="politicalStatus != null">political_status,</if>
  73. <if test="eduNational != null">edu_national,</if>
  74. <if test="eduReligious != null">edu_religious,</if>
  75. <if test="joinTime != null">join_time,</if>
  76. <if test="phone != null">phone,</if>
  77. <if test="domicile != null">domicile,</if>
  78. <if test="nativePlace != null">native_place,</if>
  79. <if test="orgName != null">org_name,</if>
  80. <if test="orgAddress != null">org_address,</if>
  81. <if test="status != null">status,</if>
  82. <if test="createBy != null">create_by,</if>
  83. <if test="createTime != null">create_time,</if>
  84. <if test="updateBy != null">update_by,</if>
  85. <if test="updateTime != null">update_time,</if>
  86. </trim>
  87. <trim prefix="values (" suffix=")" suffixOverrides=",">
  88. <if test="placeId != null">#{placeId},</if>
  89. <if test="name != null and name != ''">#{name},</if>
  90. <if test="religionType != null and religionType != ''">#{religionType},</if>
  91. <if test="gender != null">#{gender},</if>
  92. <if test="idNumber != null and idNumber != ''">#{idNumber},</if>
  93. <if test="birthday != null">#{birthday},</if>
  94. <if test="county != null">#{county},</if>
  95. <if test="address != null">#{address},</if>
  96. <if test="politicalStatus != null">#{politicalStatus},</if>
  97. <if test="eduNational != null">#{eduNational},</if>
  98. <if test="eduReligious != null">#{eduReligious},</if>
  99. <if test="joinTime != null">#{joinTime},</if>
  100. <if test="phone != null">#{phone},</if>
  101. <if test="domicile != null">#{domicile},</if>
  102. <if test="nativePlace != null">#{nativePlace},</if>
  103. <if test="orgName != null">#{orgName},</if>
  104. <if test="orgAddress != null">#{orgAddress},</if>
  105. <if test="status != null">#{status},</if>
  106. <if test="createBy != null">#{createBy},</if>
  107. <if test="createTime != null">#{createTime},</if>
  108. <if test="updateBy != null">#{updateBy},</if>
  109. <if test="updateTime != null">#{updateTime},</if>
  110. </trim>
  111. </insert>
  112. <update id="updateReligionPerson" parameterType="ReligionPerson">
  113. update religion_person
  114. <trim prefix="SET" suffixOverrides=",">
  115. <if test="placeId != null">place_id = #{placeId},</if>
  116. <if test="name != null and name != ''">name = #{name},</if>
  117. <if test="religionType != null and religionType != ''">religion_type = #{religionType},</if>
  118. <if test="gender != null">gender = #{gender},</if>
  119. <if test="idNumber != null and idNumber != ''">id_number = #{idNumber},</if>
  120. <if test="birthday != null">birthday = #{birthday},</if>
  121. <if test="county != null">county = #{county},</if>
  122. <if test="address != null">address = #{address},</if>
  123. <if test="politicalStatus != null">political_status = #{politicalStatus},</if>
  124. <if test="eduNational != null">edu_national = #{eduNational},</if>
  125. <if test="eduReligious != null">edu_religious = #{eduReligious},</if>
  126. <if test="joinTime != null">join_time = #{joinTime},</if>
  127. <if test="phone != null">phone = #{phone},</if>
  128. <if test="domicile != null">domicile = #{domicile},</if>
  129. <if test="nativePlace != null">native_place = #{nativePlace},</if>
  130. <if test="orgName != null">org_name = #{orgName},</if>
  131. <if test="orgAddress != null">org_address = #{orgAddress},</if>
  132. <if test="status != null">status = #{status},</if>
  133. <if test="createBy != null">create_by = #{createBy},</if>
  134. <if test="createTime != null">create_time = #{createTime},</if>
  135. <if test="updateBy != null">update_by = #{updateBy},</if>
  136. <if test="updateTime != null">update_time = #{updateTime},</if>
  137. </trim>
  138. where person_id = #{personId}
  139. </update>
  140. <delete id="deleteReligionPersonByPersonId" parameterType="Long">
  141. delete from religion_person where person_id = #{personId}
  142. </delete>
  143. <delete id="deleteReligionPersonByPersonIds" parameterType="String">
  144. delete from religion_person where person_id in
  145. <foreach item="personId" collection="array" open="(" separator="," close=")">
  146. #{personId}
  147. </foreach>
  148. </delete>
  149. </mapper>