mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-30 21:41:57 +08:00
88 lines
4.4 KiB
XML
88 lines
4.4 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.ruoyi.system.mapper.UserBuildingRelMapper">
|
|
|
|
<resultMap type="UserBuildingRel" id="UserBuildingRelResult">
|
|
<result property="id" column="ID" />
|
|
<result property="isDeleted" column="IS_DELETED" />
|
|
<result property="createdTime" column="CREATED_TIME" />
|
|
<result property="createdBy" column="CREATED_BY" />
|
|
<result property="modifiedBy" column="MODIFIED_BY" />
|
|
<result property="lastUpdatedTime" column="LAST_UPDATED_TIME" />
|
|
<result property="userCode" column="USER_CODE" />
|
|
<result property="buildingId" column="BUILDING_ID" />
|
|
</resultMap>
|
|
|
|
<sql id="selectUserBuildingRelVo">
|
|
select ID, IS_DELETED, CREATED_TIME, CREATED_BY, MODIFIED_BY, LAST_UPDATED_TIME, USER_CODE, BUILDING_ID from user_building_rel
|
|
</sql>
|
|
|
|
<select id="selectUserBuildingRelList" parameterType="UserBuildingRel" resultMap="UserBuildingRelResult">
|
|
<include refid="selectUserBuildingRelVo"/>
|
|
<where>
|
|
<if test="isDeleted != null and isDeleted != ''"> and IS_DELETED = #{isDeleted}</if>
|
|
<if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
|
|
<if test="createdBy != null and createdBy != ''"> and CREATED_BY = #{createdBy}</if>
|
|
<if test="modifiedBy != null and modifiedBy != ''"> and MODIFIED_BY = #{modifiedBy}</if>
|
|
<if test="lastUpdatedTime != null "> and LAST_UPDATED_TIME = #{lastUpdatedTime}</if>
|
|
<if test="userCode != null and userCode != ''"> and USER_CODE = #{userCode}</if>
|
|
<if test="buildingId != null "> and BUILDING_ID = #{buildingId}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectUserBuildingRelById" parameterType="Long" resultMap="UserBuildingRelResult">
|
|
<include refid="selectUserBuildingRelVo"/>
|
|
where ID = #{id}
|
|
</select>
|
|
|
|
<insert id="insertUserBuildingRel" parameterType="UserBuildingRel">
|
|
insert into user_building_rel
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">ID,</if>
|
|
<if test="isDeleted != null">IS_DELETED,</if>
|
|
<if test="createdTime != null">CREATED_TIME,</if>
|
|
<if test="createdBy != null">CREATED_BY,</if>
|
|
<if test="modifiedBy != null">MODIFIED_BY,</if>
|
|
<if test="lastUpdatedTime != null">LAST_UPDATED_TIME,</if>
|
|
<if test="userCode != null">USER_CODE,</if>
|
|
<if test="buildingId != null">BUILDING_ID,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="isDeleted != null">#{isDeleted},</if>
|
|
<if test="createdTime != null">#{createdTime},</if>
|
|
<if test="createdBy != null">#{createdBy},</if>
|
|
<if test="modifiedBy != null">#{modifiedBy},</if>
|
|
<if test="lastUpdatedTime != null">#{lastUpdatedTime},</if>
|
|
<if test="userCode != null">#{userCode},</if>
|
|
<if test="buildingId != null">#{buildingId},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateUserBuildingRel" parameterType="UserBuildingRel">
|
|
update user_building_rel
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="isDeleted != null">IS_DELETED = #{isDeleted},</if>
|
|
<if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
|
|
<if test="createdBy != null">CREATED_BY = #{createdBy},</if>
|
|
<if test="modifiedBy != null">MODIFIED_BY = #{modifiedBy},</if>
|
|
<if test="lastUpdatedTime != null">LAST_UPDATED_TIME = #{lastUpdatedTime},</if>
|
|
<if test="userCode != null">USER_CODE = #{userCode},</if>
|
|
<if test="buildingId != null">BUILDING_ID = #{buildingId},</if>
|
|
</trim>
|
|
where ID = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteUserBuildingRelById" parameterType="Long">
|
|
delete from user_building_rel where ID = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteUserBuildingRelByIds" parameterType="String">
|
|
delete from user_building_rel where ID in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |