|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.system.mapper.ResidentInfoMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="ResidentInfo" id="ResidentInfoResult">
|
|
|
<result property="residentId" column="resident_id" />
|
|
|
<result property="houseId" column="house_id" />
|
|
@@ -18,7 +18,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="isHouseholder" column="is_householder" />
|
|
|
<result property="isTenant" column="is_tenant" />
|
|
|
<result property="residentEmployer" column="resident_employer" />
|
|
|
+ <result property="specialType" column="special_type" />
|
|
|
+ <result property="residentHobby" column="resident_hobby" />
|
|
|
<result property="residentAppearance" column="resident_appearance" />
|
|
|
+ <result property="idCardFront" column="id_card_front" />
|
|
|
+ <result property="idCardBack" column="id_card_back" />
|
|
|
+ <result property="idCardAddress" column="id_card_address" />
|
|
|
+ <result property="facePhoto" column="face_photo" />
|
|
|
<result property="createBy" column="create_by" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
<result property="updateBy" column="update_by" />
|
|
@@ -27,12 +33,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectResidentInfoVo">
|
|
|
- select resident_id, house_id, user_id, detailed_address, resident_name, resident_id_card, resident_birthday, resident_phone, resident_gender, resident_relationship, is_householder, is_tenant, resident_employer, resident_appearance, create_by, create_time, update_by, update_time, remark from resident_info
|
|
|
+ select resident_id, house_id, user_id, detailed_address, resident_name, resident_id_card, resident_birthday, resident_phone, resident_gender, resident_relationship, is_householder, is_tenant, resident_employer, special_type, resident_hobby, resident_appearance, id_card_front, id_card_back, id_card_address, face_photo, create_by, create_time, update_by, update_time, remark from resident_info
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectResidentInfoList" parameterType="ResidentInfo" resultMap="ResidentInfoResult">
|
|
|
<include refid="selectResidentInfoVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="houseId != null "> and house_id = #{houseId}</if>
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
<if test="detailedAddress != null and detailedAddress != ''"> and detailed_address = #{detailedAddress}</if>
|
|
@@ -45,7 +51,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isHouseholder != null and isHouseholder != ''"> and is_householder = #{isHouseholder}</if>
|
|
|
<if test="isTenant != null and isTenant != ''"> and is_tenant = #{isTenant}</if>
|
|
|
<if test="residentEmployer != null and residentEmployer != ''"> and resident_employer = #{residentEmployer}</if>
|
|
|
+ <if test="specialType != null and specialType != ''"> and special_type = #{specialType}</if>
|
|
|
+ <if test="residentHobby != null and residentHobby != ''"> and resident_hobby = #{residentHobby}</if>
|
|
|
<if test="residentAppearance != null and residentAppearance != ''"> and resident_appearance = #{residentAppearance}</if>
|
|
|
+ <if test="idCardFront != null and idCardFront != ''"> and id_card_front = #{idCardFront}</if>
|
|
|
+ <if test="idCardBack != null and idCardBack != ''"> and id_card_back = #{idCardBack}</if>
|
|
|
+ <if test="idCardAddress != null and idCardAddress != ''"> and id_card_address = #{idCardAddress}</if>
|
|
|
+ <if test="facePhoto != null and facePhoto != ''"> and face_photo = #{facePhoto}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -58,49 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where user_id = #{userId}
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertResidentInfo" parameterType="ResidentInfo" useGeneratedKeys="true" keyProperty="residentId">
|
|
|
- insert into resident_info
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="houseId != null">house_id,</if>
|
|
|
- <if test="userId != null">user_id,</if>
|
|
|
- <if test="detailedAddress != null">detailed_address,</if>
|
|
|
- <if test="residentName != null">resident_name,</if>
|
|
|
- <if test="residentIdCard != null">resident_id_card,</if>
|
|
|
- <if test="residentBirthday != null">resident_birthday,</if>
|
|
|
- <if test="residentPhone != null">resident_phone,</if>
|
|
|
- <if test="residentGender != null">resident_gender,</if>
|
|
|
- <if test="residentRelationship != null">resident_relationship,</if>
|
|
|
- <if test="isHouseholder != null">is_householder,</if>
|
|
|
- <if test="isTenant != null">is_tenant,</if>
|
|
|
- <if test="residentEmployer != null">resident_employer,</if>
|
|
|
- <if test="residentAppearance != null">resident_appearance,</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>
|
|
|
- <if test="remark != null">remark,</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="houseId != null">#{houseId},</if>
|
|
|
- <if test="userId != null">#{userId},</if>
|
|
|
- <if test="detailedAddress != null">#{detailedAddress},</if>
|
|
|
- <if test="residentName != null">#{residentName},</if>
|
|
|
- <if test="residentIdCard != null">#{residentIdCard},</if>
|
|
|
- <if test="residentBirthday != null">#{residentBirthday},</if>
|
|
|
- <if test="residentPhone != null">#{residentPhone},</if>
|
|
|
- <if test="residentGender != null">#{residentGender},</if>
|
|
|
- <if test="residentRelationship != null">#{residentRelationship},</if>
|
|
|
- <if test="isHouseholder != null">#{isHouseholder},</if>
|
|
|
- <if test="isTenant != null">#{isTenant},</if>
|
|
|
- <if test="residentEmployer != null">#{residentEmployer},</if>
|
|
|
- <if test="residentAppearance != null">#{residentAppearance},</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>
|
|
|
- <if test="remark != null">#{remark},</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
+
|
|
|
<insert id="insertResidentInfoList">
|
|
|
insert into resident_info(house_id,
|
|
|
user_id,
|
|
@@ -143,6 +113,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
+ <insert id="insertResidentInfo" parameterType="ResidentInfo" useGeneratedKeys="true" keyProperty="residentId">
|
|
|
+ insert into resident_info
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="houseId != null">house_id,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="detailedAddress != null">detailed_address,</if>
|
|
|
+ <if test="residentName != null">resident_name,</if>
|
|
|
+ <if test="residentIdCard != null">resident_id_card,</if>
|
|
|
+ <if test="residentBirthday != null">resident_birthday,</if>
|
|
|
+ <if test="residentPhone != null">resident_phone,</if>
|
|
|
+ <if test="residentGender != null">resident_gender,</if>
|
|
|
+ <if test="residentRelationship != null">resident_relationship,</if>
|
|
|
+ <if test="isHouseholder != null">is_householder,</if>
|
|
|
+ <if test="isTenant != null">is_tenant,</if>
|
|
|
+ <if test="residentEmployer != null">resident_employer,</if>
|
|
|
+ <if test="specialType != null">special_type,</if>
|
|
|
+ <if test="residentHobby != null">resident_hobby,</if>
|
|
|
+ <if test="residentAppearance != null">resident_appearance,</if>
|
|
|
+ <if test="idCardFront != null">id_card_front,</if>
|
|
|
+ <if test="idCardBack != null">id_card_back,</if>
|
|
|
+ <if test="idCardAddress != null">id_card_address,</if>
|
|
|
+ <if test="facePhoto != null">face_photo,</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>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="houseId != null">#{houseId},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="detailedAddress != null">#{detailedAddress},</if>
|
|
|
+ <if test="residentName != null">#{residentName},</if>
|
|
|
+ <if test="residentIdCard != null">#{residentIdCard},</if>
|
|
|
+ <if test="residentBirthday != null">#{residentBirthday},</if>
|
|
|
+ <if test="residentPhone != null">#{residentPhone},</if>
|
|
|
+ <if test="residentGender != null">#{residentGender},</if>
|
|
|
+ <if test="residentRelationship != null">#{residentRelationship},</if>
|
|
|
+ <if test="isHouseholder != null">#{isHouseholder},</if>
|
|
|
+ <if test="isTenant != null">#{isTenant},</if>
|
|
|
+ <if test="residentEmployer != null">#{residentEmployer},</if>
|
|
|
+ <if test="specialType != null">#{specialType},</if>
|
|
|
+ <if test="residentHobby != null">#{residentHobby},</if>
|
|
|
+ <if test="residentAppearance != null">#{residentAppearance},</if>
|
|
|
+ <if test="idCardFront != null">#{idCardFront},</if>
|
|
|
+ <if test="idCardBack != null">#{idCardBack},</if>
|
|
|
+ <if test="idCardAddress != null">#{idCardAddress},</if>
|
|
|
+ <if test="facePhoto != null">#{facePhoto},</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>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
<update id="updateResidentInfo" parameterType="ResidentInfo">
|
|
|
update resident_info
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
@@ -158,7 +184,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isHouseholder != null">is_householder = #{isHouseholder},</if>
|
|
|
<if test="isTenant != null">is_tenant = #{isTenant},</if>
|
|
|
<if test="residentEmployer != null">resident_employer = #{residentEmployer},</if>
|
|
|
+ <if test="specialType != null">special_type = #{specialType},</if>
|
|
|
+ <if test="residentHobby != null">resident_hobby = #{residentHobby},</if>
|
|
|
<if test="residentAppearance != null">resident_appearance = #{residentAppearance},</if>
|
|
|
+ <if test="idCardFront != null">id_card_front = #{idCardFront},</if>
|
|
|
+ <if test="idCardBack != null">id_card_back = #{idCardBack},</if>
|
|
|
+ <if test="idCardAddress != null">id_card_address = #{idCardAddress},</if>
|
|
|
+ <if test="facePhoto != null">face_photo = #{facePhoto},</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>
|