<?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.upyuns.platform.rs.universal.mapper.DictionaryMapper" >
  <resultMap id="BaseResultMap" type="com.upyuns.platform.rs.universal.entity.Dictionary" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="type" property="type" jdbcType="VARCHAR" />
    <result column="code" property="code" jdbcType="VARCHAR" />
    <result column="pid" property="pid" jdbcType="INTEGER" />
    <result column="name" property="name" jdbcType="VARCHAR" />
    <result column="detail" property="detail" jdbcType="VARCHAR" />
  </resultMap>

  <select id="selectByCodeAndType" parameterType="com.upyuns.platform.rs.universal.entity.Dictionary" resultType="com.upyuns.platform.rs.universal.entity.Dictionary">
        select * from data_dictionary
        <where>
          <if test="type != null">
                and type = #{type}
          </if>
          <if test="code != null">
                and code = #{code}
          </if>
          <if test="pid != null">
                and pid = #{pid}
          </if>
        </where>
  </select>

  <select id = "selectByPid" parameterType="java.lang.Integer" resultType="com.upyuns.platform.rs.universal.entity.Dictionary">
     select * from data_dictionary
     where pid = #{pid}
  </select>

</mapper>