|
@@ -14,6 +14,7 @@
|
|
|
<result column="update_time_" property="updateTime" />
|
|
|
<result column="phone_" property="user.phone" />
|
|
|
<result column="real_name_" property="user.realName" />
|
|
|
+ <result column="tenant_id_" property="tenantId"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -24,7 +25,7 @@
|
|
|
|
|
|
<!-- 全查询 -->
|
|
|
<select id="findAll" resultMap="SysUserDevice">
|
|
|
- SELECT * FROM sys_user_device
|
|
|
+ SELECT * FROM sys_user_device where tenant_id_ = #{tenantId}
|
|
|
ORDER BY id_
|
|
|
</select>
|
|
|
|
|
@@ -34,8 +35,8 @@
|
|
|
<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
|
|
|
AS ID FROM DUAL </selectKey> -->
|
|
|
INSERT INTO sys_user_device
|
|
|
- (id_,user_id_,device_num_,bind_time_,device_type_,client_id_,del_flag_)
|
|
|
- VALUES(#{id},#{userId},#{deviceNum},#{bindTime},#{deviceType},#{clientId},0)
|
|
|
+ (id_,user_id_,device_num_,bind_time_,device_type_,client_id_,del_flag_,tenant_id_)
|
|
|
+ VALUES(#{id},#{userId},#{deviceNum},#{bindTime},#{deviceType},#{clientId},0,#{tenantId})
|
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -65,7 +66,7 @@
|
|
|
</if>
|
|
|
update_time_ = now()
|
|
|
</set>
|
|
|
- WHERE id_ = #{id}
|
|
|
+ WHERE id_ = #{id} and tenant_id_ = #{tenantId}
|
|
|
</update>
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
@@ -89,6 +90,9 @@
|
|
|
<if test="bindEndTime != null">
|
|
|
and date(bind_time_) <= #{bindEndTime}
|
|
|
</if>
|
|
|
+ <if test="tenantId != null">
|
|
|
+ and ud.tenant_id_ = #{tenantId}
|
|
|
+ </if>
|
|
|
ORDER BY id_
|
|
|
<include refid="global.limit" />
|
|
|
</select>
|
|
@@ -109,17 +113,20 @@
|
|
|
<if test="bindEndTime != null">
|
|
|
and date(bind_time_) <= #{bindEndTime}
|
|
|
</if>
|
|
|
+ <if test="tenantId != null">
|
|
|
+ and ud.tenant_id_ = #{tenantId}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="queryByUserId" resultMap="SysUserDevice" parameterType="map">
|
|
|
- SELECT * FROM sys_user_device WHERE user_id_ = #{userId} and del_flag_ = 0
|
|
|
+ SELECT * FROM sys_user_device WHERE user_id_ = #{userId} and del_flag_ = 0 and tenant_id_ = #{tenantId}
|
|
|
<if test="clientId != null">
|
|
|
and client_id_ = #{clientId}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="queryByDeviceNum" resultMap="SysUserDevice" parameterType="map">
|
|
|
- SELECT * FROM sys_user_device WHERE device_num_ = #{deviceNum} and del_flag_ = 0
|
|
|
+ SELECT * FROM sys_user_device WHERE device_num_ = #{deviceNum} and del_flag_ = 0 and tenant_id_ = #{tenantId}
|
|
|
<if test="clientId != null">
|
|
|
and client_id_ = #{clientId}
|
|
|
</if>
|