Commit 23346127 authored by zhangzhenbang's avatar zhangzhenbang

试探性写了一两个接口

parent 940b7ab0
package com.yingxin.beijingvehicleflow.controller;
import com.yingxin.beijingvehicleflow.dto.ReservationsDisplayDTO;
import com.yingxin.beijingvehicleflow.entity.IdentityInformation;
import com.yingxin.beijingvehicleflow.response.Response;
import com.yingxin.beijingvehicleflow.service.IdentityInformationService;
......@@ -10,6 +11,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* description //TODO
*
......@@ -95,4 +98,9 @@ public class IdentityInfoController {
}
@PostMapping("/identity/reservation/display")
public List<ReservationsDisplayDTO> selectReservatinsByIdentityId(@RequestBody IdentityInformation info) {
return identityInformationService.selectReservatinsByIdentityId(info);
}
}
......@@ -13,4 +13,6 @@ import lombok.Data;
public class ReservationsDisplayDTO {
private String name;
private String toBeijingDate;
private String submitCoordinate;
}
package com.yingxin.beijingvehicleflow.mapper;
import com.yingxin.beijingvehicleflow.dto.ReservationsDisplayDTO;
import com.yingxin.beijingvehicleflow.entity.IdentityInformation;
import com.yingxin.beijingvehicleflow.entity.Reservation;
import org.apache.ibatis.annotations.*;
import java.util.List;
/**
* 数据库表单对应Mapper
*
......@@ -39,4 +43,7 @@ public interface IdentityInformationMapper {
@Select("select * from identity_information where wechat_openid = #{openid}")
IdentityInformation getAllInfoByOpenid(String openid);
@Select("select info.name,info.toBeijing_date,r.submit_coordinate from identity_information AS info LEFT JOIN reservation AS r ON info.id=r.identity_id WHERE info.id = #{id} ")
List<ReservationsDisplayDTO> selectReservatinsByIdentityId(IdentityInformation info);
}
......@@ -3,11 +3,8 @@ package com.yingxin.beijingvehicleflow.mapper;
import com.yingxin.beijingvehicleflow.entity.Reservation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
/**
* 数据库表单对应Mapper
*
......@@ -39,6 +36,4 @@ public interface ReservationMapper {
@Update("update reservation set auth_coordinate=#{authCoordinate},auth_time=#{authTime} where id = #{id}")
int updateAuthInfo(Reservation reservation);
@Select("select * ")
List<Reservation> selectReservatinsByIdentityId(Reservation reservation);
}
package com.yingxin.beijingvehicleflow.service;
import com.yingxin.beijingvehicleflow.dto.ReservationsDisplayDTO;
import com.yingxin.beijingvehicleflow.entity.IdentityInformation;
import net.sf.json.JSONObject;
import java.util.List;
/**
* description //TODO
*
......@@ -34,4 +37,6 @@ public interface IdentityInformationService {
IdentityInformation getAllInfoByOpenid(String openid);
List<ReservationsDisplayDTO> selectReservatinsByIdentityId(IdentityInformation info);
}
package com.yingxin.beijingvehicleflow.service.impl;
import com.yingxin.beijingvehicleflow.constant.Const;
import com.yingxin.beijingvehicleflow.dto.ReservationsDisplayDTO;
import com.yingxin.beijingvehicleflow.entity.IdentityInformation;
import com.yingxin.beijingvehicleflow.mapper.IdentityInformationMapper;
import com.yingxin.beijingvehicleflow.service.IdentityInformationService;
......@@ -17,6 +18,7 @@ import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
/**
* description //TODO
......@@ -89,4 +91,8 @@ public class IdentityInformationServiceImpl implements IdentityInformationServic
return identityInformationMapper.getAllInfoByOpenid(openid);
}
@Override
public List<ReservationsDisplayDTO> selectReservatinsByIdentityId(IdentityInformation info) {
return identityInformationMapper.selectReservatinsByIdentityId(info);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment