<?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.process.mapper.TNodeRouteConditionMapper">
    <resultMap id="tNodeRouteConditionMap" type="com.yifu.cloud.plus.v1.yifu.process.entity.TNodeRouteCondition">
        <id property="id" column="ID"/>
        <result property="field" column="FIELD"/>
        <result property="conditions" column="CONDITIONS"/>
        <result property="conditionValue" column="CONDITION_VALUE"/>
        <result property="realation" column="REALATION"/>
        <result property="nodeRouteId" column="NODE_ROUTE_ID"/>
    </resultMap>
    <sql id="Base_Column_List">
             a.ID,
                  a.FIELD,
                  a.CONDITIONS,
                  a.CONDITION_VALUE,
                  a.REALATION,
                  a.NODE_ROUTE_ID
         </sql>
    <sql id="tNodeRouteCondition_where">
        <if test="tNodeRouteCondition != null">
            <if test="tNodeRouteCondition.id != null and tNodeRouteCondition.id.trim() != ''">
                AND a.ID = #{tNodeRouteCondition.id}
            </if>
            <if test="tNodeRouteCondition.field != null and tNodeRouteCondition.field.trim() != ''">
                AND a.FIELD = #{tNodeRouteCondition.field}
            </if>
            <if test="tNodeRouteCondition.conditions != null and tNodeRouteCondition.conditions.trim() != ''">
                AND a.CONDITIONS = #{tNodeRouteCondition.conditions}
            </if>
            <if test="tNodeRouteCondition.conditionValue != null and tNodeRouteCondition.conditionValue.trim() != ''">
                AND a.CONDITION_VALUE = #{tNodeRouteCondition.conditionValue}
            </if>
            <if test="tNodeRouteCondition.realation != null and tNodeRouteCondition.realation.trim() != ''">
                AND a.REALATION = #{tNodeRouteCondition.realation}
            </if>
            <if test="tNodeRouteCondition.nodeRouteId != null and tNodeRouteCondition.nodeRouteId.trim() != ''">
                AND a.NODE_ROUTE_ID = #{tNodeRouteCondition.nodeRouteId}
            </if>
        </if>
    </sql>
    <!--tNodeRouteCondition简单分页查询-->
    <select id="getTNodeRouteConditionPage" resultMap="tNodeRouteConditionMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_node_route_condition a
        <where>
            1=1
            <include refid="tNodeRouteCondition_where"/>
        </where>
    </select>
</mapper>
