<?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.yifu.social.mapper.TDispatchExportLogMapper">

  <resultMap id="tDispatchExportLogMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchExportLog">
    <id property="id" column="ID"/>
    <result property="dispatchId" column="DISPATCH_ID"/>
    <result property="userId" column="USER_ID"/>
    <result property="userName" column="USER_NAME"/>
    <result property="createTime" column="CREATE_TIME"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.DISPATCH_ID,
                a.USER_ID,
                a.USER_NAME,
                a.CREATE_TIME
    </sql>
    <sql id="tDispatchExportLog_where">
        <if test="tDispatchExportLog != null">
                    <if test="tDispatchExportLog.id != null and tDispatchExportLog.id.trim() != ''">
                        AND a.ID = #{tDispatchExportLog.id}
                    </if>
                    <if test="tDispatchExportLog.dispatchId != null and tDispatchExportLog.dispatchId.trim() != ''">
                        AND a.DISPATCH_ID = #{tDispatchExportLog.dispatchId}
                    </if>
                    <if test="tDispatchExportLog.userId != null and tDispatchExportLog.userId.trim() != ''">
                        AND a.USER_ID = #{tDispatchExportLog.userId}
                    </if>
                    <if test="tDispatchExportLog.userName != null and tDispatchExportLog.userName.trim() != ''">
                        AND a.USER_NAME = #{tDispatchExportLog.userName}
                    </if>
                    <if test="tDispatchExportLog.createTime != null">
                        AND a.CREATE_TIME = #{tDispatchExportLog.createTime}
                    </if>
        </if>
    </sql>
    <!--tDispatchExportLog简单分页查询-->
    <select id="getTDispatchExportLogPage" resultMap="tDispatchExportLogMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_dispatch_export_log a
        <where>
            1=1
            <include refid="tDispatchExportLog_where"/>
        </where>
		order by a.CREATE_TIME desc
    </select>
</mapper>
