|
@@ -52,8 +52,14 @@
|
|
<if test="longitude != null and longitude != ''">and a.longitude = #{longitude}</if>
|
|
<if test="longitude != null and longitude != ''">and a.longitude = #{longitude}</if>
|
|
<if test="latitude != null and latitude != ''">and a.latitude = #{latitude}</if>
|
|
<if test="latitude != null and latitude != ''">and a.latitude = #{latitude}</if>
|
|
<if test="attachId != null and attachId != ''">and a.attach_id = #{attachId}</if>
|
|
<if test="attachId != null and attachId != ''">and a.attach_id = #{attachId}</if>
|
|
- <if test="deptId != null ">and a.dept_id = #{deptId}</if>
|
|
|
|
- <if test="deptName != null and deptName != ''">and a.dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
|
|
|
+ <if test="deptId != null">
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="deptName != null and deptName == 0">
|
|
|
|
+ and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>and d.dept_id = #{deptId}</otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </if>
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
</where>
|
|
</where>
|
|
order by a.appear_time desc, a.create_time desc
|
|
order by a.appear_time desc, a.create_time desc
|
|
@@ -79,8 +85,14 @@
|
|
<if test="longitude != null and longitude != ''">and a.longitude = #{longitude}</if>
|
|
<if test="longitude != null and longitude != ''">and a.longitude = #{longitude}</if>
|
|
<if test="latitude != null and latitude != ''">and a.latitude = #{latitude}</if>
|
|
<if test="latitude != null and latitude != ''">and a.latitude = #{latitude}</if>
|
|
<if test="attachId != null and attachId != ''">and a.attach_id = #{attachId}</if>
|
|
<if test="attachId != null and attachId != ''">and a.attach_id = #{attachId}</if>
|
|
- <if test="deptId != null ">and a.dept_id = #{deptId}</if>
|
|
|
|
- <if test="deptName != null and deptName != ''">and a.dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
|
|
|
+ <if test="deptId != null">
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="deptName != null and deptName == 0">
|
|
|
|
+ and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>and d.dept_id = #{deptId}</otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </if>
|
|
<if test="type != null ">and a.type = #{type}</if>
|
|
<if test="type != null ">and a.type = #{type}</if>
|
|
<if test="appearTime != null ">and a.appear_time = #{appearTime}</if>
|
|
<if test="appearTime != null ">and a.appear_time = #{appearTime}</if>
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
@@ -122,8 +134,14 @@
|
|
<if test="longitude != null and longitude != ''">and a.longitude like concat('%', #{longitude}, '%')</if>
|
|
<if test="longitude != null and longitude != ''">and a.longitude like concat('%', #{longitude}, '%')</if>
|
|
<if test="latitude != null and latitude != ''">and a.latitude like concat('%', #{latitude}, '%')</if>
|
|
<if test="latitude != null and latitude != ''">and a.latitude like concat('%', #{latitude}, '%')</if>
|
|
<if test="attachId != null and attachId != ''">and a.attach_id = #{attachId}</if>
|
|
<if test="attachId != null and attachId != ''">and a.attach_id = #{attachId}</if>
|
|
- <if test="deptId != null ">and a.dept_id = #{deptId}</if>
|
|
|
|
- <if test="appearTime != null ">and a.appear_time = #{appearTime}</if>
|
|
|
|
|
|
+ <if test="deptId != null">
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="deptName != null and deptName == 0">
|
|
|
|
+ and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>and d.dept_id = #{deptId}</otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </if>
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
</where>
|
|
</where>
|
|
order by a.appear_time desc, a.create_time desc
|
|
order by a.appear_time desc, a.create_time desc
|
|
@@ -140,8 +158,14 @@
|
|
<if test="longitude != null and longitude != ''">and longitude = #{longitude}</if>
|
|
<if test="longitude != null and longitude != ''">and longitude = #{longitude}</if>
|
|
<if test="latitude != null and latitude != ''">and latitude = #{latitude}</if>
|
|
<if test="latitude != null and latitude != ''">and latitude = #{latitude}</if>
|
|
<if test="attachId != null and attachId != ''">and attach_id = #{attachId}</if>
|
|
<if test="attachId != null and attachId != ''">and attach_id = #{attachId}</if>
|
|
- <if test="deptId != null ">and dept_id = #{deptId}</if>
|
|
|
|
- <if test="deptName != null and deptName != ''">and dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
|
|
|
+ <if test="deptId != null">
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="deptName != null and deptName == 0">
|
|
|
|
+ and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>and d.dept_id = #{deptId}</otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </if>
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
</where>
|
|
</where>
|
|
group by a.type, a.dept_id
|
|
group by a.type, a.dept_id
|