<?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.lframework.xingyun.basedata.mappers.PayTypeMapper">

    <sql id="PayType_sql">
        SELECT
            tb.*
        FROM base_data_pay_type AS tb
    </sql>
    <select id="query" resultType="com.lframework.xingyun.basedata.entity.PayType">
        <include refid="PayType_sql"/>
        <where>
            <if test="vo != null">
                <if test="vo.code != null and vo.code != ''">
                    AND tb.code = #{vo.code}
                </if>
                <if test="vo.name != null and vo.name != ''">
                    AND tb.name LIKE CONCAT('%', #{vo.name}, '%')
                </if>
                <if test="vo.available != null">
                    AND tb.available = #{vo.available}
                </if>
            </if>
        </where>
        ORDER BY tb.code
    </select>
    <select id="selector" resultType="com.lframework.xingyun.basedata.entity.PayType">
        <include refid="PayType_sql"/>
        <where>
            <if test="vo != null">
                <if test="vo.code != null and vo.code != ''">
                    AND tb.code = #{vo.code}
                </if>
                <if test="vo.name != null and vo.name != ''">
                    AND tb.name LIKE CONCAT('%', #{vo.name}, '%')
                </if>
                <if test="vo.available != null">
                    AND tb.available = #{vo.available}
                </if>
            </if>
        </where>
        ORDER BY tb.code
    </select>
</mapper>
