|
@@ -29,21 +29,24 @@
|
|
|
<result column="dept_name_his" jdbcType="VARCHAR" property="deptNameHis"/>
|
|
|
<result column="personal_share" jdbcType="VARCHAR" property="personalShare"/>
|
|
|
<result column="qualifier_pic_path" jdbcType="VARCHAR" property="qualifierPicPath"/>
|
|
|
+ <result column="update_user" jdbcType="VARCHAR" property="updateUser"/>
|
|
|
+ <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="lazyLoadRoles" type="com.jiuzhekan.cbkj.beans.sysBeans.AdminInfo" extends="BaseResultMap">
|
|
|
<collection property="roles" ofType="com.jiuzhekan.cbkj.beans.sysBeans.AdminRule" select="getRolesByAdminId"
|
|
|
- column="id">
|
|
|
+ column="user_id">
|
|
|
</collection>
|
|
|
</resultMap>
|
|
|
<select id="getRolesByAdminId" resultType="AdminRule">
|
|
|
- select r.role_id, r.role_name, r.role_desc, r.create_date, r.create_user adminId, r.rname_zh,r.index_url indexUrl from
|
|
|
+ select r.role_id roleId,r.obj_id objId, r.role_name roleName , r.role_desc roleDesc, r.create_date createDate, r.create_user createUser, r.rname_zh rnameZh ,r.index_url indexUrl from
|
|
|
sys_admin_info_rule ar,sys_admin_rule r where ar.role_id = r.role_id AND ar.user_id=#{id}
|
|
|
|
|
|
</select>
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
- user_id,user_name,password,sex,status,create_date,CREATE_USER,last_ip,phone,address,name_zh,user_heand,email,APP_ID,INS_CODE,dept_id,dept_name,EXPIRE_DATE,create_user_name,is_qualifier,dept_id_his,dept_name_his,qualifier_pic_path,personal_share
|
|
|
+ user_id,user_name,password,sex,status,create_date,CREATE_USER,last_ip,phone,address,name_zh,user_heand,email,APP_ID,INS_CODE,dept_id,dept_name,EXPIRE_DATE,create_user_name,is_qualifier,dept_id_his,dept_name_his,qualifier_pic_path,personal_share,
|
|
|
+update_user,update_time,professional
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectAdminRoleById" parameterType="java.lang.String" resultMap="lazyLoadRoles">
|
|
@@ -153,10 +156,6 @@
|
|
|
<if test="email != null">
|
|
|
,#{email}
|
|
|
</if>
|
|
|
-
|
|
|
- <if test="originDoctorId != null">
|
|
|
- ,#{originDoctorId}
|
|
|
- </if>
|
|
|
<if test="expireDate != null">
|
|
|
,#{expireDate}
|
|
|
</if>
|
|
@@ -353,6 +352,16 @@
|
|
|
CREATE_USER = #{createUser,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
|
|
|
+ <if test="updateUser != null">
|
|
|
+ update_user = #{updateUser,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="professional != null">
|
|
|
+ professional = #{professional,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -427,9 +436,13 @@
|
|
|
DATE_FORMAT(
|
|
|
a.create_date,
|
|
|
'%Y-%m-%d %H:%i:%s'
|
|
|
- ) create_date as createDate,
|
|
|
+ ) createDate ,
|
|
|
a.CREATE_USER createUser,
|
|
|
-
|
|
|
+ a.update_user updateUser,
|
|
|
+ DATE_FORMAT(
|
|
|
+ a.update_time,
|
|
|
+ '%Y-%m-%d %H:%i:%s'
|
|
|
+ ) updateTime,
|
|
|
a.last_ip as lastIp,
|
|
|
a.phone,
|
|
|
a.address,
|
|
@@ -442,15 +455,19 @@
|
|
|
a.dept_id_his deptIdHis,
|
|
|
a.dept_name_his deptNameHis,
|
|
|
group_concat(r.rname_zh) rnamess,
|
|
|
- c.create_user_name createName
|
|
|
+ group_concat(i.ins_name) insNames,
|
|
|
+ c.user_name createUserName,
|
|
|
+ c2.user_name updateUserName
|
|
|
+
|
|
|
FROM `sys_admin_info` a
|
|
|
left join sys_admin_info_rule ar on a.user_id = ar.user_id
|
|
|
left join sys_admin_rule r on ar.role_id = r.role_id
|
|
|
left join sys_admin_info c on c.user_id = a.CREATE_USER
|
|
|
+ left join sys_admin_info c2 on c2.user_id = a.update_user
|
|
|
LEFT JOIN sys_doctor_multipoint ap ON ap.user_id = a.user_id
|
|
|
left join sys_app p on ap.app_id = p.app_id
|
|
|
left join sys_institution i on ap.app_id = i.APP_ID and ap.ins_code = i.INS_CODE
|
|
|
- WHERE a.status = '1'
|
|
|
+ WHERE a.status in ('1','2','3')
|
|
|
<if test="userName != null and userName != ''">
|
|
|
and (a.user_name like concat('%',trim(#{userName}),'%') or a.name_zh like concat('%',trim(#{userName}),'%')
|
|
|
)
|
|
@@ -467,6 +484,9 @@
|
|
|
<if test="deptName != null and deptName != ''">
|
|
|
and ap.dept_name like concat('%',#{deptName},'%')
|
|
|
</if>
|
|
|
+ <if test="roleName != null and roleName != ''">
|
|
|
+ and r.role_name like concat('%',#{roleName},'%')
|
|
|
+ </if>
|
|
|
<if test="sex != null and sex != ''">
|
|
|
and a.sex = #{sex}
|
|
|
</if>
|
|
@@ -553,7 +573,7 @@
|
|
|
</insert>
|
|
|
|
|
|
<delete id="deleteAdminInfoRuleByAdminId" parameterType="String">
|
|
|
- delete from sys_admin_info_rule where admin_id = #{id}
|
|
|
+ delete from sys_admin_info_rule where user_id = #{id}
|
|
|
|
|
|
</delete>
|
|
|
|
|
@@ -592,7 +612,7 @@
|
|
|
AND a.INS_CODE = #{insCode}
|
|
|
</if>
|
|
|
<if test="id != null and id != ''">
|
|
|
- AND a.id != #{id}
|
|
|
+ AND a.user_id != #{id}
|
|
|
</if>
|
|
|
|
|
|
</where>
|