查询设备下卡框

This commit is contained in:
liux 2025-06-25 13:44:39 +08:00
parent 4169cf7d3a
commit e88eb48edc
3 changed files with 32 additions and 11 deletions

View File

@ -1,8 +1,10 @@
package com.bonus.canteen.core;
import com.bonus.canteen.core.video.utils.HkCameraUtil;
import com.bonus.common.security.annotation.EnableCustomConfig;
import com.bonus.common.security.annotation.EnableRyFeignClients;
import com.bonus.common.swagger.annotation.EnableCustomSwagger2;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@ -10,7 +12,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 系统模块
*
*
* @author bonus
*/
@EnableCustomConfig
@ -18,7 +20,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
@EnableRyFeignClients
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class BonusSmartCanteenApplication
public class BonusSmartCanteenApplication implements CommandLineRunner
{
public static void main(String[] args)
{
@ -34,4 +36,16 @@ public class BonusSmartCanteenApplication
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
@Override
public void run(String... args) {
HkCameraUtil util = new HkCameraUtil();
int row = util.initDevice();
if (row == 1) {
System.out.println("初始化失败!!!!!!");
}else{
System.out.println("初始化成功......");
}
}
}

View File

@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="deviceExtendInfo" column="device_extend_info" />
<result property="delFlag" column="del_flag" />
<result property="areaName" column="areaName" />
<result property="subPlaceName" column="sub_place_name" />
<result property="canteenName" column="canteenName" />
</resultMap>
@ -39,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="deviceNetworkState" column="device_network_state" />
<result property="deviceRepairPeriod" column="device_repair_period" />
<result property="deviceExtendInfo" column="device_extend_info" />
<result property="subPlaceName" column="sub_place_name" />
<result property="delFlag" column="del_flag" />
</resultMap>
@ -46,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
device_id,
device_no,
canteen_id,
kit.canteen_id,
area_id,
device_pwd,
device_type,
@ -55,19 +57,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
device_name,
device_sn,
sub_place,
ksp.sub_place_name,
device_network_state,
device_repair_period,
device_extend_info,
del_flag,
create_by,
create_time,
update_by,
update_time,
kit.create_by,
kit.create_time,
kit.update_by,
kit.update_time,
vac.vAreaName as areaName,
vac.vCanteenName as canteenName
FROM
kitchen_device_info kit
LEFT JOIN v_area_canteen vac on vac.vAreaId = kit.area_id and vac.vCanteenId = kit.canteen_id
LEFT JOIN kitchen_sub_place ksp on ksp.sub_place_id = kit.sub_place
</sql>
@ -84,6 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</if>
<if test="deviceNetworkState != null "> and device_network_state = #{deviceNetworkState}</if>
<if test="deviceType !=0">
and device_type = #{deviceType}
</if>
</where>
</select>

View File

@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getEmployeeViolationCount" resultType="com.bonus.canteen.core.kitchen.vo.IndexMapCountVO">
select alarm_type as `name`,count(illegal_warning_id) as `count` from kitchen_staff_illegal_warning
where illegal_warning_type =#{warningType}
where illegal_warning_type =#{warningType} and DATE(create_time) = CURRENT_DATE()
GROUP BY alarm_type
</select>
@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ELSE '离线'
end as 'name'
,COUNT(device_id) as count from kitchen_device_info
where del_flag = '0' and update_time between #{startTime} and #{endTime}
where del_flag = '0' and update_time between concat(#{startTime},' 00:00:00') and concat(#{endTime},' 23:59:59')
GROUP BY device_network_state
</select>
@ -33,13 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ELSE '不合格'
end as 'name'
,COUNT(record_id) as count from kitchen_sample_dishes_record
where create_time between #{startTime} and #{endTime}
where create_time between concat(#{startTime},' 00:00:00') and concat(#{endTime},' 23:59:59')
GROUP BY `name`
</select>
<select id="getCountNum" resultType="int">
SELECT COUNT(record_id) FROM kitchen_device_sensor_record
WHERE device_type = #{beans.deviceType} AND measure_metric_id = #{beans.measureId}
WHERE device_type = #{beans.deviceType} AND measure_code = #{beans.measureCode}
<if test="type == 'max'">
and #{beans.measureMaxValue} > measure_data
</if>