浏览代码

养殖场信息/种畜禽养殖场信息出栏入栏面积容积输入长度修改

刘浩男 1 年之前
父节点
当前提交
3aab37844a

+ 8 - 4
data-ui/src/views/data/digitalagriculture/LivestockInfo/index.vue

@@ -75,7 +75,7 @@ export default {
       deptName: undefined,
       deptName: undefined,
       // 表单参数
       // 表单参数
       form: {},
       form: {},
-
+      AgriculturalMachineryInfoList:{}
     };
     };
   },
   },
   created() {
   created() {
@@ -102,9 +102,13 @@ export default {
       this.loading = true;
       this.loading = true;
       listLivestockCount(this.queryParams).then(response => {
       listLivestockCount(this.queryParams).then(response => {
         this.AgriculturalMachineryInfoList = response.rows;
         this.AgriculturalMachineryInfoList = response.rows;
-        // const firstItem = this.AgriculturalMachineryInfoList.shift(); // 移除第一条数据并保存到firstItem
-        // this.AgriculturalMachineryInfoList.push(firstItem); // 将firstItem添加到数据源的末尾
-        this.total = response.total;
+        //查询到的数据去除逗号
+        this.AgriculturalMachineryInfoList.forEach(item => {
+          item.designMaintainCount = item.designMaintainCount.replace(/,/g, '');
+          item.designOfftakeCount = item.designOfftakeCount.replace(/,/g, '');
+          item.realityMaintainCount = item.realityMaintainCount.replace(/,/g, '');
+          item.realityOfftakeCount = item.realityOfftakeCount.replace(/,/g, '');
+        });
         this.loading = false;
         this.loading = false;
       });
       });
     },
     },

+ 6 - 3
data-ui/src/views/data/digitalagriculture/animalhusbandry_info/index.vue

@@ -122,9 +122,12 @@ import {
         this.loading = true;
         this.loading = true;
         listAnimalHusbandryInfo(this.queryParams).then(response => {
         listAnimalHusbandryInfo(this.queryParams).then(response => {
           this.AgriculturalMachineryInfoList = response.rows;
           this.AgriculturalMachineryInfoList = response.rows;
-          // const firstItem = this.AgriculturalMachineryInfoList.shift(); // 移除第一条数据并保存到firstItem
-          // this.AgriculturalMachineryInfoList.push(firstItem); // 将firstItem添加到数据源的末尾
-          this.total = response.total;
+          this.AgriculturalMachineryInfoList.forEach(item => {
+            item.designMaintainCount = item.designMaintainCount.replace(/,/g, '');
+            item.designOfftakeCount = item.designOfftakeCount.replace(/,/g, '');
+            item.realityMaintainCount = item.realityMaintainCount.replace(/,/g, '');
+            item.realityOfftakeCount = item.realityOfftakeCount.replace(/,/g, '');
+          });
           this.loading = false;
           this.loading = false;
         });
         });
       },
       },

+ 289 - 270
data-ui/src/views/data/digitalresources/farm/farmland/index.vue

@@ -1,6 +1,7 @@
 <template>
 <template>
   <div class="app-container">
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"
+             @submit.native.prevent>
       <el-form-item label="地块名称" prop="name">
       <el-form-item label="地块名称" prop="name">
         <el-input
         <el-input
           v-model="queryParams.name"
           v-model="queryParams.name"
@@ -19,6 +20,16 @@
           @keyup.enter.native="handleQuery"
           @keyup.enter.native="handleQuery"
         />
         />
       </el-form-item>
       </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName === 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"
+                    style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
       <el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -152,7 +163,8 @@
               <el-input v-model="form.supermapCode" placeholder="请输入地图编码" maxlength="20"/>
               <el-input v-model="form.supermapCode" placeholder="请输入地图编码" maxlength="20"/>
             </el-form-item>
             </el-form-item>
             <el-form-item label="面积(单位㎡)" prop="area">
             <el-form-item label="面积(单位㎡)" prop="area">
-              <el-input v-model="form.area" placeholder="请输入面积" onkeyup="this.value=this.value.replace(/[^\d.]/g,'');"  maxlength="20"/>
+              <el-input v-model="form.area" placeholder="请输入面积"
+                        onkeyup="this.value=this.value.replace(/[^\d.]/g,'');" maxlength="20"/>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
           <el-col :span="12">
           <el-col :span="12">
@@ -188,285 +200,292 @@
       </div>
       </div>
     </el-dialog>
     </el-dialog>
     <!-- 添加区域标记 -->
     <!-- 添加区域标记 -->
-<!--    <el-dialog :title="titleLongitude":visible.sync="regionalFlagOpen" width="1000px" >-->
-<!--      <areaSupermap ref="fireAreaSupermap"  v-if="regionalFlagOpen"  style="width: 100%;height:74vh" :mapDiv="'farmlandSuperMap'" :mapSite="{doubleClickZoom:false}" :codes="['9fa5']" :isSideBySide="false"  :showAreaLatLng="showAreaLatLng"></areaSupermap>-->
-<!--      <div slot="footer" class="dialog-footer">-->
-<!--        <el-button type="primary" @click="submitRegionalFlag">确 定</el-button>-->
-<!--        <el-button @click="cancelRegionalFlag">取 消</el-button>-->
-<!--      </div>-->
-<!--    </el-dialog>-->
+    <!--    <el-dialog :title="titleLongitude":visible.sync="regionalFlagOpen" width="1000px" >-->
+    <!--      <areaSupermap ref="fireAreaSupermap"  v-if="regionalFlagOpen"  style="width: 100%;height:74vh" :mapDiv="'farmlandSuperMap'" :mapSite="{doubleClickZoom:false}" :codes="['9fa5']" :isSideBySide="false"  :showAreaLatLng="showAreaLatLng"></areaSupermap>-->
+    <!--      <div slot="footer" class="dialog-footer">-->
+    <!--        <el-button type="primary" @click="submitRegionalFlag">确 定</el-button>-->
+    <!--        <el-button @click="cancelRegionalFlag">取 消</el-button>-->
+    <!--      </div>-->
+    <!--    </el-dialog>-->
     <ISuperMapAreaMarker ref="ISuperMap" v-if="regionalFlagOpen" @send="send"/>
     <ISuperMapAreaMarker ref="ISuperMap" v-if="regionalFlagOpen" @send="send"/>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-    import {
-        listFarmland,
-        getFarmland,
-        delFarmland,
-        addFarmland,
-        updateFarmland
-    } from "@/api/data/digitalresources/farmland";
-    import deptselector from '@/views/components/deptselector'
-    import areaSupermap from '@/views/components/supermap'
+import {
+  listFarmland,
+  getFarmland,
+  delFarmland,
+  addFarmland,
+  updateFarmland
+} from "@/api/data/digitalresources/farmland";
+import deptselector from '@/views/components/deptselector'
+import areaSupermap from '@/views/components/supermap'
 
 
-    import { listInfo, getInfo, delInfo, addInfo, updateInfo, addRegionalFlag,
-        getRegionalFlag,
-        delRegionalFlag } from "@/api/data/digitalresources/info";
-    import Treeselect from "@riophae/vue-treeselect";
-    import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-    import {treeselect} from "@/api/system/dept";
-    import ISuperMapAreaMarker from "@/views/data/common/ISuperMapAreaMarker";
-    export default {
-        components: {Treeselect, deptselector,areaSupermap,ISuperMapAreaMarker},
-        name: "Farmland",
-        dicts: ['farm_field_attribute', 'sys_normal_disable'],
+import {
+  listInfo, getInfo, delInfo, addInfo, updateInfo, addRegionalFlag,
+  getRegionalFlag,
+  delRegionalFlag
+} from "@/api/data/digitalresources/info";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {treeselect} from "@/api/system/dept";
+import ISuperMapAreaMarker from "@/views/data/common/ISuperMapAreaMarker";
 
 
-        data() {
-            return {
-                //区域标记
-              regionalFlagObj: {
-                eventId: null,
-                latLngs: [],
-                type: '2',
-                name:null,
-              },
-              regionalFlagObj1: [],
-              regionalFlagOpen:false,
-              sign:3,
-              titleLongitude:'永久基本农田管理区域标记',
-                // 遮罩层
-                loading: true,
-                // 选中数组
-                ids: [],
-                // 非单个禁用
-                single: true,
-                // 非多个禁用
-                multiple: true,
-                // 显示搜索条件
-                showSearch: true,
-                // 总条数
-                total: 0,
-                // 永久基本农田管理表格数据
-                farmlandList: [],
-                // 弹出层标题
-                title: "",
-                // 是否显示弹出层
-                open: false,
-                // 查询参数
-                queryParams: {
-                    pageNum: 1,
-                    pageSize: 10,
-                    name: null,
-                    code: null,
-                    attribute: null,
-                    city: null,
-                    district: null,
-                    village: null,
-                    area: null,
-                    type: null,
-                    supermapCode: null,
-                    createDate: null,
-                    updateDate: null,
-                    remarks: null,
-                    deptId: null,
-                    deptName: null
-                },
-                // 表单参数
-                form: {},
-                // 表单校验
-                rules: {
-                  name: [
-                    {required: true, message: "地块名称不能为空", trigger: "blur"}
-                  ],
-                  code: [
-                    {required: true, message: "地块编码不能为空", trigger: "blur"}
-                  ],
-                  supermapCode: [
-                    {required: true, message: "地图编码不能为空", trigger: "blur"}
-                  ],
-                  attribute: [
-                    {required: true, message: "地块属性不能为空", trigger: "blur"}
-                  ],
-                  city: [
-                    {required: true, message: "城市不能为空", trigger: "blur"}
-                  ],
-                  type: [
-                    {required: true, message: "状态不能为空", trigger: "blur"}
-                  ],
-                  area: [
-                    {required: true, message: "面积不能为空", trigger: "blur"}
-                  ],
-                  deptId: [
-                    {required: true, message: "所属部门不能为空", trigger: "change"}
-                  ],
-                }
-            };
-        },
-        created() {
-            this.getList();
-            this.getTreeselect();
-        },
-        methods: {
-          getTreeselect() {
-            treeselect().then(response => {
-              this.deptOptions = response.data
-            })
-          },
+export default {
+  components: {Treeselect, deptselector, areaSupermap, ISuperMapAreaMarker},
+  name: "Farmland",
+  dicts: ['farm_field_attribute', 'sys_normal_disable'],
 
 
+  data() {
+    return {
+      //区域标记
+      regionalFlagObj: {
+        eventId: null,
+        latLngs: [],
+        type: '2',
+        name: null,
+      },
+      regionalFlagObj1: [],
+      regionalFlagOpen: false,
+      sign: 3,
+      titleLongitude: '永久基本农田管理区域标记',
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 永久基本农田管理表格数据
+      farmlandList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        code: null,
+        attribute: null,
+        city: null,
+        district: null,
+        village: null,
+        area: null,
+        type: null,
+        supermapCode: null,
+        createDate: null,
+        updateDate: null,
+        remarks: null,
+        deptId: null,
+        deptName: 0
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        name: [
+          {required: true, message: "地块名称不能为空", trigger: "blur"}
+        ],
+        code: [
+          {required: true, message: "地块编码不能为空", trigger: "blur"}
+        ],
+        supermapCode: [
+          {required: true, message: "地图编码不能为空", trigger: "blur"}
+        ],
+        attribute: [
+          {required: true, message: "地块属性不能为空", trigger: "blur"}
+        ],
+        city: [
+          {required: true, message: "城市不能为空", trigger: "blur"}
+        ],
+        type: [
+          {required: true, message: "状态不能为空", trigger: "blur"}
+        ],
+        area: [
+          {required: true, message: "面积不能为空", trigger: "blur"}
+        ],
+        deptId: [
+          {required: true, message: "所属部门不能为空", trigger: "change"}
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data
+      })
+    },
 
 
 
 
-            /** 区域标记按钮操作 */
-            regionalFlagAdd(row) {
-              const eventId = row.id;
-              this.regionalFlagObj.eventId= eventId;
-              this.showMap(eventId)
-              // getRegionalFlag(eventId).then(response => {
-              //   this.regionalFlagObj1 = response.data;
-              // })
-            },
-          showMap(eventId) {
-            this.regionalFlagOpen = true;
-            this.$nextTick(() => {
-              this.$refs.ISuperMap.initP(this.sign, {
-                longitude: undefined,
-                latitude: undefined,
-                xiantude: undefined
-              },eventId)
-            })
-          },
-          send(val) {
-            if (val===true){
-              this.regionalFlagOpen = false;
-              return;
-            }
-            if (this.sign === 2 || this.sign === 3) this.regionalFlagObj.latLngs = val.xiantude;//this.form.longitude 换成对应的线或区域的字段
-            this.regionalFlagObj.name = val.name;
-            addRegionalFlag(this.regionalFlagObj).then(res =>{
-              this.$modal.msgSuccess(res.msg);
-              this.$refs.ISuperMap.getRegionalFlag();
-            });
-            // this.regionalFlagOpen = false
+    /** 区域标记按钮操作 */
+    regionalFlagAdd(row) {
+      const eventId = row.id;
+      this.regionalFlagObj.eventId = eventId;
+      this.showMap(eventId)
+      // getRegionalFlag(eventId).then(response => {
+      //   this.regionalFlagObj1 = response.data;
+      // })
+    },
+    showMap(eventId) {
+      this.regionalFlagOpen = true;
+      this.$nextTick(() => {
+        this.$refs.ISuperMap.initP(this.sign, {
+          longitude: undefined,
+          latitude: undefined,
+          xiantude: undefined
+        }, eventId)
+      })
+    },
+    send(val) {
+      if (val === true) {
+        this.regionalFlagOpen = false;
+        return;
+      }
+      if (this.sign === 2 || this.sign === 3) this.regionalFlagObj.latLngs = val.xiantude;//this.form.longitude 换成对应的线或区域的字段
+      this.regionalFlagObj.name = val.name;
+      addRegionalFlag(this.regionalFlagObj).then(res => {
+        this.$modal.msgSuccess(res.msg);
+        this.$refs.ISuperMap.getRegionalFlag();
+      });
+      // this.regionalFlagOpen = false
 
 
-          },
+    },
 
 
-            setDataDeptId(e) {
-                this.form.deptId = e.deptId
-                this.form.deptName = e.deptName
-            },
-          hx(node) {
-            this.form.dataDeptId = node.id
-            this.form.deptId = node.id
-            this.form.deptName = node.label
-            this.$refs.form.validateField("deptId")
-          },
-            /** 查询永久基本农田管理列表 */
-            getList() {
-                this.loading = true;
-                listFarmland(this.queryParams).then(response => {
-                    this.farmlandList = response.rows;
-                    this.total = response.total;
-                    this.loading = false;
-                });
-            },
-            // 取消按钮
-            cancel() {
-                this.open = false;
-                this.reset();
-            },
-            // 表单重置
-            reset() {
-                this.form = {
-                    id: null,
-                    name: null,
-                    code: null,
-                    attribute: null,
-                    city: null,
-                    district: null,
-                    village: null,
-                    area: null,
-                    type: null,
-                    supermapCode: null,
-                    createBy: null,
-                    createDate: null,
-                    updateBy: null,
-                    updateDate: null,
-                    remarks: null,
-                    delFlag: null,
-                    deptId: null,
-                    deptName: null
-                };
-                this.resetForm("form");
-            },
-            /** 搜索按钮操作 */
-            handleQuery() {
-                this.queryParams.pageNum = 1;
-                this.getList();
-            },
-            /** 重置按钮操作 */
-            resetQuery() {
-                this.resetForm("queryForm");
-                this.handleQuery();
-            },
-            // 多选框选中数据
-            handleSelectionChange(selection) {
-                this.ids = selection.map(item => item.id)
-                this.single = selection.length !== 1
-                this.multiple = !selection.length
-            },
-            /** 新增按钮操作 */
-            handleAdd() {
-                this.reset();
-                this.open = true;
-                this.title = "添加永久基本农田管理";
-            },
-            /** 修改按钮操作 */
-            handleUpdate(row) {
-                this.reset();
-                const id = row.id || this.ids
-                getFarmland(id).then(response => {
-                    this.form = response.data;
-                    this.open = true;
-                    this.title = "修改永久基本农田管理";
-                });
-            },
-            /** 提交按钮 */
-            submitForm() {
-                this.$refs["form"].validate(valid => {
-                    if (valid) {
-                        if (this.form.id != null) {
-                            updateFarmland(this.form).then(response => {
-                                this.$modal.msgSuccess("修改成功");
-                                this.open = false;
-                                this.getList();
-                            });
-                        } else {
-                            addFarmland(this.form).then(response => {
-                                this.$modal.msgSuccess("新增成功");
-                                this.open = false;
-                                this.getList();
-                            });
-                        }
-                    }
-                });
-            },
-            /** 删除按钮操作 */
-            handleDelete(row) {
-                const ids = row.id || this.ids;
-                this.$modal.confirm('是否确认删除选中的数据项?').then(function () {
-                    return delFarmland(ids);
-                }).then(() => {
-                    this.getList();
-                    this.$modal.msgSuccess("删除成功");
-                }).catch(() => {
-                });
-            },
-            /** 导出按钮操作 */
-            handleExport() {
-                this.download('center-data/farmland/export', {
-                    ...this.queryParams
-                }, `永久基本农田管理_${new Date().getTime()}.xlsx`)
-            }
+    setDataDeptId(e) {
+      this.form.deptId = e.deptId
+      this.form.deptName = e.deptName
+    },
+    hx(node) {
+      this.form.dataDeptId = node.id
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+      this.$refs.form.validateField("deptId")
+    },
+    /** 查询永久基本农田管理列表 */
+    getList() {
+      this.loading = true;
+      listFarmland(this.queryParams).then(response => {
+        this.farmlandList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        code: null,
+        attribute: null,
+        city: null,
+        district: null,
+        village: null,
+        area: null,
+        type: null,
+        supermapCode: null,
+        createBy: null,
+        createDate: null,
+        updateBy: null,
+        updateDate: null,
+        remarks: null,
+        delFlag: null,
+        deptId: null,
+        deptName: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加永久基本农田管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getFarmland(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改永久基本农田管理";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateFarmland(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addFarmland(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
         }
         }
-    };
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除选中的数据项?').then(function () {
+        return delFarmland(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('center-data/farmland/export', {
+        ...this.queryParams
+      }, `永久基本农田管理_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
 </script>
 </script>

+ 24 - 93
src/main/resources/mapper/digitalagriculture/CenterdataTFarmAnimalHusbandrynfoMapper.xml

@@ -19,105 +19,36 @@
 
 
     <select id="selectCenterdataTFarmAnimalHusbandryList" parameterType="CenterdataTFarmAnimalHusbandryInfoCountVo"
     <select id="selectCenterdataTFarmAnimalHusbandryList" parameterType="CenterdataTFarmAnimalHusbandryInfoCountVo"
             resultMap="CenterdataTFarmAnimalHusbandryInfoResult">
             resultMap="CenterdataTFarmAnimalHusbandryInfoResult">
-        SELECT '合计 ' dept_name,
-               CAST(SUM(IFNULL(a.design_maintain_count, 0)) AS CHAR) AS design_maintain_count,
-               CAST(SUM(IFNULL(a.design_offtake_count, 0)) AS CHAR) AS design_offtake_count,
+        SELECT '合计 '                                                   dept_name,
+               CAST(SUM(IFNULL(a.design_maintain_count, 0)) AS CHAR)  AS design_maintain_count,
+               CAST(SUM(IFNULL(a.design_offtake_count, 0)) AS CHAR)   AS design_offtake_count,
                CAST(SUM(IFNULL(a.reality_maintain_count, 0)) AS CHAR) AS reality_maintain_count,
                CAST(SUM(IFNULL(a.reality_maintain_count, 0)) AS CHAR) AS reality_maintain_count,
-               CAST(SUM(IFNULL(a.reality_offtake_count, 0)) AS CHAR) AS reality_offtake_count
+               CAST(SUM(IFNULL(a.reality_offtake_count, 0)) AS CHAR)  AS reality_offtake_count
         FROM onest_system.sys_dept d
         FROM onest_system.sys_dept d
                  LEFT JOIN onest_data.centerdata_t_farm_filings_livestock a
                  LEFT JOIN onest_data.centerdata_t_farm_filings_livestock a
                            ON a.dept_id = d.dept_id
                            ON a.dept_id = d.dept_id
-        WHERE
-            FIND_IN_SET(369
-                   , CONCAT(d.ancestors
-                   , ','
-                   , d.dept_id))
-                  OR
-            FIND_IN_SET(370
-                   , CONCAT(d.ancestors
-                   , ','
-                   , d.dept_id))
-                  OR
-            FIND_IN_SET(371
-                   , CONCAT(d.ancestors
-                   , ','
-                   , d.dept_id))
-                  OR
-            FIND_IN_SET(372
-                   , CONCAT(d.ancestors
-                   , ','
-                   , d.dept_id))
-                  OR
-            FIND_IN_SET(373
-                   , CONCAT(d.ancestors
-                   , ','
-                   , d.dept_id))
+        WHERE FIND_IN_SET(369, CONCAT(d.ancestors, ',', d.dept_id))
+           OR FIND_IN_SET(370, CONCAT(d.ancestors, ',', d.dept_id))
+           OR FIND_IN_SET(371, CONCAT(d.ancestors, ',', d.dept_id))
+           OR FIND_IN_SET(372, CONCAT(d.ancestors, ',', d.dept_id))
+           OR FIND_IN_SET(373, CONCAT(d.ancestors, ',', d.dept_id))
         UNION ALL
         UNION ALL
-        SELECT '双辽市 ' dept_name,
-               SUM(IFNULL(a.design_maintain_count, 0))  design_maintain_count,
-               SUM(IFNULL(a.design_offtake_count, 0))   design_offtake_count,
-               SUM(IFNULL(a.reality_maintain_count, 0)) reality_maintain_count,
-               SUM(IFNULL(a.reality_offtake_count, 0))  reality_offtake_count
+        SELECT d.dept_name,
+               FORMAT(SUM(
+                              IFNULL(a.design_maintain_count, 0)), 0)  design_maintain_count,
+               FORMAT(SUM(
+                              IFNULL(a.design_offtake_count, 0)), 0)   design_offtake_count,
+               FORMAT(SUM(
+                              IFNULL(a.reality_maintain_count, 0)), 0) reality_maintain_count,
+               FORMAT(SUM(
+                              IFNULL(a.reality_offtake_count, 0)), 0)  reality_offtake_count
         FROM onest_system.sys_dept d
         FROM onest_system.sys_dept d
-                 LEFT JOIN onest_data.centerdata_t_farm_filings_livestock a
-                           ON a.dept_id = d.dept_id
-        WHERE FIND_IN_SET(369
-                  , CONCAT(d.ancestors
-                              , ','
-                              , d.dept_id))
-        UNION ALL
-        SELECT '伊通县 ' dept_name,
-               SUM(IFNULL(a.design_maintain_count, 0))  design_maintain_count,
-               SUM(IFNULL(a.design_offtake_count, 0))   design_offtake_count,
-               SUM(IFNULL(a.reality_maintain_count, 0)) reality_maintain_count,
-               SUM(IFNULL(a.reality_offtake_count, 0))  reality_offtake_count
-        FROM onest_system.sys_dept d
-                 LEFT JOIN onest_data.centerdata_t_farm_filings_livestock a
-                           ON a.dept_id = d.dept_id
-        WHERE FIND_IN_SET(370
-                  , CONCAT(d.ancestors
-                              , ','
-                              , d.dept_id))
-        UNION ALL
-        SELECT '梨树县 ' dept_name,
-               SUM(IFNULL(a.design_maintain_count, 0))  design_maintain_count,
-               SUM(IFNULL(a.design_offtake_count, 0))   design_offtake_count,
-               SUM(IFNULL(a.reality_maintain_count, 0)) reality_maintain_count,
-               SUM(IFNULL(a.reality_offtake_count, 0))  reality_offtake_count
-        FROM onest_system.sys_dept d
-                 LEFT JOIN onest_data.centerdata_t_farm_filings_livestock a
-                           ON a.dept_id = d.dept_id
-        WHERE FIND_IN_SET(371
-                  , CONCAT(d.ancestors
-                              , ','
-                              , d.dept_id))
-        UNION ALL
-        SELECT '铁东区 ' dept_name,
-               SUM(IFNULL(a.design_maintain_count, 0))  design_maintain_count,
-               SUM(IFNULL(a.design_offtake_count, 0))   design_offtake_count,
-               SUM(IFNULL(a.reality_maintain_count, 0)) reality_maintain_count,
-               SUM(IFNULL(a.reality_offtake_count, 0))  reality_offtake_count
-        FROM onest_system.sys_dept d
-                 LEFT JOIN onest_data.centerdata_t_farm_filings_livestock a
-                           ON a.dept_id = d.dept_id
-        WHERE FIND_IN_SET(372
-                  , CONCAT(d.ancestors
-                              , ','
-                              , d.dept_id))
-        UNION ALL
-        SELECT '铁西区 ' dept_name,
-               SUM(IFNULL(a.design_maintain_count, 0))  design_maintain_count,
-               SUM(IFNULL(a.design_offtake_count, 0))   design_offtake_count,
-               SUM(IFNULL(a.reality_maintain_count, 0)) reality_maintain_count,
-               SUM(IFNULL(a.reality_offtake_count, 0))  reality_offtake_count
-        FROM onest_system.sys_dept d
-                 LEFT JOIN onest_data.centerdata_t_farm_filings_livestock a
-                           ON a.dept_id = d.dept_id
-        WHERE FIND_IN_SET(373
-                  , CONCAT(d.ancestors
-                              , ','
-                              , d.dept_id))
-
+                 LEFT JOIN onest_data.centerdata_t_farm_filings_livestock a ON a.dept_id = d.dept_id
+        WHERE FIND_IN_SET(
+                d.dept_id,
+                CONCAT(d.ancestors, ',', d.dept_id))
+          AND d.dept_id IN (371, 372, 373, 370, 369)
+        GROUP BY d.dept_name;
     </select>
     </select>
 
 
 
 

+ 21 - 91
src/main/resources/mapper/digitalagriculture/CenterdataTFarmLivestockInfoMapper.xml

@@ -19,103 +19,33 @@
             resultType="CenterdataTFarmLivestockInfoCountVo"
             resultType="CenterdataTFarmLivestockInfoCountVo"
             resultMap="CenterdataTFarmLivestockInfoCountVoResult">
             resultMap="CenterdataTFarmLivestockInfoCountVoResult">
         SELECT '合计 ' dept_name,
         SELECT '合计 ' dept_name,
-               CAST(SUM(IFNULL(a.design_maintain_count, 0)) AS CHAR) AS design_maintain_count,
-               CAST(SUM(IFNULL(a.design_offtake_count, 0)) AS CHAR) AS design_offtake_count,
-               CAST(SUM(IFNULL(a.reality_maintain_count, 0)) AS CHAR) AS reality_maintain_count,
-               CAST(SUM(IFNULL(a.reality_offtake_count, 0)) AS CHAR) AS reality_offtake_count
+               FORMAT(SUM(IFNULL(a.design_maintain_count, 0)),0)  AS design_maintain_count,
+               FORMAT(SUM(IFNULL(a.design_offtake_count, 0)) ,0)   AS design_offtake_count,
+               FORMAT(SUM(IFNULL(a.reality_maintain_count, 0)) ,0) AS reality_maintain_count,
+               FORMAT(SUM(IFNULL(a.reality_offtake_count, 0)) ,0)  AS reality_offtake_count
         FROM onest_system.sys_dept d
         FROM onest_system.sys_dept d
                  LEFT JOIN onest_data.centerdata_t_farm_livestock a
                  LEFT JOIN onest_data.centerdata_t_farm_livestock a
                            ON a.dept_id = d.dept_id
                            ON a.dept_id = d.dept_id
-        WHERE
-            FIND_IN_SET(369
-                , CONCAT(d.ancestors
-                            , ','
-                            , d.dept_id))
-           OR
-            FIND_IN_SET(370
-                , CONCAT(d.ancestors
-                            , ','
-                            , d.dept_id))
-           OR
-            FIND_IN_SET(371
-                , CONCAT(d.ancestors
-                            , ','
-                            , d.dept_id))
-           OR
-            FIND_IN_SET(372
-                , CONCAT(d.ancestors
-                            , ','
-                            , d.dept_id))
-           OR
-            FIND_IN_SET(373
-                , CONCAT(d.ancestors
-                            , ','
-                            , d.dept_id))
+        WHERE FIND_IN_SET(369, CONCAT(d.ancestors, ',', d.dept_id))
+           OR FIND_IN_SET(370, CONCAT(d.ancestors, ',', d.dept_id))
+           OR FIND_IN_SET(371, CONCAT(d.ancestors, ',', d.dept_id))
+           OR FIND_IN_SET(372, CONCAT(d.ancestors, ',', d.dept_id))
+           OR FIND_IN_SET(373, CONCAT(d.ancestors, ',', d.dept_id))
         UNION ALL
         UNION ALL
-        SELECT '双辽市 ' dept_name,
-               SUM(IFNULL(a.design_maintain_count, 0))  design_maintain_count,
-               SUM(IFNULL(a.design_offtake_count, 0))   design_offtake_count,
-               SUM(IFNULL(a.reality_maintain_count, 0)) reality_maintain_count,
-               SUM(IFNULL(a.reality_offtake_count, 0))  reality_offtake_count
+        SELECT d.dept_name,
+               FORMAT(SUM(
+                              IFNULL(a.design_maintain_count, 0)), 0)  design_maintain_count,
+               FORMAT(SUM(
+                              IFNULL(a.design_offtake_count, 0)), 0)   design_offtake_count,
+               FORMAT(SUM(
+                              IFNULL(a.reality_maintain_count, 0)), 0) reality_maintain_count,
+               FORMAT(SUM(
+                              IFNULL(a.reality_offtake_count, 0)), 0)  reality_offtake_count
         FROM onest_system.sys_dept d
         FROM onest_system.sys_dept d
                  LEFT JOIN onest_data.centerdata_t_farm_livestock a
                  LEFT JOIN onest_data.centerdata_t_farm_livestock a
                            ON a.dept_id = d.dept_id
                            ON a.dept_id = d.dept_id
-        WHERE FIND_IN_SET(369
-                  , CONCAT(d.ancestors
-                              , ','
-                              , d.dept_id))
-        UNION ALL
-        SELECT '伊通县 ' dept_name,
-               SUM(IFNULL(a.design_maintain_count, 0))  design_maintain_count,
-               SUM(IFNULL(a.design_offtake_count, 0))   design_offtake_count,
-               SUM(IFNULL(a.reality_maintain_count, 0)) reality_maintain_count,
-               SUM(IFNULL(a.reality_offtake_count, 0))  reality_offtake_count
-        FROM onest_system.sys_dept d
-                 LEFT JOIN onest_data.centerdata_t_farm_livestock a
-                           ON a.dept_id = d.dept_id
-        WHERE FIND_IN_SET(370
-                  , CONCAT(d.ancestors
-                              , ','
-                              , d.dept_id))
-        UNION ALL
-        SELECT '梨树县 ' dept_name,
-               SUM(IFNULL(a.design_maintain_count, 0))  design_maintain_count,
-               SUM(IFNULL(a.design_offtake_count, 0))   design_offtake_count,
-               SUM(IFNULL(a.reality_maintain_count, 0)) reality_maintain_count,
-               SUM(IFNULL(a.reality_offtake_count, 0))  reality_offtake_count
-        FROM onest_system.sys_dept d
-                 LEFT JOIN onest_data.centerdata_t_farm_livestock a
-                           ON a.dept_id = d.dept_id
-        WHERE FIND_IN_SET(371
-                  , CONCAT(d.ancestors
-                              , ','
-                              , d.dept_id))
-        UNION ALL
-        SELECT '铁东区 ' dept_name,
-               SUM(IFNULL(a.design_maintain_count, 0))  design_maintain_count,
-               SUM(IFNULL(a.design_offtake_count, 0))   design_offtake_count,
-               SUM(IFNULL(a.reality_maintain_count, 0)) reality_maintain_count,
-               SUM(IFNULL(a.reality_offtake_count, 0))  reality_offtake_count
-        FROM onest_system.sys_dept d
-                 LEFT JOIN onest_data.centerdata_t_farm_livestock a
-                           ON a.dept_id = d.dept_id
-        WHERE FIND_IN_SET(372
-                  , CONCAT(d.ancestors
-                              , ','
-                              , d.dept_id))
-        UNION ALL
-        SELECT '铁西区 ' dept_name,
-               SUM(IFNULL(a.design_maintain_count, 0))  design_maintain_count,
-               SUM(IFNULL(a.design_offtake_count, 0))   design_offtake_count,
-               SUM(IFNULL(a.reality_maintain_count, 0)) reality_maintain_count,
-               SUM(IFNULL(a.reality_offtake_count, 0))  reality_offtake_count
-        FROM onest_system.sys_dept d
-                 LEFT JOIN onest_data.centerdata_t_farm_livestock a
-                           ON a.dept_id = d.dept_id
-        WHERE FIND_IN_SET(373
-                  , CONCAT(d.ancestors
-                              , ','
-                              , d.dept_id))
-
+        WHERE FIND_IN_SET(d.dept_id, CONCAT(d.ancestors, ',', d.dept_id))
+          AND d.dept_id IN (371, 372, 373, 370, 369)
+        GROUP BY d.dept_name;
     </select>
     </select>
 </mapper>
 </mapper>