<?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.iailab.module.data.ind.dao.IndItemDao">
|
|
|
<select id="getItemAtom" resultType="com.iailab.module.data.ind.dto.IndItemDTO">
|
SELECT
|
t1.item_no,
|
t1.item_name,
|
t1.item_type,
|
t1.coefficient,
|
t1.precision,
|
t1.time_range,
|
t1.time_granularity,
|
t2.data_source,
|
t2.query_sql
|
FROM t_ind_item t1
|
LEFT JOIN t_ind_item_atom t2 ON t2.item_id = t1.id
|
<where>
|
t1.item_type = #{itemType}
|
<if test="isEnable != null">
|
AND t1.is_enable = #{isEnable}
|
</if>
|
<if test="timeGranularity != null and timeGranularity != ''">
|
AND t1.time_granularity = #{timeGranularity}
|
</if>
|
<if test="itemNo != null and itemNo != ''">
|
AND t1.item_no = #{itemNo}
|
</if>
|
<if test="itemNos != null">
|
AND t1.item_no in
|
<foreach collection="itemNos" item="item" index="item" open="(" close=")" separator=",">
|
#{item}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
<select id="getItemCal" resultType="com.iailab.module.data.ind.dto.IndItemDTO">
|
SELECT
|
t1.item_no,
|
t1.item_name,
|
t1.item_type,
|
t1.coefficient,
|
t1.precision,
|
t1.time_range,
|
t1.time_granularity,
|
t2.expression
|
FROM t_ind_item t1
|
LEFT JOIN t_ind_item_cal t2 ON t2.item_id = t1.id
|
<where>
|
t1.item_type = #{itemType}
|
<if test="isEnable != null">
|
AND t1.is_enable = #{isEnable}
|
</if>
|
<if test="timeGranularity != null and timeGranularity != ''">
|
AND t1.time_granularity = #{timeGranularity}
|
</if>
|
<if test="itemNo != null and itemNo != ''">
|
AND t1.item_no = #{itemNo}
|
</if>
|
<if test="itemNos != null">
|
AND t1.item_no in
|
<foreach collection="itemNos" item="item" index="item" open="(" close=")" separator=",">
|
#{item}
|
</foreach>
|
</if>
|
</where>
|
|
</select>
|
|
|
|
</mapper>
|