| | |
| | | import com.whyc.pojo.Battinf; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | @Data |
| | | public class BattInfAndEnduranceDTO { |
| | | private Battinf battInf; |
| | | private BattEndurance battEndurance; |
| | | |
| | | @Override |
| | | public boolean equals(Object obj){ |
| | | if(this == obj){ |
| | | return true; |
| | | } |
| | | if(obj == null || getClass()!=obj.getClass()){ |
| | | return false; |
| | | } |
| | | BattInfAndEnduranceDTO dto = (BattInfAndEnduranceDTO)obj; |
| | | return Objects.equals(battInf.getStationId(), dto.battInf.getStationId()); |
| | | } |
| | | |
| | | @Override |
| | | public int hashCode(){ |
| | | return Objects.hash(battInf.getStationId()); |
| | | } |
| | | } |
| | |
| | | |
| | | public Response findBattProducerInfoByTime(Date startTime,Date endTime, int uId){ |
| | | List<BattInfAndEnduranceDTO> list = battInfMapper.findBattProducerInfoByTime(startTime,endTime,uId); |
| | | list = list.stream().distinct().collect(Collectors.toList()); |
| | | return new Response().set(1,list,"查询成功"); |
| | | } |
| | | |
| | |
| | | |
| | | <resultMap id="BattInfAndEndurance" type="com.whyc.dto.BattInfAndEnduranceDTO"> |
| | | <association property="battInf" javaType="com.whyc.pojo.Battinf"> |
| | | <result property="stationId" column="StationId"></result> |
| | | <result property="stationName" column="StationName"></result> |
| | | <result property="stationName1" column="StationName1"></result> |
| | | <result property="stationName2" column="StationName2"></result> |
| | |
| | | |
| | | <select id="findBattProducerInfoByTime" resultMap="BattInfAndEndurance"> |
| | | select |
| | | StationName,StationName1,StationName2,StationName3,StationName5,BattGroupId,BattModel,monVolStd,BattProducer,BattProductDate,BattInUseDate,station_install,install_user,load_curr,FBSDeviceId,bEnd.* |
| | | bInf.StationId,StationName,StationName1,StationName2,StationName3,StationName5,BattGroupId,BattModel,monVolStd,BattProducer,BattProductDate,BattInUseDate,station_install,install_user,load_curr,FBSDeviceId,bEnd.* |
| | | from db_battinf.tb_battinf bInf left join web_site.tb_batt_endurance bEnd on bInf.FBSDeviceId = bEnd.deviceid |
| | | <where> |
| | | <if test="startTime!=null and endTime!=null"> |
| | |
| | | and db_user.tb_user_inf.uid=#{userId}) |
| | | </if> |
| | | </where> |
| | | group by binf.StationId order by bInf.StationName |
| | | order by bInf.StationName |
| | | </select> |
| | | |
| | | <select id="searchByTestType" resultType="com.whyc.pojo.Battinf"> |