select id, record_id, user_name, terminal_ip, mac_addr, channel_name, device_name, operate_name, operate_type,
operate_result, service_code, service_name, response_time, detail, behavior, operate_time, channel_code, device_ip, create_time,
dept_id,parent_id,ancestors,dept_name
from centernonitor_t_dahua_operate_log
insert into centernonitor_t_dahua_operate_log
user_name,terminal_ip,mac_addr,channel_name,device_name,operate_name,operate_type,operate_result,service_code,service_name,response_time,detail,behavior,operate_time,channel_code,device_ip,create_time,#{userName},#{terminalIp},#{macAddr},#{channelName},#{deviceName},#{operateName},#{operateType},#{operateResult},#{serviceCode},#{serviceName},#{responseTime},#{detail},#{behavior},#{operateTime},#{channelCode},#{deviceIp},#{createTime},
update centernonitor_t_dahua_operate_log
user_name = #{userName},terminal_ip = #{terminalIp},mac_addr = #{macAddr},channel_name = #{channelName},device_name = #{deviceName},operate_name = #{operateName},operate_type = #{operateType},operate_result = #{operateResult},service_code = #{serviceCode},service_name = #{serviceName},response_time = #{responseTime},detail = #{detail},behavior = #{behavior},operate_time = #{operateTime},channel_code = #{channelCode},device_ip = #{deviceIp},create_time = #{createTime},
where id = #{id}
delete from centernonitor_t_dahua_operate_log where id = #{id}
delete from centernonitor_t_dahua_operate_log where id in
#{id}
insert ignore into centernonitor_t_dahua_operate_log (id,record_id,user_name,terminal_ip,mac_addr,channel_name,device_name,
operate_name,operate_type,operate_result,service_code,service_name,response_time,detail,behavior,operate_time,device_ip,channel_code,
dept_id,parent_id,ancestors,dept_name) values
(#{item.id},#{item.recordId},#{item.userName},#{item.terminalIp},#{item.macAddr},#{item.channelName},#{item.deviceName},#{item.operateName},
#{item.operateType},#{item.operateResult},#{item.serviceCode},#{item.serviceName},#{item.responseTime},#{item.detail},#{item.behavior},#{item.operateTime},#{item.deviceIp},#{item.channelCode}
,#{item.deptId},#{item.parentId},#{item.ancestors},#{item.deptName})
delete from centernonitor_t_dahua_operate_log where operate_time between #{startTime} and #{endTime} and operate_type = #{operateTypeValue}
UPDATE centernonitor_t_dahua_operate_log_${year} AS log
LEFT JOIN ${database_system}.sys_user AS su ON log.user_name = su.user_name
LEFT JOIN ${database_system}.sys_user_dept AS ud ON ud.user_id = su.user_id
LEFT JOIN ${database_system}.sys_dept AS dept ON ud.dept_id = dept.dept_id
SET log.dept_id = dept.dept_id,
log.parent_id = dept.parent_id,
log.ancestors = dept.ancestors,
log.dept_name = dept.dept_name
where su.del_flag = 0 and dept.del_flag = 0 and log.id in
#{ids}