<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~
  ~      Copyright (c) 2018-2025, lengleng All rights reserved.
  ~
  ~  Redistribution and use in source and binary forms, with or without
  ~  modification, are permitted provided that the following conditions are met:
  ~
  ~ Redistributions of source code must retain the above copyright notice,
  ~  this list of conditions and the following disclaimer.
  ~  Redistributions in binary form must reproduce the above copyright
  ~  notice, this list of conditions and the following disclaimer in the
  ~  documentation and/or other materials provided with the distribution.
  ~  Neither the name of the yifu4cloud.com developer nor the names of its
  ~  contributors may be used to endorse or promote products derived from
  ~  this software without specific prior written permission.
  ~  Author: lengleng (wangiegie@gmail.com)
  ~
  -->

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.yifu.cloud.plus.v1.csp.mapper.TOperationLogMapper">

  <resultMap id="tOperationLogMap" type="com.yifu.cloud.plus.v1.csp.entity.TOperationLog">
    <id property="id" column="ID"/>
    <result property="mainId" column="MAIN_ID"/>
    <result property="type" column="TYPE"/>
    <result property="title" column="TITLE"/>
    <result property="operationTime" column="OPERATION_TIME"/>
    <result property="operationName" column="OPERATION_NAME"/>
    <result property="createTime" column="CREATE_TIME"/>
    <result property="createBy" column="CREATE_BY"/>
    <result property="createName" column="CREATE_NAME"/>
    <result property="remark" column="REMARK"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.MAIN_ID,
                a.TYPE,
                a.TITLE,
                a.OPERATION_TIME,
                a.OPERATION_NAME,
                a.CREATE_TIME,
                a.CREATE_BY,
                a.CREATE_NAME,
                a.REMARK
    </sql>
    <sql id="tOperationLog_where">
        <if test="tOperationLog != null">
                    <if test="tOperationLog.id != null and tOperationLog.id.trim() != ''">
                        AND a.ID = #{tOperationLog.id}
                    </if>
                    <if test="tOperationLog.mainId != null and tOperationLog.mainId.trim() != ''">
                        AND a.MAIN_ID = #{tOperationLog.mainId}
                    </if>
                    <if test="tOperationLog.type != null and tOperationLog.type.trim() != ''">
                        AND a.TYPE = #{tOperationLog.type}
                    </if>
                    <if test="tOperationLog.title != null and tOperationLog.title.trim() != ''">
                        AND a.TITLE = #{tOperationLog.title}
                    </if>
                    <if test="tOperationLog.operationTime != null">
                        AND a.OPERATION_TIME = #{tOperationLog.operationTime}
                    </if>
                    <if test="tOperationLog.operationName != null and tOperationLog.operationName.trim() != ''">
                        AND a.OPERATION_NAME = #{tOperationLog.operationName}
                    </if>
                    <if test="tOperationLog.createTime != null">
                        AND a.CREATE_TIME = #{tOperationLog.createTime}
                    </if>
                    <if test="tOperationLog.createBy != null and tOperationLog.createBy.trim() != ''">
                        AND a.CREATE_BY = #{tOperationLog.createBy}
                    </if>
                    <if test="tOperationLog.createName != null and tOperationLog.createName.trim() != ''">
                        AND a.CREATE_NAME = #{tOperationLog.createName}
                    </if>
        </if>
    </sql>
    <!--tOperationLog简单分页查询-->
    <select id="getTOperationLogPage" resultMap="tOperationLogMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_operation_log a
        <where>
            1=1
            <include refid="tOperationLog_where"/>
        </where>
    </select>
</mapper>
