<?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.salary.mapper.TSalaryLockMapper">

  <resultMap id="tSalaryLockMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryLock">
    <id property="id" column="id"/>
    <result property="deptId" column="dept_id"/>
    <result property="deptName" column="dept_name"/>
    <result property="type" column="type"/>
    <result property="settleMonth" column="settle_month"/>
    <result property="settleMoney" column="settle_money"/>
    <result property="salaryId" column="salary_id"/>
    <result property="deleteFlag" column="delete_flag"/>
	  <result property="createBy" column="CREATE_BY"/>
	  <result property="createName" column="CREATE_NAME"/>
	  <result property="createTime" column="CREATE_TIME"/>
	  <result property="updateBy" column="UPDATE_BY"/>
	  <result property="updateTime" column="UPDATE_TIME"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.id,
                a.dept_id,
                a.dept_name,
                a.type,
                a.settle_month,
                a.settle_money,
                a.salary_id,
                a.delete_flag,
				a.CREATE_BY,
				a.CREATE_NAME,
				a.CREATE_TIME,
				a.UPDATE_BY,
				a.UPDATE_TIME
    </sql>
    <sql id="tSalaryLock_where">
        <if test="tSalaryLock != null">
                    <if test="tSalaryLock.id != null and tSalaryLock.id.trim() != ''">
                        AND a.id = #{tSalaryLock.id}
                    </if>
                    <if test="tSalaryLock.deptId != null and tSalaryLock.deptId.trim() != ''">
                        AND a.dept_id = #{tSalaryLock.deptId}
                    </if>
                    <if test="tSalaryLock.deptName != null and tSalaryLock.deptName.trim() != ''">
                        AND a.dept_name = #{tSalaryLock.deptName}
                    </if>
                    <if test="tSalaryLock.type != null">
                        AND a.type = #{tSalaryLock.type}
                    </if>
                    <if test="tSalaryLock.settleMonth != null and tSalaryLock.settleMonth.trim() != ''">
                        AND a.settle_month = #{tSalaryLock.settleMonth}
                    </if>
                    <if test="tSalaryLock.settleMoney != null">
                        AND a.settle_money = #{tSalaryLock.settleMoney}
                    </if>
                    <if test="tSalaryLock.salaryId != null and tSalaryLock.salaryId.trim() != ''">
                        AND a.salary_id = #{tSalaryLock.salaryId}
                    </if>
                    <if test="tSalaryLock.deleteFlag != null">
                        AND a.delete_flag = #{tSalaryLock.deleteFlag}
                    </if>
        </if>
    </sql>
    <!--tSalaryLock简单分页查询-->
    <select id="getTSalaryLockPage" resultMap="tSalaryLockMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_salary_lock a
        <where>
            1=1
            <include refid="tSalaryLock_where"/>
        </where>
    </select>
</mapper>