Browse Source

物品统计

wangyangyang 4 years ago
parent
commit
ec12b68c42

+ 1 - 1
sms_water/src/main/java/com/huaxu/controller/ThingSettingController.java

@@ -82,7 +82,7 @@ public class ThingSettingController{
     @RequestMapping(value = "/findTotalList",method = RequestMethod.GET)
     @ResponseBody
     @ApiOperation(value = "查询物品统计汇总信息")
-    public AjaxMessage<List<ThingSettingEntity>> findTotalList(@ApiParam(value = "物品类型(1管网 2窨井 3阀门 4消防栓)", required = true) @RequestParam Integer thingType) {
+    public AjaxMessage<List<ThingSettingEntity>> findTotalList(@ApiParam(value = "物品类型(1管网 2窨井 3阀门 4消防栓)", required = false) @RequestParam(required = false) Integer thingType) {
         ThingSettingEntity thingSettingEntity = new ThingSettingEntity();
         thingSettingEntity.setThingType(thingType);
         List<ThingSettingEntity> thingSettingEntities = thingSettingService.findTotalList(thingSettingEntity);

+ 2 - 1
sms_water/src/main/resources/mapper/ThingSettingMapper.xml

@@ -94,7 +94,7 @@
     <!--  根据获取实体List   -->
     <select id="findTotalList" resultType="com.huaxu.entity.ThingSettingEntity">
         SELECT
-        sum(a.thing_length) as "thingLength" , sum(a.thing_count) as "thingCount"
+        a.thing_type as "thingType",sum(a.thing_length) as "thingLength" , sum(a.thing_count) as "thingCount"
         FROM sms_thing_setting a
         <where>
             a.status=1
@@ -129,6 +129,7 @@
                 </if>
             </if>
         </where>
+        group by a.thing_type
     </select>
     <!--  根据获取实体 page   -->
     <select id="findPage" resultType="com.huaxu.entity.ThingSettingEntity">