|
|
@@ -35,10 +35,11 @@
|
|
|
<result property="expenseSuperExamine" column="expense_super_examine" jdbcType="INTEGER"/>
|
|
|
<result property="publicCarbonCopy" column="public_carbon_copy" jdbcType="VARCHAR"/>
|
|
|
<result property="callNo" column="call_no" jdbcType="VARCHAR"/>
|
|
|
+ <result property="teamId" column="team_id" jdbcType="INTEGER"/>
|
|
|
</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 +56,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 (#{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 +77,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 +85,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},
|
|
|
@@ -93,7 +94,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>
|
|
|
on duplicate key update
|
|
|
mobile = values(mobile),
|
|
|
@@ -126,7 +127,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 +228,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 +487,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>
|
|
|
@@ -522,6 +528,9 @@
|
|
|
<if test="ambId != null">
|
|
|
and a.amb_id = #{ambId}
|
|
|
</if>
|
|
|
+ <if test="teamId !=null">
|
|
|
+ and a.team_id=#{teamId}
|
|
|
+ </if>
|
|
|
<if test="seniorStaff != null">
|
|
|
and a.senior_staff = #{seniorStaff}
|
|
|
</if>
|
|
|
@@ -579,6 +588,9 @@
|
|
|
<if test="ambId != null">
|
|
|
and a.amb_id = #{ambId}
|
|
|
</if>
|
|
|
+ <if test="teamId !=null">
|
|
|
+ and a.team_id= #{teamId}
|
|
|
+ </if>
|
|
|
<if test="seniorStaff != null">
|
|
|
and a.senior_staff = #{seniorStaff}
|
|
|
</if>
|