|
|
|
|
@ -7,6 +7,7 @@
|
|
|
|
|
<resultMap type="ReportDayDnb" id="ReportDayDnbResult">
|
|
|
|
|
<result property="objId" column="obj_id"/>
|
|
|
|
|
<result property="monitorCode" column="monitor_code"/>
|
|
|
|
|
<result property="monitorName" column="monitor_name"/>
|
|
|
|
|
<result property="instrumentValue" column="instrument_value"/>
|
|
|
|
|
<result property="expend" column="expend"/>
|
|
|
|
|
<result property="reportDate" column="report_date"/>
|
|
|
|
|
@ -20,29 +21,40 @@
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectReportDayDnbVo">
|
|
|
|
|
select obj_id, monitor_code, instrument_value, expend, report_date, begin_time, end_time, is_flag, created_by, created_time, updated_by, updated_time from report_day_dnb
|
|
|
|
|
select rpd.monitor_code,
|
|
|
|
|
bm.MONITOR_NAME,
|
|
|
|
|
MAX(rpd.instrument_value) instrument_value,
|
|
|
|
|
SUM(rpd.expend) expend,
|
|
|
|
|
SUBSTR(rpd.begin_time, 1, 10) report_date
|
|
|
|
|
from report_point_dnb rpd
|
|
|
|
|
left join BASE_MONITORINFO bm on bm.MONITOR_CODE = rpd.MONITOR_CODE
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectReportDayDnbList" parameterType="ReportDayDnb" resultMap="ReportDayDnbResult">
|
|
|
|
|
<include refid="selectReportDayDnbVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="monitorCode != null and monitorCode != ''"> and monitor_code = #{monitorCode}</if>
|
|
|
|
|
<if test="monitorCode != null and monitorCode != ''">and rpd.monitor_code = #{monitorCode}</if>
|
|
|
|
|
<if test="instrumentValue != null ">and instrument_value = #{instrumentValue}</if>
|
|
|
|
|
<if test="expend != null ">and expend = #{expend}</if>
|
|
|
|
|
<if test="reportDate != null and reportDate != ''">and report_date = #{reportDate}</if>
|
|
|
|
|
<if test="beginTime != null and beginTime != ''">and begin_time = #{beginTime}</if>
|
|
|
|
|
<if test="endTime != null and endTime != ''">and end_time = #{endTime}</if>
|
|
|
|
|
<if test="isFlag != null ">and is_flag = #{isFlag}</if>
|
|
|
|
|
<if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''">
|
|
|
|
|
and SUBSTR(rpd.begin_time, 1, 10) between #{params.beginCollectTime} and #{params.endCollectTime}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createdBy != null and createdBy != ''">and created_by = #{createdBy}</if>
|
|
|
|
|
<if test="createdTime != null ">and created_time = #{createdTime}</if>
|
|
|
|
|
<if test="updatedBy != null and updatedBy != ''">and updated_by = #{updatedBy}</if>
|
|
|
|
|
<if test="updatedTime != null ">and updated_time = #{updatedTime}</if>
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY rpd.monitor_code, bm.MONITOR_NAME, SUBSTR(rpd.begin_time, 1, 10)
|
|
|
|
|
order by report_date,rpd.monitor_code
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectReportDayDnbByObjId" parameterType="Long" resultMap="ReportDayDnbResult">
|
|
|
|
|
<include refid="selectReportDayDnbVo"/>
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
|
where rpd.obj_id = #{objId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertReportDayDnb" parameterType="ReportDayDnb">
|
|
|
|
|
@ -99,7 +111,9 @@
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteReportDayDnbByObjId" parameterType="Long">
|
|
|
|
|
delete from report_day_dnb where obj_id = #{objId}
|
|
|
|
|
delete
|
|
|
|
|
from report_day_dnb
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteReportDayDnbByObjIds" parameterType="String">
|
|
|
|
|
|