|
|
@@ -319,42 +319,18 @@
|
|
|
select
|
|
|
a.number, a.mobile, a.name,
|
|
|
a.position, a.email, a.id,
|
|
|
- a.create_time as createTime, GROUP_CONCAT(DISTINCT(al.province)) AS province,
|
|
|
- aa.name as superior, a.superior_id as superiorId
|
|
|
- from admin a
|
|
|
- left join admin_location al on a.id = al.admin_id
|
|
|
- left join admin aa on aa.id = a.superior_id
|
|
|
- where a.id <![CDATA[ <> ]]> '1'
|
|
|
- <if test = "mobile != null">
|
|
|
- and a.mobile = #{mobile,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test = "name != null">
|
|
|
- and a.name = #{name,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test = "number != null">
|
|
|
- and a.number = #{number,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- group by a.id
|
|
|
- order by a.number
|
|
|
- <if test="page_sql!=null">
|
|
|
- ${page_sql}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id= "findAreaAdminListByPage" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo" >
|
|
|
- select
|
|
|
- a.number, a.mobile, a.name,
|
|
|
- a.position, a.email, a.id,
|
|
|
- a.create_time as createTime,
|
|
|
- aa.name as superior, GROUP_CONCAT(DISTINCT(al.province)) AS province,
|
|
|
+ a.province,
|
|
|
+ a.city,
|
|
|
+ a.create_time as createTime,
|
|
|
+ aa.name as superior,
|
|
|
a.superior_id as superiorId,
|
|
|
- dm.id as departmentId,
|
|
|
+ a.department_id as departmentId,
|
|
|
dm.name as departmentName
|
|
|
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 department_management dm on a.department_id = dm.id
|
|
|
- where 1 =1
|
|
|
+ where a.id <![CDATA[ <> ]]> '1'
|
|
|
<if test = "mobile != null">
|
|
|
and a.mobile = #{mobile,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -364,25 +340,9 @@
|
|
|
<if test = "number != null">
|
|
|
and a.number = #{number,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <if test="provinceList != null">
|
|
|
- and al.province in
|
|
|
- <foreach collection="provinceList" item="plist" open="(" separator="," close=")">
|
|
|
- #{plist}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test = "provinceList != null and cityList != null">
|
|
|
- or
|
|
|
- </if>
|
|
|
- <if test="cityList != null">
|
|
|
- <if test="provinceList == null">
|
|
|
- and
|
|
|
- </if>
|
|
|
- al.city in
|
|
|
- <foreach collection="cityList" item="clist" open="(" separator="," close=")">
|
|
|
- #{clist}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- group by a.id
|
|
|
+ <if test = "province != null">
|
|
|
+ and a.province = #{province,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
order by a.number
|
|
|
<if test="page_sql!=null">
|
|
|
${page_sql}
|
|
|
@@ -390,8 +350,8 @@
|
|
|
</select>
|
|
|
|
|
|
<select id = "findAdminCount" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
|
- select count(1) from admin
|
|
|
- where id <![CDATA[ <> ]]> '1'
|
|
|
+ select count(1) from admin
|
|
|
+ where id <![CDATA[ <> ]]> '1'
|
|
|
<if test = "mobile != null">
|
|
|
and mobile = #{mobile,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -401,41 +361,11 @@
|
|
|
<if test = "number != null">
|
|
|
and number = #{number,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id = "findAreaAdminCount" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
|
- select count(distinct(a.number))
|
|
|
- from admin a
|
|
|
- left join admin_location al on a.id = al.admin_id
|
|
|
- where 1 = 1
|
|
|
- <if test = "mobile != null">
|
|
|
- and a.mobile = #{mobile,jdbcType=VARCHAR}
|
|
|
+ <if test = "province != null">
|
|
|
+ and a.province = #{province,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test = "name != null">
|
|
|
- and a.name = #{name,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test = "number != null">
|
|
|
- and a.number = #{number,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="provinceList != null">
|
|
|
- and al.province in
|
|
|
- <foreach collection="provinceList" item="plist" open="(" separator="," close=")">
|
|
|
- #{plist}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test = "provinceList != null && cityList != null">
|
|
|
- or
|
|
|
- </if>
|
|
|
- <if test="cityList != null">
|
|
|
- <if test="provinceList == null">
|
|
|
- and
|
|
|
- </if>
|
|
|
- al.city in
|
|
|
- <foreach collection="cityList" item="clist" open="(" separator="," close=")">
|
|
|
- #{clist}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
</select>
|
|
|
+
|
|
|
|
|
|
<select id="listAdminByName" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
select id,name from admin where name like concat('%',#{name},'%')
|