|
|
@@ -0,0 +1,158 @@
|
|
|
+<?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="com.ruoyi.project.religion.person.mapper.ReligionPersonMapper">
|
|
|
+
|
|
|
+ <resultMap type="ReligionPerson" id="ReligionPersonResult">
|
|
|
+ <result property="personId" column="person_id" />
|
|
|
+ <result property="placeId" column="place_id" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="religionType" column="religion_type" />
|
|
|
+ <result property="gender" column="gender" />
|
|
|
+ <result property="idNumber" column="id_number" />
|
|
|
+ <result property="birthday" column="birthday" />
|
|
|
+ <result property="county" column="county" />
|
|
|
+ <result property="address" column="address" />
|
|
|
+ <result property="politicalStatus" column="political_status" />
|
|
|
+ <result property="eduNational" column="edu_national" />
|
|
|
+ <result property="eduReligious" column="edu_religious" />
|
|
|
+ <result property="joinTime" column="join_time" />
|
|
|
+ <result property="phone" column="phone" />
|
|
|
+ <result property="domicile" column="domicile" />
|
|
|
+ <result property="nativePlace" column="native_place" />
|
|
|
+ <result property="orgName" column="org_name" />
|
|
|
+ <result property="orgAddress" column="org_address" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectReligionPersonVo">
|
|
|
+ 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
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectReligionPersonList" parameterType="ReligionPerson" resultMap="ReligionPersonResult">
|
|
|
+ <include refid="selectReligionPersonVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="placeId != null "> and place_id = #{placeId}</if>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="religionType != null and religionType != ''"> and religion_type = #{religionType}</if>
|
|
|
+ <if test="gender != null and gender != ''"> and gender = #{gender}</if>
|
|
|
+ <if test="idNumber != null and idNumber != ''"> and id_number = #{idNumber}</if>
|
|
|
+ <if test="birthday != null "> and birthday = #{birthday}</if>
|
|
|
+ <if test="county != null and county != ''"> and county = #{county}</if>
|
|
|
+ <if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
+ <if test="politicalStatus != null and politicalStatus != ''"> and political_status = #{politicalStatus}</if>
|
|
|
+ <if test="eduNational != null and eduNational != ''"> and edu_national = #{eduNational}</if>
|
|
|
+ <if test="eduReligious != null and eduReligious != ''"> and edu_religious = #{eduReligious}</if>
|
|
|
+ <if test="joinTime != null "> and join_time = #{joinTime}</if>
|
|
|
+ <if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
|
+ <if test="domicile != null and domicile != ''"> and domicile = #{domicile}</if>
|
|
|
+ <if test="nativePlace != null and nativePlace != ''"> and native_place = #{nativePlace}</if>
|
|
|
+ <if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if>
|
|
|
+ <if test="orgAddress != null and orgAddress != ''"> and org_address = #{orgAddress}</if>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectReligionPersonByPersonId" parameterType="Long" resultMap="ReligionPersonResult">
|
|
|
+ <include refid="selectReligionPersonVo"/>
|
|
|
+ where person_id = #{personId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertReligionPerson" parameterType="ReligionPerson" useGeneratedKeys="true" keyProperty="personId">
|
|
|
+ insert into religion_person
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="placeId != null">place_id,</if>
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
+ <if test="religionType != null and religionType != ''">religion_type,</if>
|
|
|
+ <if test="gender != null">gender,</if>
|
|
|
+ <if test="idNumber != null and idNumber != ''">id_number,</if>
|
|
|
+ <if test="birthday != null">birthday,</if>
|
|
|
+ <if test="county != null">county,</if>
|
|
|
+ <if test="address != null">address,</if>
|
|
|
+ <if test="politicalStatus != null">political_status,</if>
|
|
|
+ <if test="eduNational != null">edu_national,</if>
|
|
|
+ <if test="eduReligious != null">edu_religious,</if>
|
|
|
+ <if test="joinTime != null">join_time,</if>
|
|
|
+ <if test="phone != null">phone,</if>
|
|
|
+ <if test="domicile != null">domicile,</if>
|
|
|
+ <if test="nativePlace != null">native_place,</if>
|
|
|
+ <if test="orgName != null">org_name,</if>
|
|
|
+ <if test="orgAddress != null">org_address,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="placeId != null">#{placeId},</if>
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
+ <if test="religionType != null and religionType != ''">#{religionType},</if>
|
|
|
+ <if test="gender != null">#{gender},</if>
|
|
|
+ <if test="idNumber != null and idNumber != ''">#{idNumber},</if>
|
|
|
+ <if test="birthday != null">#{birthday},</if>
|
|
|
+ <if test="county != null">#{county},</if>
|
|
|
+ <if test="address != null">#{address},</if>
|
|
|
+ <if test="politicalStatus != null">#{politicalStatus},</if>
|
|
|
+ <if test="eduNational != null">#{eduNational},</if>
|
|
|
+ <if test="eduReligious != null">#{eduReligious},</if>
|
|
|
+ <if test="joinTime != null">#{joinTime},</if>
|
|
|
+ <if test="phone != null">#{phone},</if>
|
|
|
+ <if test="domicile != null">#{domicile},</if>
|
|
|
+ <if test="nativePlace != null">#{nativePlace},</if>
|
|
|
+ <if test="orgName != null">#{orgName},</if>
|
|
|
+ <if test="orgAddress != null">#{orgAddress},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateReligionPerson" parameterType="ReligionPerson">
|
|
|
+ update religion_person
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="placeId != null">place_id = #{placeId},</if>
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
+ <if test="religionType != null and religionType != ''">religion_type = #{religionType},</if>
|
|
|
+ <if test="gender != null">gender = #{gender},</if>
|
|
|
+ <if test="idNumber != null and idNumber != ''">id_number = #{idNumber},</if>
|
|
|
+ <if test="birthday != null">birthday = #{birthday},</if>
|
|
|
+ <if test="county != null">county = #{county},</if>
|
|
|
+ <if test="address != null">address = #{address},</if>
|
|
|
+ <if test="politicalStatus != null">political_status = #{politicalStatus},</if>
|
|
|
+ <if test="eduNational != null">edu_national = #{eduNational},</if>
|
|
|
+ <if test="eduReligious != null">edu_religious = #{eduReligious},</if>
|
|
|
+ <if test="joinTime != null">join_time = #{joinTime},</if>
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
+ <if test="domicile != null">domicile = #{domicile},</if>
|
|
|
+ <if test="nativePlace != null">native_place = #{nativePlace},</if>
|
|
|
+ <if test="orgName != null">org_name = #{orgName},</if>
|
|
|
+ <if test="orgAddress != null">org_address = #{orgAddress},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where person_id = #{personId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteReligionPersonByPersonId" parameterType="Long">
|
|
|
+ delete from religion_person where person_id = #{personId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteReligionPersonByPersonIds" parameterType="String">
|
|
|
+ delete from religion_person where person_id in
|
|
|
+ <foreach item="personId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{personId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|