要查询的mysql语句:
SELECT DISTINCT a.pool_name,a.equipment_name,a.commissioning_time from equipment a,sewage_pool b where a.pool_name=b.pool_name
1、添加VO类:EquipmentVO
上述查询中有:pool_name、equipment_name、commission_time字段,因此新增类VO中添加相应属性
@Data public class EquipmentVO { private String poolName; private String equipmentName; private String commissioningTime; }
2、在对应的mapper层接口EquipmentMapper添加注解与方法
@Select("SELECT DISTINCT a.pool_name,a.equipment_name,a.commissioning_time from equipment a,sewage_pool b where a.pool_name=b.pool_name ")
List<EquipmentVO> equipmentVO();
3、在service/Impl层中返回查询给前端
public List<EquipmentVO> configurationBoard() { return mapper.equipmentVO(); }