Blame view

backend/uc/src/main/resources/mapper/UserUnderMapper.xml 3.54 KB
8ea9c133   陈威   初始化提交
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?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.hotent.uc.dao.UserUnderDao">
	<resultMap id="BaseResultMap" type="com.hotent.uc.model.UserUnder">
		<id property="id" column="ID_" jdbcType="VARCHAR"/>
		<result property="userId" column="USER_ID_" jdbcType="VARCHAR"/>
		<result property="underUserId" column="UNDER_USER_ID_" jdbcType="VARCHAR"/>
		<result property="underUserName" column="UNDER_USER_NAME_" jdbcType="VARCHAR"/>
		<result property="orgId" column="ORG_ID_" jdbcType="VARCHAR"/>
		<result property="dimenId" column="DIMEN_ID_" jdbcType="VARCHAR"/>
		<result property="updateTime" column="UPDATE_TIME_" jdbcType="TIMESTAMP"/>
		<result property="isDelete" column="IS_DELE_" jdbcType="VARCHAR"/>
		<result property="version" column="VERSION_" jdbcType="NUMERIC"/>
		<result property="createBy" column="create_by_" jdbcType="VARCHAR"/>
		<result property="createTime" column="create_time_" jdbcType="TIMESTAMP"/>
		<result property="createOrgId" column="create_org_id_" jdbcType="VARCHAR"/>
		<result property="updateBy" column="update_by_" jdbcType="VARCHAR"/>
	</resultMap>
	
	<parameterMap id="UserUnder" type="com.hotent.uc.model.UserUnder" />
	
	<sql id="Base_Column_List">
		ID_,USER_ID_,UNDER_USER_ID_,UNDER_USER_NAME_,ORG_ID_,UPDATE_TIME_,IS_DELE_,VERSION_
	</sql>

	<delete id="removePhysical" >
		DELETE FROM UC_USER_UNDER WHERE IS_DELE_='1' 
	</delete>
	
	<select id="getUserUnder" parameterType="java.util.Map" resultMap="BaseResultMap">
		select * from (select * from UC_USER_UNDER 
		where 1=1
			<if test="ew.paramNameValuePairs.userId != null">
			AND USER_ID_ = #{ew.paramNameValuePairs.userId}
		</if>
		<if test="ew.paramNameValuePairs.orgId!=null">
			AND ORG_ID_ = #{ew.paramNameValuePairs.orgId}
		</if>
		<if test="ew.paramNameValuePairs.underUserId!=null">
			AND UNDER_USER_ID_ = #{ew.paramNameValuePairs.underUserId}
		</if>
		<if test="ew.paramNameValuePairs.underUserName!=null">
			AND UNDER_USER_NAME_ like #{ew.paramNameValuePairs.underUserName}
		</if>
		<if test="ew.paramNameValuePairs.noUserId!=null">
			AND USER_ID_ != #{ew.paramNameValuePairs.noUserId}
		</if>
		)tmp
		
		${ew.customSqlSegment} 
	</select>
	
	<select id="getUserUnderNOPage" parameterType="java.util.Map" resultMap="BaseResultMap">
		select * from UC_USER_UNDER where IS_DELE_!='1'
		<if test="htqf.userId != null">
			AND USER_ID_ = #{htqf.userId}
		</if>
		<if test="htqf.orgId!=null">
			AND ORG_ID_ = #{htqf.orgId}
		</if>
		<if test="htqf.underUserId!=null">
			AND UNDER_USER_ID_ = #{htqf.underUserId}
		</if>
		<if test="htqf.underUserName!=null">
			AND UNDER_USER_NAME_ like #{htqf.underUserName}
		</if>
		<if test="htqf.noUserId!=null">
			AND USER_ID_ != #{htqf.noUserId}
		</if>
		<if test="htqf.dimenId!=null">
			AND DIMEN_ID_ = #{htqf.dimenId}
		</if>
		<if test="htqf.whereSql!=null">
			AND	${htqf.whereSql}
		</if>
	</select>
	
	<delete id="delByOrgId" parameterType="java.util.Map">
		UPDATE UC_USER_UNDER SET IS_DELE_='1',UPDATE_TIME_ = #{updateTime,jdbcType=TIMESTAMP} where ORG_ID_ = #{orgId}
	</delete>
	
	<delete id="delByUpIdAndUderId" parameterType="java.util.Map">
		UPDATE UC_USER_UNDER SET IS_DELE_='1',UPDATE_TIME_ = #{updateTime,jdbcType=TIMESTAMP} where USER_ID_ = #{upUserId} and UNDER_USER_ID_ = #{underUserId}
	</delete>
	
	<delete id="delByUserIdAndOrgId" parameterType="java.util.Map">
		UPDATE UC_USER_UNDER SET IS_DELE_='1',UPDATE_TIME_ = #{updateTime,jdbcType=TIMESTAMP} where ORG_ID_ = #{orgId} and USER_ID_ = #{userId}
	</delete>
	
</mapper>