MyStatisticAttributeMapper.xml 1.66 KB
Newer Older
eddie.woo's avatar
eddie.woo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
<?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="pwc.taxtech.atms.dao.MyStatisticAttributeMapper">
	<resultMap id="BaseResultMap"
		type="pwc.taxtech.atms.dto.StatisticAttributeDisplayDto">
		<id column="ID" jdbcType="VARCHAR" property="ID" />
		<result column="AttributeID" jdbcType="VARCHAR" property="attributeID" />
		<result column="AttributeName" jdbcType="NVARCHAR" property="attributeName" />
		<result column="DimensionID" jdbcType="VARCHAR" property="dimensionID" />
		<result column="DimensionName" jdbcType="VARCHAR" property="dimensionName" />
		<result column="OrderIndex" jdbcType="SMALLINT" property="orderIndex" />
	</resultMap>

	<select id="selectByParentDimensionId" parameterType="map"
		resultMap="BaseResultMap"><![CDATA[
	select 
		p.ID AttributeID, 
		p.Name AttributeName, 
		d.ID DimensionID, 
		d.Name DimensionName, 
		sd.OrderIndex OrderIndex

	from 
		StatisticAttribute p 
			join StatisticAttributeDimension sd on p.ID = sd.StatisticsAttributeID
			join Dimension d on  sd.DimensionID = d.ID
		
	where p.IsActive = 1 and d.IsActive = 1 and d.ID = #{parentDimensionId,jdbcType=VARCHAR}
	order by sd.OrderIndex
 ]]></select>


	<select id="selectByOrgSubChildrenID" parameterType="map"
		resultMap="BaseResultMap"><![CDATA[
	select 
		p.StatisticsAttributeID AttributeID, 
		d.DictValue AttributeName, 
		#{parentDimensionId} DimensionID, 
		'' DimensionName, 
		p.OrderIndex OrderIndex

	from 
		StatisticAttributeDimension p 
			join Dictionary d on  p.StatisticsAttributeID = d.ID

	where p.DimensionID =#{parentDimensionId}
 ]]></select>
</mapper>