<?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.insurances.mapper.insurances.TEmployeeInsurancePreQwDetailMapper">

  <resultMap id="tEmployeeInsurancePreQwDetailMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreQwDetail">
    <id property="id" column="ID"/>
    <result property="mainId" column="MAIN_ID"/>
    <result property="empName" column="EMP_NAME"/>
    <result property="empIdcard" column="EMP_IDCARD"/>
    <result property="errorInfo" column="ERROR_INFO"/>
    <result property="errorTime" column="ERROR_TIME"/>
    <result property="preId" column="PRE_ID"/>
  </resultMap>
    <sql id="Base_Column_List">
			a.ID,
			a.MAIN_ID,
			a.EMP_NAME,
			a.EMP_IDCARD,
			a.ERROR_INFO,
			a.ERROR_TIME,
			a.PRE_ID
    </sql>
    <sql id="tEmployeeInsurancePreQwDetail_where">
        <if test="tEmployeeInsurancePreQwDetail != null">
				<if test="tEmployeeInsurancePreQwDetail.id != null and tEmployeeInsurancePreQwDetail.id.trim() != ''">
					AND a.ID = #{tEmployeeInsurancePreQwDetail.id}
				</if>
				<if test="tEmployeeInsurancePreQwDetail.mainId != null and tEmployeeInsurancePreQwDetail.mainId.trim() != ''">
					AND a.MAIN_ID = #{tEmployeeInsurancePreQwDetail.mainId}
				</if>
				<if test="tEmployeeInsurancePreQwDetail.empName != null and tEmployeeInsurancePreQwDetail.empName.trim() != ''">
					AND a.EMP_NAME = #{tEmployeeInsurancePreQwDetail.empName}
				</if>
				<if test="tEmployeeInsurancePreQwDetail.empIdcard != null and tEmployeeInsurancePreQwDetail.empIdcard.trim() != ''">
					AND a.EMP_IDCARD = #{tEmployeeInsurancePreQwDetail.empIdcard}
				</if>
				<if test="tEmployeeInsurancePreQwDetail.errorInfo != null and tEmployeeInsurancePreQwDetail.errorInfo.trim() != ''">
					AND a.ERROR_INFO = #{tEmployeeInsurancePreQwDetail.errorInfo}
				</if>
				<if test="tEmployeeInsurancePreQwDetail.errorTime != null">
					AND a.ERROR_TIME = #{tEmployeeInsurancePreQwDetail.errorTime}
				</if>
				<if test="tEmployeeInsurancePreQwDetail.preId != null and tEmployeeInsurancePreQwDetail.preId.trim() != ''">
					AND a.PRE_ID = #{tEmployeeInsurancePreQwDetail.preId}
				</if>
        </if>
    </sql>
    <!--tEmployeeInsurancePreQwDetail简单分页查询-->
    <select id="getTEmployeeInsurancePreQwDetailPage" resultMap="tEmployeeInsurancePreQwDetailMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_employee_insurance_pre_qw_detail a
        <where>
            1=1
            <include refid="tEmployeeInsurancePreQwDetail_where"/>
        </where>
		order by a.id
    </select>
</mapper>
