143 lines
7.2 KiB
XML
143 lines
7.2 KiB
XML
<?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.eden.room.mapper.RoomExtendInfoMapper">
|
|
|
|
<resultMap type="RoomExtendInfo" id="RoomExtendInfoResult">
|
|
<result property="id" column="id"/>
|
|
<result property="tenantId" column="tenant_id"/>
|
|
<result property="roomId" column="room_id"/>
|
|
<result property="roomRecordNumber" column="room_record_number"/>
|
|
<result property="usageRate" column="usage_rate"/>
|
|
<result property="officeLayout" column="office_layout"/>
|
|
<result property="windowOrientation" column="window_orientation"/>
|
|
<result property="rentFreePeriod" column="rent_free_period"/>
|
|
<result property="minLeaseTerm" column="min_lease_term"/>
|
|
<result property="workstationMin" column="workstation_min"/>
|
|
<result property="workstationMax" column="workstation_max"/>
|
|
<result property="floorPlanDesc" column="floor_plan_desc"/>
|
|
<result property="tags" column="tags"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="lastModTime" column="last_mod_time"/>
|
|
<result property="createUserId" column="create_user_id"/>
|
|
<result property="lastModUserId" column="last_mod_user_id"/>
|
|
<result property="delFlag" column="del_flag"/>
|
|
<result property="remark" column="remark"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectRoomExtendInfoVo">
|
|
select id, tenant_id, room_id, room_record_number, usage_rate,
|
|
office_layout, window_orientation, rent_free_period, min_lease_term,
|
|
workstation_min, workstation_max, floor_plan_desc, tags,
|
|
create_time, last_mod_time, create_user_id, last_mod_user_id,
|
|
del_flag, remark
|
|
from TB_ROOM_EXTEND_INFO
|
|
</sql>
|
|
|
|
<select id="selectRoomExtendInfoList" parameterType="RoomExtendInfo" resultMap="RoomExtendInfoResult">
|
|
<include refid="selectRoomExtendInfoVo"/>
|
|
<where>
|
|
<if test="tenantId != null and tenantId != ''">
|
|
AND tenant_id = #{tenantId}
|
|
</if>
|
|
<if test="roomId != null and roomId != ''">
|
|
AND room_id = #{roomId}
|
|
</if>
|
|
<if test="roomRecordNumber != null and roomRecordNumber != ''">
|
|
AND room_record_number = #{roomRecordNumber}
|
|
</if>
|
|
<if test="tags != null and tags != ''">
|
|
AND tags like concat('%', #{tags}, '%')
|
|
</if>
|
|
AND del_flag = '0'
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectRoomExtendInfoById" parameterType="String" resultMap="RoomExtendInfoResult">
|
|
<include refid="selectRoomExtendInfoVo"/>
|
|
where id = #{id} and del_flag = '0'
|
|
</select>
|
|
|
|
<select id="selectRoomExtendInfoByRoomId" parameterType="String" resultMap="RoomExtendInfoResult">
|
|
<include refid="selectRoomExtendInfoVo"/>
|
|
where room_id = #{roomId} and del_flag = '0'
|
|
</select>
|
|
|
|
<insert id="insertRoomExtendInfo" parameterType="RoomExtendInfo" useGeneratedKeys="true" keyProperty="id">
|
|
<selectKey keyProperty="id" resultType="String" order="BEFORE">
|
|
SELECT nextval('SEQ_ROOM_EXTEND_INFO_1')::VARCHAR as id
|
|
</selectKey>
|
|
insert into TB_ROOM_EXTEND_INFO
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
id,
|
|
<if test="tenantId != null">tenant_id,</if>
|
|
<if test="roomId != null">room_id,</if>
|
|
<if test="roomRecordNumber != null">room_record_number,</if>
|
|
<if test="usageRate != null">usage_rate,</if>
|
|
<if test="officeLayout != null">office_layout,</if>
|
|
<if test="windowOrientation != null">window_orientation,</if>
|
|
<if test="rentFreePeriod != null">rent_free_period,</if>
|
|
<if test="minLeaseTerm != null">min_lease_term,</if>
|
|
<if test="workstationMin != null">workstation_min,</if>
|
|
<if test="workstationMax != null">workstation_max,</if>
|
|
<if test="floorPlanDesc != null">floor_plan_desc,</if>
|
|
<if test="tags != null">tags,</if>
|
|
<if test="createUserId != null">create_user_id,</if>
|
|
<if test="lastModUserId != null">last_mod_user_id,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
<if test="remark != null">remark,</if>
|
|
create_time,
|
|
last_mod_time
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
#{id},
|
|
<if test="tenantId != null">#{tenantId},</if>
|
|
<if test="roomId != null">#{roomId},</if>
|
|
<if test="roomRecordNumber != null">#{roomRecordNumber},</if>
|
|
<if test="usageRate != null">#{usageRate},</if>
|
|
<if test="officeLayout != null">#{officeLayout},</if>
|
|
<if test="windowOrientation != null">#{windowOrientation},</if>
|
|
<if test="rentFreePeriod != null">#{rentFreePeriod},</if>
|
|
<if test="minLeaseTerm != null">#{minLeaseTerm},</if>
|
|
<if test="workstationMin != null">#{workstationMin},</if>
|
|
<if test="workstationMax != null">#{workstationMax},</if>
|
|
<if test="floorPlanDesc != null">#{floorPlanDesc},</if>
|
|
<if test="tags != null">#{tags},</if>
|
|
<if test="createUserId != null">#{createUserId},</if>
|
|
<if test="lastModUserId != null">#{lastModUserId},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
CURRENT_TIMESTAMP,
|
|
CURRENT_TIMESTAMP
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateRoomExtendInfo" parameterType="RoomExtendInfo">
|
|
update TB_ROOM_EXTEND_INFO
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="roomRecordNumber != null">room_record_number = #{roomRecordNumber},</if>
|
|
<if test="usageRate != null">usage_rate = #{usageRate},</if>
|
|
<if test="officeLayout != null">office_layout = #{officeLayout},</if>
|
|
<if test="windowOrientation != null">window_orientation = #{windowOrientation},</if>
|
|
<if test="rentFreePeriod != null">rent_free_period = #{rentFreePeriod},</if>
|
|
<if test="minLeaseTerm != null">min_lease_term = #{minLeaseTerm},</if>
|
|
<if test="workstationMin != null">workstation_min = #{workstationMin},</if>
|
|
<if test="workstationMax != null">workstation_max = #{workstationMax},</if>
|
|
<if test="floorPlanDesc != null">floor_plan_desc = #{floorPlanDesc},</if>
|
|
<if test="tags != null">tags = #{tags},</if>
|
|
<if test="lastModUserId != null">last_mod_user_id = #{lastModUserId},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
last_mod_time = CURRENT_TIMESTAMP
|
|
</trim>
|
|
where room_id = #{roomId} and del_flag = '0'
|
|
</update>
|
|
|
|
<update id="deleteRoomExtendInfoById" parameterType="String">
|
|
update TB_ROOM_EXTEND_INFO set del_flag = '1' where id = #{id} and del_flag = '0'
|
|
</update>
|
|
|
|
<update id="deleteRoomExtendInfoByRoomId" parameterType="String">
|
|
update TB_ROOM_EXTEND_INFO set del_flag = '1' where room_id = #{roomId} and del_flag = '0'
|
|
</update>
|
|
</mapper> |