<?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.archives.mapper.SysAutoDictMapper">

  <resultMap id="sysAutoDictMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.SysAutoDict">
    <id property="id" column="id"/>
    <result property="type" column="type"/>
    <result property="description" column="description"/>
    <result property="remark" column="remark"/>
    <result property="systemFlag" column="system_flag"/>
    <result property="delFlag" column="del_flag"/>
    <result property="parentItemType" column="parent_item_type"/>
    <result property="createTime" column="create_time"/>
    <result property="createBy" column="create_by"/>
    <result property="updateBy" column="update_by"/>
    <result property="updateTime" column="update_time"/>
    <result property="createName" column="create_name"/>
    <result property="clientId" column="client_id"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.id,
                a.type,
                a.description,
                a.remark,
                a.system_flag,
                a.del_flag,
                a.parent_item_type,
                a.create_time,
                a.create_by,
                a.update_by,
                a.update_time,
                a.create_name,
                a.client_id
    </sql>
    <sql id="sysAutoDict_where">
        <if test="sysAutoDict != null">
                    <if test="sysAutoDict.id != null">
                        AND a.id = #{sysAutoDict.id}
                    </if>
                    <if test="sysAutoDict.type != null and sysAutoDict.type.trim() != ''">
                        AND a.type = #{sysAutoDict.type}
                    </if>
                    <if test="sysAutoDict.description != null and sysAutoDict.description.trim() != ''">
                        AND a.description = #{sysAutoDict.description}
                    </if>
                    <if test="sysAutoDict.remark != null and sysAutoDict.remark.trim() != ''">
                        AND a.remark = #{sysAutoDict.remark}
                    </if>
                    <if test="sysAutoDict.systemFlag != null and sysAutoDict.systemFlag.trim() != ''">
                        AND a.system_flag = #{sysAutoDict.systemFlag}
                    </if>
                    <if test="sysAutoDict.delFlag != null and sysAutoDict.delFlag.trim() != ''">
                        AND a.del_flag = #{sysAutoDict.delFlag}
                    </if>
                    <if test="sysAutoDict.parentItemType != null and sysAutoDict.parentItemType.trim() != ''">
                        AND a.parent_item_type = #{sysAutoDict.parentItemType}
                    </if>
                    <if test="sysAutoDict.createTime != null">
                        AND a.create_time = #{sysAutoDict.createTime}
                    </if>
                    <if test="sysAutoDict.createBy != null and sysAutoDict.createBy.trim() != ''">
                        AND a.create_by = #{sysAutoDict.createBy}
                    </if>
                    <if test="sysAutoDict.updateBy != null and sysAutoDict.updateBy.trim() != ''">
                        AND a.update_by = #{sysAutoDict.updateBy}
                    </if>
                    <if test="sysAutoDict.updateTime != null">
                        AND a.update_time = #{sysAutoDict.updateTime}
                    </if>
                    <if test="sysAutoDict.createName != null and sysAutoDict.createName.trim() != ''">
                        AND a.create_name = #{sysAutoDict.createName}
                    </if>
                    <if test="sysAutoDict.clientId != null and sysAutoDict.clientId.trim() != ''">
                        AND a.client_id = #{sysAutoDict.clientId}
                    </if>
        </if>
    </sql>
    <!--sysAutoDict简单分页查询-->
    <select id="getSysAutoDictPage" resultMap="sysAutoDictMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM sys_auto_dict a
        <where>
            1=1
            <include refid="sysAutoDict_where"/>
        </where>
    </select>
</mapper>
