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

  <resultMap id="tPreEmpProfessionalQualificationMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpProfessionalQualification">
    <id property="id" column="ID"/>
    <result property="preMainId" column="PRE_MAIN_ID"/>
    <result property="empId" column="EMP_ID"/>
    <result property="empName" column="EMP_NAME"/>
    <result property="empCode" column="EMP_CODE"/>
    <result property="empIdcard" column="EMP_IDCARD"/>
    <result property="qualificationType" column="QUALIFICATION_TYPE"/>
    <result property="qualificationLevel" column="QUALIFICATION_LEVEL"/>
    <result property="certificationNo" column="CERTIFICATION_NO"/>
    <result property="obtainType" column="OBTAIN_TYPE"/>
    <result property="assessmentUnit" column="ASSESSMENT_UNIT"/>
    <result property="declareYear" column="DECLARE_YEAR"/>
    <result property="heightIdentification" column="HEIGHT_IDENTIFICATION"/>
    <result property="deleteFlag" column="DELETE_FLAG"/>
    <result property="settleDomain" column="SETTLE_DOMAIN"/>
    <result property="createBy" column="CREATE_BY"/>
    <result property="updateBy" column="UPDATE_BY"/>
    <result property="createName" column="CREATE_NAME"/>
    <result property="createTime" column="CREATE_TIME"/>
    <result property="updateTime" column="UPDATE_TIME"/>
    <result property="remark" column="REMARK"/>
  	<result property="oldId" column="OLD_ID"/>
	  <result property="haveQualification" column="HAVE_QUALIFICATION"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.PRE_MAIN_ID,
                a.EMP_ID,
                a.EMP_NAME,
                a.EMP_CODE,
                a.EMP_IDCARD,
                a.QUALIFICATION_TYPE,
                a.QUALIFICATION_LEVEL,
                a.CERTIFICATION_NO,
                a.OBTAIN_TYPE,
                a.ASSESSMENT_UNIT,
                a.DECLARE_YEAR,
                a.HEIGHT_IDENTIFICATION,
                a.DELETE_FLAG,
                a.SETTLE_DOMAIN,
                a.CREATE_BY,
                a.UPDATE_BY,
                a.CREATE_NAME,
                a.CREATE_TIME,
                a.UPDATE_TIME,
				a.OLD_ID,
                a.REMARK,
                a.HAVE_QUALIFICATION
    </sql>
    <sql id="tPreEmpProfessionalQualification_where">
        <if test="tPreEmpProfessionalQualification != null">
                    <if test="tPreEmpProfessionalQualification.id != null and tPreEmpProfessionalQualification.id.trim() != ''">
                        AND a.ID = #{tPreEmpProfessionalQualification.id}
                    </if>
                    <if test="tPreEmpProfessionalQualification.preMainId != null and tPreEmpProfessionalQualification.preMainId.trim() != ''">
                        AND a.PRE_MAIN_ID = #{tPreEmpProfessionalQualification.preMainId}
                    </if>
                    <if test="tPreEmpProfessionalQualification.empId != null and tPreEmpProfessionalQualification.empId.trim() != ''">
                        AND a.EMP_ID = #{tPreEmpProfessionalQualification.empId}
                    </if>
                    <if test="tPreEmpProfessionalQualification.empName != null and tPreEmpProfessionalQualification.empName.trim() != ''">
                        AND a.EMP_NAME = #{tPreEmpProfessionalQualification.empName}
                    </if>
                    <if test="tPreEmpProfessionalQualification.empCode != null and tPreEmpProfessionalQualification.empCode.trim() != ''">
                        AND a.EMP_CODE = #{tPreEmpProfessionalQualification.empCode}
                    </if>
                    <if test="tPreEmpProfessionalQualification.empIdcard != null and tPreEmpProfessionalQualification.empIdcard.trim() != ''">
                        AND a.EMP_IDCARD = #{tPreEmpProfessionalQualification.empIdcard}
                    </if>
                    <if test="tPreEmpProfessionalQualification.qualificationType != null and tPreEmpProfessionalQualification.qualificationType.trim() != ''">
                        AND a.QUALIFICATION_TYPE = #{tPreEmpProfessionalQualification.qualificationType}
                    </if>
                    <if test="tPreEmpProfessionalQualification.qualificationLevel != null and tPreEmpProfessionalQualification.qualificationLevel.trim() != ''">
                        AND a.QUALIFICATION_LEVEL = #{tPreEmpProfessionalQualification.qualificationLevel}
                    </if>
                    <if test="tPreEmpProfessionalQualification.certificationNo != null and tPreEmpProfessionalQualification.certificationNo.trim() != ''">
                        AND a.CERTIFICATION_NO = #{tPreEmpProfessionalQualification.certificationNo}
                    </if>
                    <if test="tPreEmpProfessionalQualification.obtainType != null and tPreEmpProfessionalQualification.obtainType.trim() != ''">
                        AND a.OBTAIN_TYPE = #{tPreEmpProfessionalQualification.obtainType}
                    </if>
                    <if test="tPreEmpProfessionalQualification.assessmentUnit != null and tPreEmpProfessionalQualification.assessmentUnit.trim() != ''">
                        AND a.ASSESSMENT_UNIT = #{tPreEmpProfessionalQualification.assessmentUnit}
                    </if>
                    <if test="tPreEmpProfessionalQualification.declareYear != null and tPreEmpProfessionalQualification.declareYear.trim() != ''">
                        AND a.DECLARE_YEAR = #{tPreEmpProfessionalQualification.declareYear}
                    </if>
                    <if test="tPreEmpProfessionalQualification.heightIdentification != null and tPreEmpProfessionalQualification.heightIdentification.trim() != ''">
                        AND a.HEIGHT_IDENTIFICATION = #{tPreEmpProfessionalQualification.heightIdentification}
                    </if>
                    <if test="tPreEmpProfessionalQualification.deleteFlag != null and tPreEmpProfessionalQualification.deleteFlag.trim() != ''">
                        AND a.DELETE_FLAG = #{tPreEmpProfessionalQualification.deleteFlag}
                    </if>
                    <if test="tPreEmpProfessionalQualification.settleDomain != null and tPreEmpProfessionalQualification.settleDomain.trim() != ''">
                        AND a.SETTLE_DOMAIN = #{tPreEmpProfessionalQualification.settleDomain}
                    </if>
                    <if test="tPreEmpProfessionalQualification.createBy != null and tPreEmpProfessionalQualification.createBy.trim() != ''">
                        AND a.CREATE_BY = #{tPreEmpProfessionalQualification.createBy}
                    </if>
                    <if test="tPreEmpProfessionalQualification.updateBy != null and tPreEmpProfessionalQualification.updateBy.trim() != ''">
                        AND a.UPDATE_BY = #{tPreEmpProfessionalQualification.updateBy}
                    </if>
                    <if test="tPreEmpProfessionalQualification.createName != null and tPreEmpProfessionalQualification.createName.trim() != ''">
                        AND a.CREATE_NAME = #{tPreEmpProfessionalQualification.createName}
                    </if>
                    <if test="tPreEmpProfessionalQualification.createTime != null">
                        AND a.CREATE_TIME = #{tPreEmpProfessionalQualification.createTime}
                    </if>
                    <if test="tPreEmpProfessionalQualification.updateTime != null">
                        AND a.UPDATE_TIME = #{tPreEmpProfessionalQualification.updateTime}
                    </if>
                    <if test="tPreEmpProfessionalQualification.remark != null and tPreEmpProfessionalQualification.remark.trim() != ''">
                        AND a.REMARK = #{tPreEmpProfessionalQualification.remark}
                    </if>
        </if>
    </sql>
    <!--tPreEmpProfessionalQualification简单分页查询-->
    <select id="getTPreEmpProfessionalQualificationList" resultMap="tPreEmpProfessionalQualificationMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_pre_emp_professional_qualification a
		where PRE_MAIN_ID = #{preMainId}
    </select>

	<delete id="deleteProfessionalByMainId">
		delete from t_pre_emp_professional_qualification where PRE_MAIN_ID = #{preMainId}
	</delete>

</mapper>
