| | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface DeviceAdjustValueMapper { |
| | | Map<String, Object> selectAllByid(@Param("id") Integer id); |
| | | |
| | | void updateValueByID(@Param("id") Integer id,@Param("value") String value); |
| | | |
| | | List<Map<String, Object>> selectDataByTimesolt(@Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | } |
| | |
| | | package com.moral.service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface DeviceAdjustValueService { |
| | | Map<String, Object> getDataByid(Integer id); |
| | | |
| | | void uudateValueByID(int id,String value); |
| | | |
| | | List<Map<String, Object>> selectDataByTimesolt(String startTime,String endTime); |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | |
| | | public void uudateValueByID(int id, String value) { |
| | | deviceAdjustValueMapper.updateValueByID(id,value); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectDataByTimesolt(String startTime, String endTime) { |
| | | List<Map<String, Object>> result = deviceAdjustValueMapper.selectDataByTimesolt(startTime,endTime); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | SET value = #{value} |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <!--通过时间段获取数据--> |
| | | <select id="selectDataByTimesolt" resultType="java.util.Map"> |
| | | select * FROM device_adjust_value_timing |
| | | WHERE adjusttime BETWEEN #{startTime} AND #{endTime} |
| | | </select> |
| | | |
| | | </mapper> |