OperateLogMapper.xml
1.4 KB
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.diligrp.website.dao.impl.OperateLogDaoImpl">
<resultMap id="operateLogInfo" type="com.diligrp.website.domain.OperateLog">
<id property="id" column="id" />
<result property="operateName" column="operator" />
<result property="operateTime" column="op_time" />
<result property="operateRemark" column="op_reason" />
</resultMap>
<insert id="INSERT-OPERATE-LOG-INFO" parameterType="operateLog">
<![CDATA[
insert into t_operation_log(op_type,data_id,operator_id,operator,op_time,op_reason,created)
values(#{operateType},#{operateDataId},#{operateId},#{operateName},sysdate(),#{operateRemark},sysdate())
]]>
</insert>
<select id="SELECT-OPERATE-LOG-INFO-BY-ID" parameterType="com.diligrp.website.domain.OperateLog"
resultMap="operateLogInfo">
select operator,op_time,op_reason from t_operation_log where data_id=#{operateDataId} and op_type=#{operateType} order by created desc
</select>
<update id="UPDATE-OPERATE-LOG-INFO-BY-ID" parameterType="operateLog">
<![CDATA[
update t_operation_log set operator_id = #{operateId},operator=#{operateName}
]]>
<if test="operateRemark != null and operateRemark != ''">
,op_reason = #{operateRemark}
</if>
<![CDATA[
where data_id=#{operateDataId}
]]>
</update>
</mapper>