<?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.TSalaryStandardIssueMapper">

	<resultMap id="tSalaryStandardIssueMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandardIssue">
		<id property="id" column="ID"/>
		<result property="deptId" column="DEPT_ID"/>
		<result property="deptName" column="DEPT_NAME"/>
		<result property="deptNo" column="DEPT_NO"/>
		<result property="orgName" column="ORG_NAME"/>
		<result property="bankName" column="BANK_NAME"/>
		<result property="bankSubName" column="BANK_SUB_NAME"/>
		<result property="bankNo" column="BANK_NO"/>
		<result property="bankProvince" column="BANK_PROVINCE"/>
		<result property="bankCity" column="BANK_CITY"/>
		<result property="bankProvinceName" column="BANK_PROVINCE_NAME"/>
		<result property="bankCityName" column="BANK_CITY_NAME"/>
		<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>

	<resultMap id="tSalaryStandardIssueExportMap" type="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardIssueExportVo">
		<result property="deptName" column="DEPT_NAME"/>
		<result property="deptNo" column="DEPT_NO"/>
		<result property="orgName" column="ORG_NAME"/>
		<result property="bankName" column="BANK_NAME"/>
		<result property="bankSubName" column="BANK_SUB_NAME"/>
		<result property="bankNo" column="BANK_NO"/>
		<result property="bankProvinceName" column="BANK_PROVINCE_NAME"/>
		<result property="bankCityName" column="BANK_CITY_NAME"/>
	</resultMap>
	<sql id="Base_Column_List">
		a.ID,
		a.DEPT_ID,
		a.DEPT_NAME,
		a.DEPT_NO,
		a.ORG_NAME,
		a.BANK_NAME,
		a.BANK_SUB_NAME,
		a.BANK_NO,
		a.BANK_PROVINCE,
		a.BANK_PROVINCE_NAME,
		a.BANK_CITY,
		a.BANK_CITY_NAME,
		a.CREATE_BY,
		a.CREATE_NAME,
		a.CREATE_TIME,
		a.UPDATE_BY,
		a.UPDATE_TIME
	</sql>
	<sql id="tSalaryStandardIssue_where">
		<if test="tSalaryStandardIssue != null">
			<if test="tSalaryStandardIssue.id != null and tSalaryStandardIssue.id.trim() != ''">
				AND a.ID = #{tSalaryStandardIssue.id}
			</if>
			<if test="tSalaryStandardIssue.deptId != null and tSalaryStandardIssue.deptId.trim() != ''">
				AND a.DEPT_ID = #{tSalaryStandardIssue.deptId}
			</if>
			<if test="tSalaryStandardIssue.deptName != null and tSalaryStandardIssue.deptName.trim() != ''">
				AND a.DEPT_NAME = #{tSalaryStandardIssue.deptName}
			</if>
			<if test="tSalaryStandardIssue.deptNo != null and tSalaryStandardIssue.deptNo.trim() != ''">
				AND a.DEPT_NO = #{tSalaryStandardIssue.deptNo}
			</if>
			<if test="tSalaryStandardIssue.orgName != null and tSalaryStandardIssue.orgName.trim() != ''">
				AND a.ORG_NAME = #{tSalaryStandardIssue.orgName}
			</if>
			<if test="tSalaryStandardIssue.bankName != null and tSalaryStandardIssue.bankName.trim() != ''">
				AND a.BANK_NAME = #{tSalaryStandardIssue.bankName}
			</if>
			<if test="tSalaryStandardIssue.bankSubName != null and tSalaryStandardIssue.bankSubName.trim() != ''">
				AND a.BANK_SUB_NAME = #{tSalaryStandardIssue.bankSubName}
			</if>
			<if test="tSalaryStandardIssue.bankNo != null and tSalaryStandardIssue.bankNo.trim() != ''">
				AND a.BANK_NO = #{tSalaryStandardIssue.bankNo}
			</if>
			<if test="tSalaryStandardIssue.bankProvince != null">
				AND a.BANK_PROVINCE = #{tSalaryStandardIssue.bankProvince}
			</if>
			<if test="tSalaryStandardIssue.bankCity != null">
				AND a.BANK_CITY = #{tSalaryStandardIssue.bankCity}
			</if>
			<if test="tSalaryStandardIssue.createBy != null and tSalaryStandardIssue.createBy.trim() != ''">
				AND a.CREATE_BY = #{tSalaryStandardIssue.createBy}
			</if>
			<if test="tSalaryStandardIssue.createName != null and tSalaryStandardIssue.createName.trim() != ''">
				AND a.CREATE_NAME = #{tSalaryStandardIssue.createName}
			</if>
			<if test="tSalaryStandardIssue.createTime != null">
				AND a.CREATE_TIME = #{tSalaryStandardIssue.createTime}
			</if>
			<if test="tSalaryStandardIssue.updateBy != null and tSalaryStandardIssue.updateBy.trim() != ''">
				AND a.UPDATE_BY = #{tSalaryStandardIssue.updateBy}
			</if>
			<if test="tSalaryStandardIssue.updateTime != null">
				AND a.UPDATE_TIME = #{tSalaryStandardIssue.updateTime}
			</if>
		</if>
	</sql>
	<!--tSalaryStandardIssue简单分页查询-->
	<select id="getTSalaryStandardIssuePage" resultMap="tSalaryStandardIssueMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_salary_standard_issue a
		<where>
			1=1
			<include refid="tSalaryStandardIssue_where"/>
		</where>
		order by a.CREATE_TIME desc
	</select>

	<!--导出-->
	<select id="getTSalaryStandardIssueVoList" resultMap="tSalaryStandardIssueExportMap">
		SELECT
			a.DEPT_NAME,
			a.DEPT_NO,
			a.ORG_NAME,
			a.BANK_NAME,
			a.BANK_SUB_NAME,
			a.BANK_NO,
			a.BANK_PROVINCE_NAME,
			a.BANK_CITY_NAME
		FROM t_salary_standard_issue a
		<where>
			1=1
			<include refid="tSalaryStandardIssue_where"/>
		</where>
		order by a.CREATE_TIME desc
		<if test="tSalaryStandardIssue != null">
			<if test="tSalaryStandardIssue.limitStart != null">
				limit #{tSalaryStandardIssue.limitStart},#{tSalaryStandardIssue.limitEnd}
			</if>
		</if>
	</select>

</mapper>
