mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
refactor(多数据源): 报错与关键字修改
This commit is contained in:
@@ -16,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="serialNumber" column="serial_number" />
|
||||
<result property="identity" column="identity" />
|
||||
<result property="identity" column="identify" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="isMonitor" column="is_monitor" />
|
||||
<result property="mode" column="mode" />
|
||||
@@ -31,18 +31,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<resultMap type="com.fastbee.iot.model.HistoryModel" id="HistoryResult">
|
||||
<result property="value" column="log_value" />
|
||||
<result property="time" column="create_time" />
|
||||
<result property="identity" column="identity" />
|
||||
<result property="identity" column="identify" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeviceLogVo">
|
||||
select log_id, log_type, log_value, device_id, device_name,serial_number, identity, create_by, is_monitor,mode, user_id, user_name, tenant_id, tenant_name, create_time, remark from iot_device_log
|
||||
select log_id, log_type, log_value, device_id, device_name,serial_number, identify, create_by, is_monitor,mode, user_id, user_name, tenant_id, tenant_name, create_time, remark from iot_device_log
|
||||
</sql>
|
||||
|
||||
<select id="selectMonitorList" parameterType="com.fastbee.iot.domain.DeviceLog" resultMap="MonitorResult">
|
||||
select log_value, create_time from iot_device_log
|
||||
<where>
|
||||
<if test="1==1"> and is_monitor=1</if>
|
||||
<if test="identity != null and identity != ''"> and identity = #{identity}</if>
|
||||
<if test="identity != null and identity != ''"> and identify = #{identity}</if>
|
||||
<if test="deviceId != null and deviceId !=0"> and device_id = #{deviceId}</if>
|
||||
<if test="serialNumber != null and serialNumber !=''"> and serial_number = #{serialNumber}</if>
|
||||
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> and create_time between #{beginTime} and #{endTime}</if>
|
||||
@@ -96,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
|
||||
<insert id="saveBatch" parameterType="com.fastbee.iot.domain.DeviceLog">
|
||||
insert into iot_device_log (log_type,log_value,device_id,device_name,serial_number,identity,create_by,
|
||||
insert into iot_device_log (log_type,log_value,device_id,device_name,serial_number,identify,create_by,
|
||||
is_monitor,mode,create_time,remark,user_id,user_name,tenant_id,tenant_name,model_name)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
@@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="deviceName != null and deviceName != ''">device_name = #{deviceName},</if>
|
||||
<if test="serialNumber != null and serialNumber != ''">serial_number = #{serialNumber},</if>
|
||||
<if test="identity != null">identity = #{identity},</if>
|
||||
<if test="identity != null">identify = #{identity},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="isMonitor != null">is_monitor = #{isMonitor},</if>
|
||||
<if test="mode != null">mode = #{mode},</if>
|
||||
|
||||
@@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<resultMap type="com.fastbee.iot.domain.EventLog" id="EventLogResult">
|
||||
<result property="logId" column="log_id" />
|
||||
<result property="identity" column="identity" />
|
||||
<result property="identity" column="identify" />
|
||||
<result property="modelName" column="model_name" />
|
||||
<result property="logType" column="log_type" />
|
||||
<result property="logValue" column="log_value" />
|
||||
@@ -25,13 +25,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEventLogVo">
|
||||
select log_id, identity, model_name, log_type, log_value, device_id, device_name, serial_number, is_monitor, mode, user_id, user_name, tenant_id, tenant_name, create_by, create_time, remark from iot_event_log
|
||||
select log_id, identify, model_name, log_type, log_value, device_id, device_name, serial_number, is_monitor, mode, user_id, user_name, tenant_id, tenant_name, create_by, create_time, remark from iot_event_log
|
||||
</sql>
|
||||
|
||||
<select id="selectEventLogList" parameterType="com.fastbee.iot.domain.EventLog" resultMap="EventLogResult">
|
||||
<include refid="selectEventLogVo"/>
|
||||
<where>
|
||||
<if test="identity != null and identity != ''"> and identity = #{identity}</if>
|
||||
<if test="identity != null and identity != ''"> and identify = #{identity}</if>
|
||||
<if test="modelName != null and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
|
||||
<if test="logType != null "> and log_type = #{logType}</if>
|
||||
<if test="logValue != null and logValue != ''"> and log_value = #{logValue}</if>
|
||||
@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<insert id="insertEventLog" parameterType="com.fastbee.iot.domain.EventLog" useGeneratedKeys="true" keyProperty="logId">
|
||||
insert into iot_event_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="identity != null and identity != ''">identity,</if>
|
||||
<if test="identity != null and identity != ''">identify,</if>
|
||||
<if test="modelName != null">model_name,</if>
|
||||
<if test="logType != null">log_type,</if>
|
||||
<if test="logValue != null and logValue != ''">log_value,</if>
|
||||
@@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" parameterType="com.fastbee.iot.domain.EventLog">
|
||||
insert into iot_event_log (identity,model_name,log_type,log_value,device_id,device_name,serial_number,is_monitor,mode,user_id,
|
||||
insert into iot_event_log (identify,model_name,log_type,log_value,device_id,device_name,serial_number,is_monitor,mode,user_id,
|
||||
user_name,tenant_id,tenant_name,create_by,create_time,remark)
|
||||
values
|
||||
<foreach collection="list" separator="," index="index" item="item">
|
||||
@@ -112,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<update id="updateEventLog" parameterType="com.fastbee.iot.domain.EventLog">
|
||||
update iot_event_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="identity != null and identity != ''">identity = #{identity},</if>
|
||||
<if test="identity != null and identity != ''">identify = #{identity},</if>
|
||||
<if test="modelName != null">model_name = #{modelName},</if>
|
||||
<if test="logType != null">log_type = #{logType},</if>
|
||||
<if test="logValue != null and logValue != ''">log_value = #{logValue},</if>
|
||||
|
||||
@@ -21,17 +21,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="status" column="status" />
|
||||
<result property="errorMsg" column="error_msg" />
|
||||
<result property="operTime" column="oper_time" />
|
||||
<result property="costTime" column="cost_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOperLogVo">
|
||||
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time
|
||||
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time
|
||||
from sys_oper_log
|
||||
</sql>
|
||||
|
||||
<insert id="insertOperlog" parameterType="SysOperLog">
|
||||
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time)
|
||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
|
||||
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
|
||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, CURRENT_TIMESTAMP)
|
||||
</insert>
|
||||
|
||||
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
||||
|
||||
Reference in New Issue
Block a user