From 2edb89372b20625cedf80821dc90b7f7ae8c310c Mon Sep 17 00:00:00 2001 From: lizijie <lzjiiie@163.com> Date: Fri, 07 Aug 2020 15:39:25 +0800 Subject: [PATCH] 根据时间段获取数据 --- src/main/resources/mapper/DeviceVersionMapper.xml | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main/resources/mapper/DeviceVersionMapper.xml b/src/main/resources/mapper/DeviceVersionMapper.xml index 576253e..05ece87 100644 --- a/src/main/resources/mapper/DeviceVersionMapper.xml +++ b/src/main/resources/mapper/DeviceVersionMapper.xml @@ -24,12 +24,24 @@ ( SELECT id FROM monitor_point mpt WHERE mpt.organization_id = #{orgId,jdbcType=INTEGER} - or EXISTS ( - SELECT * from dictionary_data where dict_data_key = 'auth_config_super_org' and dict_data_value = #{orgId,jdbcType=INTEGER} - ) - ) ) order by dvn.create_time desc </select> + <select id="selectListByMpointId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> + SELECT + * + FROM + device_version dvn + WHERE + dvn.id IN ( + SELECT DISTINCT + dev.device_version_id + FROM + device dev + WHERE + dev.monitor_point_id = #{mpointId,jdbcType=VARCHAR} + ) + order by dvn.create_time desc + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0