AppModelMapper.xml 1.92 KB
<?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"/>
	</resultMap>

	<select id="customQuery" parameterType="java.util.Map" resultMap="AppModel">
		select * from (
			select
				app.ID_,
				app.NAME_,
				app.CONTENT_,
				app.ICON_,
				app.ICON_COLOR_,
				app.TYPE_ID_,
				app.ENABLE_,
				app.MODE_,
				app.SN_,
				app.CREATE_BY_,
				app.CREATE_TIME_,
				app.UPDATE_BY_,
				app.UPDATE_TIME_,
				t.name_ as TYPE_NAME_
			from
			portal_app app
			left join portal_sys_type t on app.type_id_ = t.id_
		)t
		${ew.customSqlSegment}
	</select>

	<select id="getRecentlyApps" resultMap="AppModel">
		SELECT portal_app.*,portal_recently_app.account_  FROM portal_app LEFT JOIN portal_recently_app ON portal_app.ID_ = portal_recently_app.APP_ID_
			${ew.customSqlSegment}
	</select>

</mapper>