McOperationLogMapper.xml 4.78 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.chinagas.modules.schsf.mapper.McOperationLogMapper">

    <resultMap type="com.chinagas.modules.schsf.domain.McOperationLog" id="McOperationLogResult">
        <result property="id"    column="id"    />
        <result property="dataForm"    column="data_form"    />
        <result property="dataId"    column="data_id"    />
        <result property="procRole"    column="proc_role"    />
        <result property="procUser"    column="proc_user"    />
        <result property="procTime"    column="proc_time"    />
        <result property="procAccount"    column="proc_account"    />
        <result property="opName"    column="op_name"    />
        <result property="opType"    column="op_type"    />
        <result property="opRemark"    column="op_remark"    />
        <result property="beforeDataJson"    column="before_data_json"    />
        <result property="afterDataJson"    column="after_data_json"    />
        <result property="procId"    column="proc_id"    />
    </resultMap>

    <sql id="selectMcOperationLogVo">
        select id,
               data_form,
               data_id,
               proc_role,
               proc_user,
               proc_time,
               proc_account,
               op_name,
               op_type,
               op_remark,
               before_data_json,
               after_data_json,
                proc_id
        from mc_operation_log
    </sql>

    <select id="selectMcOperationLogList" parameterType="com.chinagas.modules.schsf.domain.McOperationLog" resultMap="McOperationLogResult">
        <include refid="selectMcOperationLogVo"/>
        <where>
            <if test="dataForm != null  and dataForm != ''"> and data_form = #{dataForm}</if>
            <if test="dataId != null "> and data_id = #{dataId}</if>
            <if test="procRole != null  and procRole != ''"> and proc_role = #{procRole}</if>
            <if test="procUser != null  and procUser != ''"> and proc_user = #{procUser}</if>
            <if test="procTime != null "> and proc_time = #{procTime}</if>
            <if test="procAccount != null  and procAccount != ''"> and proc_account = #{procAccount}</if>
            <if test="opName != null  and opName != ''"> and op_name like concat('%', #{opName}, '%')</if>
            <if test="opType != null  and opType != ''"> and op_type = #{opType}</if>
            <if test="opRemark != null  and opRemark != ''"> and op_remark = #{opRemark}</if>
            <if test="beforeDataJson != null  and beforeDataJson != ''"> and before_data_json = #{beforeDataJson}</if>
            <if test="afterDataJson != null  and afterDataJson != ''"> and after_data_json = #{afterDataJson}</if>
            <if test="procId != null  and procId != ''"> and proc_id = #{procId}</if>
        </where>
    </select>

    <insert id="insertMcOperationLog" parameterType="com.chinagas.modules.schsf.domain.McOperationLog">
        insert into mc_operation_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="dataForm != null and dataForm != ''">data_form,</if>
            <if test="dataId != null">data_id,</if>
            <if test="procRole != null">proc_role,</if>
            <if test="procUser != null and procUser != ''">proc_user,</if>
            <if test="procTime != null">proc_time,</if>
            <if test="procAccount != null and procAccount != ''">proc_account,</if>
            <if test="opName != null">op_name,</if>
            <if test="opType != null">op_type,</if>
            <if test="opRemark != null">op_remark,</if>
            <if test="beforeDataJson != null">before_data_json,</if>
            <if test="afterDataJson != null">after_data_json,</if>
            <if test="procId != null">proc_id,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="dataForm != null and dataForm != ''">#{dataForm},</if>
            <if test="dataId != null">#{dataId},</if>
            <if test="procRole != null">#{procRole},</if>
            <if test="procUser != null and procUser != ''">#{procUser},</if>
            <if test="procTime != null">#{procTime},</if>
            <if test="procAccount != null and procAccount != ''">#{procAccount},</if>
            <if test="opName != null">#{opName},</if>
            <if test="opType != null">#{opType},</if>
            <if test="opRemark != null">#{opRemark},</if>
            <if test="beforeDataJson != null">#{beforeDataJson},</if>
            <if test="afterDataJson != null">#{afterDataJson},</if>
            <if test="procId != null">#{procId},</if>
         </trim>
    </insert>


</mapper>