|
|
@@ -38,7 +38,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="AdminAllSql">
|
|
|
- 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, public_purview, expense_open_id, expense_super_examine, public_carbon_copy, call_no
|
|
|
+ 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, public_purview, expense_open_id, expense_super_examine, public_carbon_copy, call_no, team_id
|
|
|
</sql>
|
|
|
|
|
|
<!--查询单个-->
|
|
|
@@ -55,19 +55,19 @@
|
|
|
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, public_purview, expense_open_id, expense_super_examine, public_carbon_copy,
|
|
|
- call_no)
|
|
|
+ call_no, team_id)
|
|
|
values (#{id},#{mobile}, #{name}, #{password}, #{email}, #{createTime}, #{number}, #{province}, #{position},
|
|
|
#{superiorId}, #{city}, #{departmentId}, #{status}, #{userNo}, #{duty}, #{district}, #{headPortraitUrl},
|
|
|
#{contactMobile}, #{lastLoginTime}, #{openId}, #{type}, #{reviewer}, #{ambId}, #{ambRole}, #{ambManage},
|
|
|
#{managerId}, #{seniorStaff}, #{publicPurview}, #{expenseOpenId}, #{expenseSuperExamine},
|
|
|
- #{publicCarbonCopy}, #{callNo})
|
|
|
+ #{publicCarbonCopy}, #{callNo}, #{teamId})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
|
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, manager_id, senior_staff, public_purview, expense_open_id,
|
|
|
- expense_super_examine, public_carbon_copy, call_no)
|
|
|
+ expense_super_examine, public_carbon_copy, call_no, team_id)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
(#{entity.mobile}, #{entity.name}, #{entity.password}, #{entity.email}, #{entity.createTime},
|
|
|
@@ -76,7 +76,7 @@
|
|
|
#{entity.headPortraitUrl}, #{entity.contactMobile}, #{entity.lastLoginTime}, #{entity.openId},
|
|
|
#{entity.type}, #{entity.reviewer}, #{entity.ambId}, #{entity.ambRole}, #{entity.ambManage},
|
|
|
#{entity.managerId}, #{entity.seniorStaff}, #{entity.publicPurview}, #{entity.expenseOpenId},
|
|
|
- #{entity.expenseSuperExamine}, #{entity.publicCarbonCopy}, #{entity.callNo})
|
|
|
+ #{entity.expenseSuperExamine}, #{entity.publicCarbonCopy}, #{entity.callNo}, #{entity.teamId})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
@@ -84,7 +84,7 @@
|
|
|
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, manager_id, senior_staff, public_purview, expense_open_id,
|
|
|
- expense_super_examine, public_carbon_copy, call_no)
|
|
|
+ expense_super_examine, public_carbon_copy, call_no, team_id)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
(#{entity.mobile}, #{entity.name}, #{entity.password}, #{entity.email}, #{entity.createTime},
|
|
|
@@ -126,7 +126,8 @@
|
|
|
expense_open_id = values(expense_open_id),
|
|
|
expense_super_examine = values(expense_super_examine),
|
|
|
public_carbon_copy = values(public_carbon_copy),
|
|
|
- call_no = values(call_no)
|
|
|
+ call_no = values(call_no),
|
|
|
+ team_id = values(team_id)
|
|
|
</insert>
|
|
|
|
|
|
<!--通过主键修改数据-->
|
|
|
@@ -226,6 +227,9 @@
|
|
|
<if test="callNo != null and callNo != ''">
|
|
|
call_no = #{callNo},
|
|
|
</if>
|
|
|
+ <if test="teamId != null">
|
|
|
+ team_id = #{teamId},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
@@ -482,13 +486,14 @@
|
|
|
<!--*************************************************************************-->
|
|
|
<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.superior_id as superiorId, a.department_id as departmentId, a.last_login_time as lastLoginTime, a.contact_mobile as contactMobile,st.name teamName,a.team_id teamId,
|
|
|
a.duty,a.status, a.type, ambs.id ambId,ambs.name ambName,ambs.ancestors_names ancestorsNames ,a.amb_role ambRole,a.senior_staff seniorStaff,a.public_purview publicPurview
|
|
|
from admin a
|
|
|
left join admin_location al on a.id = al.admin_id
|
|
|
left join admin aa on aa.id = a.superior_id
|
|
|
left join amb_system ambs on a.amb_id=ambs.id
|
|
|
left join department dep on a.department_id = dep.id
|
|
|
+ left join sales_team st on a.team_id=st.id
|
|
|
<if test="rid != null">
|
|
|
RIGHT join (select uid from user_role where rid=#{rid,jdbcType=VARCHAR}) ur on a.id=ur.uid
|
|
|
</if>
|
|
|
@@ -630,9 +635,10 @@
|
|
|
a.department_id as departmentId, a.status,a.user_no as userNo,a.duty,a.district,a.expense_super_examine expenseSuperExamine,
|
|
|
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,
|
|
|
- a.public_carbon_copy publicCarbonCopy,e.name publicCarbonCopyName
|
|
|
+ a.public_carbon_copy publicCarbonCopy,e.name publicCarbonCopyName,a.team_id teamId,st.name teamName
|
|
|
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 e on a.public_carbon_copy=e.id
|
|
|
+ left join sales_team st on a.team_id=st.id
|
|
|
where a.id= #{id,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<select id="selectNameByid" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
@@ -1307,5 +1313,12 @@
|
|
|
from admin
|
|
|
where call_no = #{callStaffNo}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="queryByTeamId" resultMap="AdminMap">
|
|
|
+ select
|
|
|
+ <include refid="AdminAllSql"/>
|
|
|
+ from admin
|
|
|
+ where team_id = #{teamId}
|
|
|
+ </select>
|
|
|
</mapper>
|
|
|
|