|
|
@@ -96,7 +96,7 @@
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Thu Nov 30 11:09:29 CST 2017.
|
|
|
-->
|
|
|
- id, create_id, create_time, update_time, deleted_sign, name, type, manager_id, dep_no,
|
|
|
+ id, create_id, create_time, update_time, deleted_sign, name, type, manager_id, dep_no,
|
|
|
super_id, remarks, status,abbreviation,finance_id
|
|
|
</sql>
|
|
|
<select id="selectByExample" parameterType="com.goafanti.common.model.OrganizationManagementExample" resultMap="BaseResultMap">
|
|
|
@@ -124,7 +124,7 @@
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Thu Nov 30 11:09:29 CST 2017.
|
|
|
-->
|
|
|
- select
|
|
|
+ select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from department
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
@@ -155,13 +155,13 @@
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Thu Nov 30 11:09:29 CST 2017.
|
|
|
-->
|
|
|
- insert into department (id, create_id, create_time,
|
|
|
- update_time, deleted_sign, name,
|
|
|
+ insert into department (id, create_id, create_time,
|
|
|
+ update_time, deleted_sign, name,
|
|
|
type, manager_id, dep_no, working_hours_type,
|
|
|
super_id, remarks, status
|
|
|
)
|
|
|
- values (#{id,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
- #{updateTime,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
|
|
#{type,jdbcType=VARCHAR}, #{managerId,jdbcType=VARCHAR}, #{depNo,jdbcType=VARCHAR}, #{workingHoursType,jdbcType=INTEGER},
|
|
|
#{superId,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}
|
|
|
)
|
|
|
@@ -420,10 +420,10 @@
|
|
|
dm.name as superName,
|
|
|
wh.name as workingHoursName,
|
|
|
x.name as managerName
|
|
|
- from department om
|
|
|
+ from department om
|
|
|
left join department dm on om.super_id = dm.id
|
|
|
left join admin x on om.manager_id = x.id
|
|
|
- left join working_hours wh on om.working_hours_type =wh.`type`
|
|
|
+ left join working_hours wh on om.working_hours_type =wh.`type`
|
|
|
where om.deleted_sign = 0
|
|
|
<if test="name !=null">
|
|
|
AND om.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
@@ -444,7 +444,7 @@
|
|
|
<select id="selectOrganizationCount" resultType="java.lang.Integer">
|
|
|
select
|
|
|
count(0)
|
|
|
- from department om
|
|
|
+ from department om
|
|
|
left join department dm on om.super_id = dm.id
|
|
|
left join admin x on om.manager_id = x.id
|
|
|
where om.deleted_sign = 0
|
|
|
@@ -469,7 +469,7 @@
|
|
|
status ='0'
|
|
|
order by CONVERT (name USING gbk)
|
|
|
<if test="sort ==1" >
|
|
|
- limit 10
|
|
|
+ limit 10
|
|
|
</if>
|
|
|
</select>
|
|
|
<insert id="insert1" parameterType="com.goafanti.organization.bo.OrganizationListOut">
|
|
|
@@ -481,7 +481,7 @@
|
|
|
#{deletedSign,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},
|
|
|
#{type,jdbcType=VARCHAR},#{managerId,jdbcType=VARCHAR},
|
|
|
#{depNo,jdbcType=VARCHAR},#{superId,jdbcType=VARCHAR},
|
|
|
- #{desc,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR})
|
|
|
+ #{desc,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR})
|
|
|
</insert>
|
|
|
<!-- 得到上级 -->
|
|
|
<select id="selectDepNo" resultType="String">
|
|
|
@@ -491,7 +491,7 @@
|
|
|
where
|
|
|
id=#{superId,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectDepNoByName" resultType="String">
|
|
|
select
|
|
|
dep_no as depNo
|
|
|
@@ -528,10 +528,10 @@
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</delete>
|
|
|
<select id="selectAdminNameById" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
- select
|
|
|
+ select
|
|
|
name
|
|
|
from admin
|
|
|
- where
|
|
|
+ where
|
|
|
id=#{id,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<select id="selectIdByDepNo" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
@@ -549,7 +549,7 @@
|
|
|
dep_no as depNo,
|
|
|
super_id as superId,
|
|
|
remarks,status
|
|
|
- from department
|
|
|
+ from department
|
|
|
where
|
|
|
super_id=#{id,jdbcType=VARCHAR}
|
|
|
order by dep_no
|
|
|
@@ -572,16 +572,16 @@
|
|
|
<select id="selectIdByName" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
select
|
|
|
id
|
|
|
- from department
|
|
|
+ from department
|
|
|
where
|
|
|
- name=#{name,jdbcType=VARCHAR}
|
|
|
+ name=#{name,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<select id="selectNameById" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
select
|
|
|
name
|
|
|
- from department
|
|
|
+ from department
|
|
|
where
|
|
|
- id=#{id,jdbcType=VARCHAR}
|
|
|
+ id=#{id,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<select id="selectDepNoById" resultType="String">
|
|
|
select
|
|
|
@@ -607,7 +607,7 @@
|
|
|
<select id="selectSubDeps" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
select id,name,dep_no from department where super_id in (#{superIds,jdbcType=VARCHAR})
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectBysuperId" resultType="com.goafanti.admin.bo.depCountBo">
|
|
|
select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
|
|
|
from department a left join department b on a.super_id=b.id where b.id= #{id}
|
|
|
@@ -617,7 +617,7 @@
|
|
|
select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
|
|
|
from department a left join department b on a.super_id=b.id where b.name= #{name}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<!-- 查询所有 -->
|
|
|
<select id="selectAllDeps" resultMap="BaseResultMap">
|
|
|
select id,name,dep_no from department
|
|
|
@@ -625,9 +625,9 @@
|
|
|
<select id="getMaxAbbreviation" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
select max(contract_no) as maxNo from t_order_new
|
|
|
where create_time > '2019-5-31'
|
|
|
- and contract_no like concat(#{abbreviation,jdbcType=VARCHAR},'%')
|
|
|
+ and contract_no like concat(#{abbreviation,jdbcType=VARCHAR},'%')
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="getDepAll" resultType="com.goafanti.admin.bo.AdminCustomerBo">
|
|
|
select a.id aid,a.name aName,d.id depId,d.name depName,ifnull(b.userCount,0)userCount,ifnull(b.channelCount,0)channelCount,
|
|
|
ifnull(b.signCount,0)signCount,ifnull(b.newCount,0)newCount,ifnull(b.channelNewCount,0)channelNewCount,ifnull( b.receiveCount,0)receiveCount,
|
|
|
@@ -640,7 +640,7 @@
|
|
|
sum(if(share_type=0 and source =1 and channel=0,1,0))newCount,
|
|
|
sum(if(share_type=0 and source =1 and channel=1,1,0))channelNewCount,
|
|
|
sum(if(share_type=0 and source =2 and channel=0,1,0))receiveCount
|
|
|
- from `user` where `type` =1
|
|
|
+ from `user` where `type` =1 and new_channel=0
|
|
|
<if test="startTime != null and endTime != null">
|
|
|
and transfer_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -654,11 +654,11 @@
|
|
|
left join department d on a.department_id=d.id
|
|
|
where a.status='正常' and a.type=1
|
|
|
<if test="adminName !=null">
|
|
|
- and a.name like concat('%',#{adminName},'%')
|
|
|
+ and a.name like concat('%',#{adminName},'%')
|
|
|
</if>
|
|
|
<if test="depId !=null">
|
|
|
and d.id= #{depId}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
-</mapper>
|
|
|
+</mapper>
|