|
@@ -53,6 +53,9 @@
|
|
|
<if test="treesSpecies != null and treesSpecies != ''">and a.trees_species = #{treesSpecies}</if>
|
|
|
<if test="treesType != null and treesType != ''">and a.trees_type = #{treesType}</if>
|
|
|
<if test="treesRemarks != null and treesRemarks != ''">and a.trees_remarks = #{treesRemarks}</if>
|
|
|
+ <if test="year != null">
|
|
|
+ and DATE_FORMAT(a.create_time,'%Y') = #{year}
|
|
|
+ </if>
|
|
|
<if test="deptId != null">
|
|
|
<choose>
|
|
|
<when test="deptName != null and deptName == 0">
|
|
@@ -158,7 +161,11 @@
|
|
|
select a.trees_species treesSpecies, count(a.id) count
|
|
|
from centerdata_t_forest_trees a
|
|
|
left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
|
|
|
- where 1=1 ${params.dataScope}
|
|
|
+ where 1=1
|
|
|
+ <if test="year != null">
|
|
|
+ and DATE_FORMAT(a.create_time,'%Y') = #{year}
|
|
|
+ </if>
|
|
|
+ ${params.dataScope}
|
|
|
group by trees_species
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+</mapper>
|