|
|
@@ -26,11 +26,12 @@
|
|
|
<result column="reviewer" jdbcType="VARCHAR" property="reviewer" />
|
|
|
<result column="amb_id" jdbcType="VARCHAR" property="ambId" />
|
|
|
<result column="amb_role" jdbcType="VARCHAR" property="ambRole" />
|
|
|
+ <result column="amb_manage" jdbcType="INTEGER" property="ambManage" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, mobile, `name`, `password`, email, create_time, `number`, province, `position`,
|
|
|
superior_id, city, department_id, `status`, user_no, duty, district, head_portrait_url,
|
|
|
- contact_mobile, last_login_time, open_id, `type`, reviewer, amb_id, amb_role
|
|
|
+ contact_mobile, last_login_time, open_id, `type`, reviewer, amb_id, amb_role, amb_manage
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -42,32 +43,29 @@
|
|
|
delete from admin
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</delete>
|
|
|
- <insert id="insert" parameterType="com.goafanti.common.model.Admin">
|
|
|
- insert into admin (id, mobile, `name`,
|
|
|
- `password`, email, create_time,
|
|
|
- `number`, province, `position`,
|
|
|
- superior_id, city, department_id,
|
|
|
- `status`, user_no, duty,
|
|
|
- district, head_portrait_url, contact_mobile,
|
|
|
- last_login_time, open_id, `type`,
|
|
|
- reviewer, amb_id, amb_role
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
|
|
|
+ insert into admin (mobile, `name`, `password`,
|
|
|
+ email, create_time, `number`,
|
|
|
+ province, `position`, superior_id,
|
|
|
+ city, department_id, `status`,
|
|
|
+ user_no, duty, district,
|
|
|
+ head_portrait_url, contact_mobile, last_login_time,
|
|
|
+ open_id, `type`, reviewer,
|
|
|
+ amb_id, amb_role, amb_manage
|
|
|
)
|
|
|
- values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
|
|
- #{password,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
- #{number,jdbcType=INTEGER}, #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR},
|
|
|
- #{superiorId,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR},
|
|
|
- #{status,jdbcType=VARCHAR}, #{userNo,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR},
|
|
|
- #{district,jdbcType=VARCHAR}, #{headPortraitUrl,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR},
|
|
|
- #{lastLoginTime,jdbcType=TIMESTAMP}, #{openId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
|
|
|
- #{reviewer,jdbcType=VARCHAR}, #{ambId,jdbcType=VARCHAR}, #{ambRole,jdbcType=VARCHAR}
|
|
|
+ values (#{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
|
|
|
+ #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{number,jdbcType=INTEGER},
|
|
|
+ #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{superiorId,jdbcType=VARCHAR},
|
|
|
+ #{city,jdbcType=VARCHAR}, #{departmentId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
|
|
|
+ #{userNo,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR}, #{district,jdbcType=VARCHAR},
|
|
|
+ #{headPortraitUrl,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP},
|
|
|
+ #{openId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{reviewer,jdbcType=VARCHAR},
|
|
|
+ #{ambId,jdbcType=VARCHAR}, #{ambRole,jdbcType=VARCHAR}, #{ambManage,jdbcType=INTEGER}
|
|
|
)
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" parameterType="com.goafanti.common.model.Admin">
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
|
|
|
insert into admin
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id,
|
|
|
- </if>
|
|
|
<if test="mobile != null">
|
|
|
mobile,
|
|
|
</if>
|
|
|
@@ -137,11 +135,11 @@
|
|
|
<if test="ambRole != null">
|
|
|
amb_role,
|
|
|
</if>
|
|
|
+ <if test="ambManage != null">
|
|
|
+ amb_manage,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- #{id,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
<if test="mobile != null">
|
|
|
#{mobile,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
@@ -211,6 +209,9 @@
|
|
|
<if test="ambRole != null">
|
|
|
#{ambRole,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="ambManage != null">
|
|
|
+ #{ambManage,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Admin">
|
|
|
@@ -285,6 +286,9 @@
|
|
|
<if test="ambRole != null">
|
|
|
amb_role = #{ambRole,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="ambManage != null">
|
|
|
+ amb_manage = #{ambManage,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
@@ -312,10 +316,10 @@
|
|
|
`type` = #{type,jdbcType=INTEGER},
|
|
|
reviewer = #{reviewer,jdbcType=VARCHAR},
|
|
|
amb_id = #{ambId,jdbcType=VARCHAR},
|
|
|
- amb_role = #{ambRole,jdbcType=VARCHAR}
|
|
|
+ amb_role = #{ambRole,jdbcType=VARCHAR},
|
|
|
+ amb_manage = #{ambManage,jdbcType=INTEGER}
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
-
|
|
|
<select id="selectAllAdmin" resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
@@ -556,12 +560,6 @@
|
|
|
left join user_role ur on a.id=ur.uid
|
|
|
RIGHT join (select id from role where role_name =#{roleName,jdbcType=VARCHAR}) y on ur.rid=y.id
|
|
|
</if>
|
|
|
- <if test="ambManage ==0">
|
|
|
- RIGHT join (select id from admin where(find_in_set( 5 ,amb_role) or find_in_set( 6 ,amb_role)))am on a.id !=am.id
|
|
|
- </if>
|
|
|
- <if test="ambManage ==1">
|
|
|
- RIGHT join (select id from admin where(find_in_set( 5 ,amb_role) or find_in_set( 6 ,amb_role)))am on a.id =am.id
|
|
|
- </if>
|
|
|
where a.status in (0,1)
|
|
|
<if test="name != null">
|
|
|
and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
@@ -591,6 +589,9 @@
|
|
|
<if test="ancestors != null">
|
|
|
and (ambs.id=#{ancestors} or find_in_set( #{ancestors} ,ambs.ancestors))
|
|
|
</if>
|
|
|
+ <if test="ambManage !=null">
|
|
|
+ and a.amb_manage= #{ambManage}
|
|
|
+ </if>
|
|
|
order by a.last_login_time desc
|
|
|
<if test="page_sql!=null">
|
|
|
${page_sql}
|
|
|
@@ -638,6 +639,9 @@
|
|
|
<if test="ancestors != null">
|
|
|
and (ambs.id=#{ancestors} or find_in_set( #{ancestors} ,ambs.ancestors))
|
|
|
</if>
|
|
|
+ <if test="ambManage !=null">
|
|
|
+ and a.amb_manage= #{ambManage}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<insert id="insertn" parameterType="com.goafanti.common.model.Admin">
|
|
|
insert into admin (id, mobile, name,
|
|
|
@@ -1062,7 +1066,7 @@
|
|
|
|
|
|
<select id="listAdminBydepIdAndRoleType" resultType="com.goafanti.common.model.Admin">
|
|
|
select a.id,a.name from admin a left join user_role b on a.id =b.uid
|
|
|
- left join `role` c on b.rid=c.id
|
|
|
+ left join `role` c on b.rid=c.id
|
|
|
where department_id= #{depId}
|
|
|
and c.role_type= #{roleType}
|
|
|
</select>
|
|
|
@@ -1115,11 +1119,11 @@
|
|
|
<select id="selectAdminByRoleType" parameterType="java.lang.String" resultType="com.goafanti.common.model.Admin">
|
|
|
SELECT a.id,a.name ,a.mobile ,a.email,a.department_id departmentId
|
|
|
FROM admin a left join user_role b on a.id=b.uid
|
|
|
- left join `role` c on b.rid =c.id
|
|
|
+ left join `role` c on b.rid =c.id
|
|
|
where a.status='0'
|
|
|
- <if test="roleType =='99998'">
|
|
|
+ <if test="roleType =='99998'">
|
|
|
and c.role_type in ('99998','99988')
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
<if test="roleType =='99999'">
|
|
|
and c.role_type in ('99999','99989')
|
|
|
</if>
|