<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.TdApplyInfoListMapper">

    <resultMap id="BaseResultMap" type="TdApplyInfoList">
            <id property="applyId" column="apply_id" jdbcType="VARCHAR"/>
            <result property="name" column="name" jdbcType="VARCHAR"/>
            <result property="sex" column="sex" jdbcType="VARCHAR"/>
            <result property="nationa" column="nationa" jdbcType="VARCHAR"/>
            <result property="applyStatus" column="apply_status" jdbcType="VARCHAR"/>
            <result property="appTime" column="app_time" jdbcType="TIMESTAMP"/>
            <result property="applyMsg" column="apply_msg" jdbcType="VARCHAR"/>
            <result property="authTime" column="auth_time" jdbcType="TIMESTAMP"/>
            <result property="createId" column="create_id" jdbcType="BIGINT"/>
            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
            <result property="remark" column="remark" jdbcType="VARCHAR"/>
            <result property="deptId" column="dept_id" jdbcType="BIGINT"/>
            <result property="formerName" column="former_name" jdbcType="VARCHAR"/>
            <result property="nationality" column="nationality" jdbcType="VARCHAR"/>
            <result property="maritalStatus" column="marital_status" jdbcType="VARCHAR"/>
            <result property="political" column="political" jdbcType="VARCHAR"/>
            <result property="phone" column="phone" jdbcType="VARCHAR"/>
            <result property="cerno" column="cerno" jdbcType="VARCHAR"/>
            <result property="address" column="address" jdbcType="VARCHAR"/>
            <result property="registeredAuthority" column="registered_authority" jdbcType="VARCHAR"/>
            <result property="permanentAddress" column="permanent_address" jdbcType="VARCHAR"/>
            <result property="residentBureau" column="resident_bureau" jdbcType="VARCHAR"/>
            <result property="positionCapacity" column="position_capacity" jdbcType="VARCHAR"/>
            <result property="smPost" column="sm_post" jdbcType="VARCHAR"/>
            <result property="smGrade" column="sm_grade" jdbcType="VARCHAR"/>
            <result property="photoUrl" column="photo_url" jdbcType="VARCHAR"/>
            <result property="leaveMsg" column="leave_msg" jdbcType="VARCHAR"/>
            <result property="leaveTime" column="leave_time" jdbcType="TIMESTAMP"/>
            <result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
            <result property="instanceId"    column="instance_id"    />
            <result property="nodeCode"    column="node_code"    />
            <result property="nodeName"    column="node_name"    />
            <result property="nodeType"    column="node_type"    />
            <result property="flowStatus"    column="flow_status"    />
    </resultMap>

    <sql id="Base_Column_List">
        apply_id,name,sex,
        nationa,apply_status,app_time,
        apply_msg,auth_time,create_id,
        create_by,create_time,update_by,
        update_time,remark,dept_id,
        former_name,nationality,marital_status,
        political,phone,cerno,
        address,registered_authority,permanent_address,
        resident_bureau,position_capacity,sm_post,
        sm_grade,photo_url,leave_msg,leave_time,dept_name,instance_id, node_code, node_name, node_type, flow_status
    </sql>
    <select id="selectApplyInfoListList" resultType="com.ruoyi.system.domain.TdApplyInfoList">
        select  <include refid="Base_Column_List"/> from  td_apply_info_list d
        <trim prefix="where" prefixOverrides="and|or">
            <if test="name!=null and name!=''">
                AND name = #{name}
            </if>
            <if test="nationa!=null and nationa!=''">
                AND nationa = #{nationa}
            </if>
            <if test="sex!=null and sex!=''">
                AND sex = #{sex}
            </if>
            <if test="formerName!=null and formerName!=''">
                AND former_name = #{formerName}
            </if>
            <if test="cerno!=null and cerno!=''">
                AND cerno = #{cerno}
            </if>
            <if test="phone!=null and phone!=''">
                AND phone = #{phone}
            </if>
            <if test="smPost!=null and smPost!=''">
                AND sm_post = #{smPost}
            </if>
            <if test="flowStatus != null  and flowStatus != ''">
                 and flow_status = #{flowStatus}
            </if>
            AND  apply_status in ('0','3')
            <!-- 数据范围过滤 -->
            ${params.dataScope}
        </trim>
        ORDER BY create_time DESC

    </select>


</mapper>
