|
|
@@ -28,12 +28,13 @@
|
|
|
<result column="amb_role" jdbcType="VARCHAR" property="ambRole" />
|
|
|
<result column="amb_manage" jdbcType="INTEGER" property="ambManage" />
|
|
|
<result column="manager_id" jdbcType="VARCHAR" property="managerId" />
|
|
|
+ <result column="senior_staff" jdbcType="INTEGER" property="seniorStaff" />
|
|
|
</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, amb_manage,
|
|
|
- manager_id
|
|
|
+ manager_id, senior_staff
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -45,32 +46,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,
|
|
|
- amb_manage, manager_id)
|
|
|
- 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},
|
|
|
- #{ambManage,jdbcType=INTEGER}, #{managerId,jdbcType=VARCHAR})
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
|
|
|
+ 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, amb_manage,
|
|
|
+ manager_id, senior_staff)
|
|
|
+ values (#{id},#{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},
|
|
|
+ #{managerId,jdbcType=VARCHAR}, #{seniorStaff,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>
|
|
|
@@ -146,11 +144,11 @@
|
|
|
<if test="managerId != null">
|
|
|
manager_id,
|
|
|
</if>
|
|
|
+ <if test="seniorStaff != null">
|
|
|
+ senior_staff,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- #{id,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
<if test="mobile != null">
|
|
|
#{mobile,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
@@ -226,6 +224,9 @@
|
|
|
<if test="managerId != null">
|
|
|
#{managerId,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="seniorStaff != null">
|
|
|
+ #{seniorStaff,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Admin">
|
|
|
@@ -306,6 +307,9 @@
|
|
|
<if test="managerId != null">
|
|
|
manager_id = #{managerId,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="seniorStaff != null">
|
|
|
+ senior_staff = #{seniorStaff,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
@@ -335,7 +339,8 @@
|
|
|
amb_id = #{ambId,jdbcType=VARCHAR},
|
|
|
amb_role = #{ambRole,jdbcType=VARCHAR},
|
|
|
amb_manage = #{ambManage,jdbcType=INTEGER},
|
|
|
- manager_id = #{managerId,jdbcType=VARCHAR}
|
|
|
+ manager_id = #{managerId,jdbcType=VARCHAR},
|
|
|
+ senior_staff = #{seniorStaff,jdbcType=INTEGER}
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
|
|
|
@@ -522,6 +527,9 @@
|
|
|
<if test="number != null">
|
|
|
and a.number = #{number,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
+ <if test="seniorStaff != null">
|
|
|
+ and a.senior_staff = #{seniorStaff}
|
|
|
+ </if>
|
|
|
<if test="province != null">
|
|
|
and a.province = #{province,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -548,6 +556,9 @@
|
|
|
<if test="number != null">
|
|
|
and number = #{number,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
+ <if test="seniorStaff != null">
|
|
|
+ and a.senior_staff = #{seniorStaff}
|
|
|
+ </if>
|
|
|
<if test="province != null">
|
|
|
and a.province = #{province,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -568,7 +579,7 @@
|
|
|
<select id="selectAdminListByPage" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
|
|
|
select a.id, a.mobile, a.name, a.position, a.email, a.province, a.city, a.create_time as createTime, aa.name as superior,dep.name departmentName,
|
|
|
a.superior_id as superiorId, a.department_id as departmentId, a.last_login_time as lastLoginTime, a.contact_mobile as contactMobile,
|
|
|
- a.duty,a.status, a.type, ambs.id ambId,ambs.name ambName,ambs.ancestors_names ancestorsNames ,a.amb_role ambRole
|
|
|
+ a.duty,a.status, a.type, ambs.id ambId,ambs.name ambName,ambs.ancestors_names ancestorsNames ,a.amb_role ambRole,a.senior_staff seniorStaff
|
|
|
from admin a
|
|
|
left join admin_location al on a.id = al.admin_id
|
|
|
left join admin aa on aa.id = a.superior_id
|
|
|
@@ -607,6 +618,9 @@
|
|
|
<if test="ambId != null">
|
|
|
and a.amb_id = #{ambId}
|
|
|
</if>
|
|
|
+ <if test="seniorStaff != null">
|
|
|
+ and a.senior_staff = #{seniorStaff}
|
|
|
+ </if>
|
|
|
<if test="ancestors != null">
|
|
|
and (ambs.id=#{ancestors} or find_in_set( #{ancestors} ,ambs.ancestors))
|
|
|
</if>
|
|
|
@@ -657,6 +671,9 @@
|
|
|
<if test="ambId != null">
|
|
|
and a.amb_id = #{ambId}
|
|
|
</if>
|
|
|
+ <if test="seniorStaff != null">
|
|
|
+ and a.senior_staff = #{seniorStaff}
|
|
|
+ </if>
|
|
|
<if test="ancestors != null">
|
|
|
and (ambs.id=#{ancestors} or find_in_set( #{ancestors} ,ambs.ancestors))
|
|
|
</if>
|
|
|
@@ -700,10 +717,10 @@
|
|
|
select a.id, a.mobile, a.name, a.`password`, a.email, a.create_time as createTime,
|
|
|
a.province, a.`position`,a.reviewer , a.superior_id as superiorId,
|
|
|
a.department_id as departmentId, a.status,a.user_no as userNo,a.duty,a.district,
|
|
|
- a.head_portrait_url as headPortraitUrl, a.contact_mobile as contactMobile,
|
|
|
+ a.head_portrait_url as headPortraitUrl, a.contact_mobile as contactMobile,a.senior_staff seniorStaff,
|
|
|
b.name superior,c.name reviewerName,a.type,a.amb_id ambId,a.manager_id managerId ,d.name managerName
|
|
|
from admin a left join admin b on a.superior_id =b.id left join admin c on a.reviewer =c.id
|
|
|
- left join admin d on a.manager_id=d.id
|
|
|
+ left join admin d on a.manager_id=d.id
|
|
|
where a.id= #{id,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<select id="selectNameByid" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
@@ -1156,15 +1173,18 @@
|
|
|
and c.role_type in (#{roleType})
|
|
|
</if>
|
|
|
</select>
|
|
|
- <select id="selectByDeps" resultType="com.goafanti.admin.bo.AdminCustomerBo">
|
|
|
- SELECT a.id aid,a.name aName,a.department_id depId,d.name depName
|
|
|
- from admin a left join department d on a.department_id = d.id
|
|
|
- where a.status =0 and a.`type` =1
|
|
|
- <if test="depIds!= null">
|
|
|
- and a.department_id in
|
|
|
- <foreach close=")" collection="depIds" item="deps" open="(" separator=",">
|
|
|
- #{deps.id}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </select>
|
|
|
+ <select id="selectByDeps" resultType="com.goafanti.admin.bo.AdminCustomerBo">
|
|
|
+ SELECT a.id aid,a.name aName,a.department_id depId,d.name depName
|
|
|
+ from admin a left join department d on a.department_id = d.id
|
|
|
+ where a.status =0 and a.`type` =1
|
|
|
+ <if test="seniorStaff != null">
|
|
|
+ and a.senior_staff=#{seniorStaff}
|
|
|
+ </if>
|
|
|
+ <if test="depIds!= null">
|
|
|
+ and a.department_id in
|
|
|
+ <foreach close=")" collection="depIds" item="deps" open="(" separator=",">
|
|
|
+ #{deps.id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|