<?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.portal.persistence.dao.AppModelDao">
	<resultMap id="AppModel" type="com.hotent.portal.model.AppModel">
		<id property="id" column="ID_" jdbcType="VARCHAR"/>
		<result property="name" column="NAME_" jdbcType="VARCHAR"/>
		<result property="content" column="CONTENT_" jdbcType="VARCHAR"/>
		<result property="icon" column="ICON_" jdbcType="VARCHAR"/>
		<result property="iconColor" column="ICON_COLOR_" jdbcType="VARCHAR"/>
		<result property="typeId" column="TYPE_ID_" jdbcType="VARCHAR"/>
		<result property="typeName" column="TYPE_NAME_" jdbcType="VARCHAR"/>
		<result property="enable" column="ENABLE_" jdbcType="NUMERIC"/>
		<result property="mode" column="MODE_" jdbcType="NUMERIC"/>
		<result property="sn" column="SN_" jdbcType="NUMERIC"/>
		<result property="createBy" column="CREATE_BY_" jdbcType="VARCHAR"/>
		<result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP"/>
		<result property="updateBy" column="UPDATE_BY_" jdbcType="VARCHAR"/>
		<result property="updateTime" column="UPDATE_TIME_" jdbcType="TIMESTAMP"/>
		<result property="callbackUrl" column="CALLBACK_URL_" jdbcType="VARCHAR"/>
		<result property="localAuthCode" column="LOCAL_AUTH_CODE_" jdbcType="NUMERIC"/>
	</resultMap>



	<select id="getAppStatic" resultType="java.util.Map">
		SELECT COALESCE(`LOCAL_AUTH_CODE_`, 0) AS `local_auth_code`,
			   COUNT(ID_) AS `count`
		FROM
			`portal_app`
		GROUP BY
			COALESCE(`LOCAL_AUTH_CODE_`, 0);
	</select>

</mapper>




