<?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.hotent.uc.dao.UcCustomDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.uc.model.CustomUser">
        <id column="id" property="id" />
    <result column="custom_key" property="customKey" />
    <result column="custom_secret" property="customSecret" />
    <result column="dem_id" property="demId" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, custom_key, custom_secret, dem_id
    </sql>

	<select id="selectPage" resultMap="BaseResultMap">
		select
			<include refid="Base_Column_List"/>
		from
			uc_custom
		${ew.customSqlSegment}
	</select>

	<select id="selectList" resultMap="BaseResultMap">
		select
			<include refid="Base_Column_List"/>
		from
			uc_custom
		${ew.customSqlSegment}
	</select>

	<select id="selectById" resultMap="BaseResultMap">
		select
			<include refid="Base_Column_List"/>
		from
			uc_custom
		where
		    id = ${id}
	</select>

    <select id="getByCustomKey" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from
        uc_custom
       where custom_key = #{customKey}
    </select>
</mapper>
