<?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.usky.rule.mapper.RuleEngineConditionMapper">
    <resultMap id="Base" type="com.usky.rule.domain.RuleEngineCondition">
        <id column="id" property="id"/>
        <result column="optional_condition" property="optionalCondition"/>
        <result column="expression" property="expression"/>
        <result column="descr" property="descr"/>
        <result column="type" property="type"/>
        <result column="updated_by" property="updatedBy"/>
        <result column="update_time" property="updateTime"/>
        <result column="created_by" property="createdBy"/>
        <result column="create_time" property="createTime"/>
        <result column="tenant_id" property="tenantId"/>
    </resultMap>
    <select id="selectAll" resultMap="Base">
        SELECT * FROM rule_engine_condition
        ORDER BY type, id
    </select>
    <select id="selectByType" resultMap="Base">
        SELECT * FROM rule_engine_condition
        <where>
            AND type = #{type}
        </where>
        ORDER BY id
    </select>
</mapper>
