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

  <resultMap id="tInsurancePreRenewDetailQwDetailMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetailQwDetail">
    <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="tInsurancePreRenewDetailQwDetail_where">
        <if test="tInsurancePreRenewDetailQwDetail != null">
                    <if test="tInsurancePreRenewDetailQwDetail.id != null and tInsurancePreRenewDetailQwDetail.id.trim() != ''">
                        AND a.ID = #{tInsurancePreRenewDetailQwDetail.id}
                    </if>
                    <if test="tInsurancePreRenewDetailQwDetail.mainId != null and tInsurancePreRenewDetailQwDetail.mainId.trim() != ''">
                        AND a.MAIN_ID = #{tInsurancePreRenewDetailQwDetail.mainId}
                    </if>
                    <if test="tInsurancePreRenewDetailQwDetail.empName != null and tInsurancePreRenewDetailQwDetail.empName.trim() != ''">
                        AND a.EMP_NAME = #{tInsurancePreRenewDetailQwDetail.empName}
                    </if>
                    <if test="tInsurancePreRenewDetailQwDetail.empIdcard != null and tInsurancePreRenewDetailQwDetail.empIdcard.trim() != ''">
                        AND a.EMP_IDCARD = #{tInsurancePreRenewDetailQwDetail.empIdcard}
                    </if>
                    <if test="tInsurancePreRenewDetailQwDetail.errorInfo != null and tInsurancePreRenewDetailQwDetail.errorInfo.trim() != ''">
                        AND a.ERROR_INFO = #{tInsurancePreRenewDetailQwDetail.errorInfo}
                    </if>
                    <if test="tInsurancePreRenewDetailQwDetail.errorTime != null">
                        AND a.ERROR_TIME = #{tInsurancePreRenewDetailQwDetail.errorTime}
                    </if>
                    <if test="tInsurancePreRenewDetailQwDetail.preId != null and tInsurancePreRenewDetailQwDetail.preId.trim() != ''">
                        AND a.PRE_ID = #{tInsurancePreRenewDetailQwDetail.preId}
                    </if>
        </if>
    </sql>
    <!--tInsurancePreRenewDetailQwDetail简单分页查询-->
    <select id="getTInsurancePreRenewDetailQwDetailPage" resultMap="tInsurancePreRenewDetailQwDetailMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_insurance_pre_renew_detail_qw_detail a
        <where>
            1=1
            <include refid="tInsurancePreRenewDetailQwDetail_where"/>
        </where>
    </select>
</mapper>
