<?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.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryConfigStandardMapper">

    <resultMap id="tSalaryConfigStandardMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryConfigStandard">
        <id property="id" column="ID"/>
        <result property="cnName" column="CN_NAME"/>
        <result property="dbFiedName" column="DB_FIED_NAME"/>
        <result property="javaFiedName" column="JAVA_FIED_NAME"/>
        <result property="modelType" column="MODEL_TYPE"/>
        <result property="isMustNeed" column="IS_MUST_NEED"/>
        <result property="isTax" column="IS_TAX"/>
        <result property="createBy" column="CREATE_BY"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="orderLine" column="order_line"/>
    </resultMap>

    <sql id="tSalaryConfigStandard_where">
        <if test="tSalaryConfigStandard != null ">
            <if test="tSalaryConfigStandard.id != null and tSalaryConfigStandard.id.trim() != ''">
                AND ID = #{tSalaryConfigStandard.id}
            </if>
            <if test="tSalaryConfigStandard.cnName != null and tSalaryConfigStandard.cnName.trim() != ''">
                AND CN_NAME = #{tSalaryConfigStandard.cnName}
            </if>
            <if test="tSalaryConfigStandard.dbFiedName != null and tSalaryConfigStandard.dbFiedName.trim() != ''">
                AND DB_FIED_NAME = #{tSalaryConfigStandard.dbFiedName}
            </if>
            <if test="tSalaryConfigStandard.javaFiedName != null and tSalaryConfigStandard.javaFiedName.trim() != ''">
                AND JAVA_FIED_NAME = #{tSalaryConfigStandard.javaFiedName}
            </if>
            <if test="tSalaryConfigStandard.modelType != null and tSalaryConfigStandard.modelType.trim() != ''">
                AND MODEL_TYPE = #{tSalaryConfigStandard.modelType}
            </if>
            <if test="tSalaryConfigStandard.isMustNeed != null and tSalaryConfigStandard.isMustNeed.trim() != ''">
                AND IS_MUST_NEED = #{tSalaryConfigStandard.isMustNeed}
            </if>
            <if test="tSalaryConfigStandard.createBy != null and tSalaryConfigStandard.createBy.trim() != ''">
                AND CREATE_BY = #{tSalaryConfigStandard.createBy}
            </if>
            <if test="tSalaryConfigStandard.createTime != null">
                AND CREATE_TIME = #{tSalaryStandard.createTime}
            </if>
        </if>
    </sql>

    <!--tSalaryConfigStandard简单分页查询-->
    <select id="getTSalaryConfigStandardPage" resultMap="tSalaryConfigStandardMap">
        SELECT
        ID,
        CN_NAME,
        DB_FIED_NAME,
        JAVA_FIED_NAME,
        MODEL_TYPE,
        IS_MUST_NEED,
        IS_TAX,
        CREATE_BY,
        CREATE_TIME
        FROM t_salary_config_standard
        <where>
            1=1
            <include refid="tSalaryConfigStandard_where"/>
			order by CREATE_TIME  DESC
        </where>
    </select>

    <!--tSalaryConfigStandard列表-->
    <select id="getTSalaryConfigStandardList" resultMap="tSalaryConfigStandardMap">
        SELECT
        ID,
        DB_FIED_NAME,
        JAVA_FIED_NAME
        FROM t_salary_config_standard
        <where>
            order_line != 999
            <include refid="tSalaryConfigStandard_where"/>
        </where>
        order by order_line asc
    </select>


</mapper>
