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

	<resultMap id="tGzEmpSkillMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpSkill">
		<id property="id" column="id"/>
		<result property="empId" column="emp_id"/>
		<result property="delFlag" column="del_flag"/>
		<result property="createTime" column="create_time"/>
		<result property="createBy" column="create_by"/>
		<result property="createName" column="create_name"/>
		<result property="updateBy" column="update_by"/>
		<result property="updateTime" column="update_time"/>
		<result property="skillName" column="skill_name"/>
		<result property="skillDate" column="skill_date"/>
		<result property="skillOrg" column="skill_org"/>
		<result property="skillLevel" column="skill_level"/>
	</resultMap>
	<sql id="Base_Column_List">
                a.id,
                a.emp_id,
                a.del_flag,
                a.create_time,
                a.create_by,
                a.create_name,
                a.update_by,
                a.update_time,
                a.skill_name,
                a.skill_date,
                a.skill_org,
                a.skill_level
    </sql>
	<sql id="tGzEmpSkill_where">
		<if test="tGzEmpSkill != null">
			<if test="tGzEmpSkill.id != null and tGzEmpSkill.id.trim() != ''">
				AND a.id = #{tGzEmpSkill.id}
			</if>
			<if test="tGzEmpSkill.empId != null and tGzEmpSkill.empId.trim() != ''">
				AND a.emp_id = #{tGzEmpSkill.empId}
			</if>
			<if test="tGzEmpSkill.delFlag != null and tGzEmpSkill.delFlag.trim() != ''">
				AND a.del_flag = #{tGzEmpSkill.delFlag}
			</if>
			<if test="tGzEmpSkill.createTime != null">
				AND a.create_time = #{tGzEmpSkill.createTime}
			</if>
			<if test="tGzEmpSkill.createBy != null and tGzEmpSkill.createBy.trim() != ''">
				AND a.create_by = #{tGzEmpSkill.createBy}
			</if>
			<if test="tGzEmpSkill.createName != null and tGzEmpSkill.createName.trim() != ''">
				AND a.create_name = #{tGzEmpSkill.createName}
			</if>
			<if test="tGzEmpSkill.updateBy != null and tGzEmpSkill.updateBy.trim() != ''">
				AND a.update_by = #{tGzEmpSkill.updateBy}
			</if>
			<if test="tGzEmpSkill.updateTime != null">
				AND a.update_time = #{tGzEmpSkill.updateTime}
			</if>
			<if test="tGzEmpSkill.skillName != null and tGzEmpSkill.skillName.trim() != ''">
				AND a.skill_name = #{tGzEmpSkill.skillName}
			</if>
			<if test="tGzEmpSkill.skillDate != null">
				AND a.skill_date = #{tGzEmpSkill.skillDate}
			</if>
			<if test="tGzEmpSkill.skillOrg != null and tGzEmpSkill.skillOrg.trim() != ''">
				AND a.skill_org = #{tGzEmpSkill.skillOrg}
			</if>
			<if test="tGzEmpSkill.skillLevel != null and tGzEmpSkill.skillLevel.trim() != ''">
				AND a.skill_level = #{tGzEmpSkill.skillLevel}
			</if>
		</if>
	</sql>
	<!--tGzEmpSkill简单分页查询-->
	<select id="getTGzEmpSkillPage" resultMap="tGzEmpSkillMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_gz_emp_skill a
		<where>
			1=1
			<include refid="tGzEmpSkill_where"/>
		</where>
	</select>

	<!-- 删除 -->
	<delete id="deleteByEmpId">
		delete FROM t_gz_emp_skill where emp_id = #{empId}
	</delete>

</mapper>
