فهرست منبع

数字农业增加可视化

hanfucheng 11 ماه پیش
والد
کامیت
69e8c62741

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 0
src/main/java/com/sooka/sponest/data/digitalforest/domain/CenterdataTForestTrees.java


+ 9 - 2
src/main/resources/mapper/digitalforest/CenterdataTForestTreesMapper.xml

@@ -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>