网上订票系统第二天

前面做了需求分析,今天来设计一下数据库,初步打算 有十二张表,感觉后期一定会返工,先码出来吧。

贴一下 部分代码  

create database myticket
go
use myticket
select *from adminuser  a where a.adminname='admin' and a.adminpwd='123'

create table userticket
(
  userid int primary key identity(1,1),
  username varchar(20),
  usernumber varchar(50),
  userpwd varchar(20),
  usertype int,
  usertelephone  varchar(20),
  useremail varchar(20)
)
insert into userticket values('张三','410345199003045609','123',1,'13309893245','2123123@qq.com')
create table station
(
  stationid int primary key identity(1,1),
  stationname varchar(20),
  stationaddress varchar(50),
  stationtelephone varchar(20),
  stationremark varchar(20)
)
insert into station values('二马路车站','郑州市','0371-787878','备注')
insert into station values('城站','杭州市','0571-7842348','备注')
create table car
(
  carid int primary key identity(1,1),
  carname varchar(20),
  carnumber varchar(50),
  carbusload int,
  carremark varchar(20)
)
insert into car values('宇通T-002','豫A-4534L',50,'备注')
select *from car
create table frequency
(
  freid int primary key identity(1,1),
  frenumber varchar(20),
  frebeginsid int references station(stationid),
  freendsid int references station(stationid),
  frebegintime varchar(20),
  freendtime varchar(20),
  frecarid int references car(carid),
  freremark varchar(50)
)

insert into frequency values('k-3421',1,2,'10:00','次日9:00',1,'备注')

select *from frequency
create table ticket
(
  ticketid int primary key identity(1,1),
  ticketseat  int,
  ticketfreid int references frequency(freid),
  ticketprice float,
  ticketremark varchar(20)

)
insert into ticket values(2,1,173.5,'备注')
create table booking
(
  bookingid int primary key identity(1,1),
  bookinguserid  int references userticket(userid),
  bookingtime varchar(20),
  bookingticketid int references ticket(ticketid),
  bookingremark varchar(20)

)
create table refund
(
  refundid int primary key identity(1,1),
  refunduserid  int references userticket(userid),
  refundtime varchar(20),
  refundticketid int references ticket(ticketid),
  refundremark varchar(20)

)
create table news
(
  newsid int primary key identity(1,1),
  newstitle  varchar(20),
  newscontent varchar(100),
  newstime varchar(20)
)
insert into news values('网上售票系统开通啦','客车网上售票系统于今日正式开通,欢迎大家在网上订票。',getdate())
select *from news

create table message
(
  messageid int primary key identity(1,1),
  messagecontenttitle  varchar(20),
  messagecontent varchar(100),
  messagetime varchar(20),
  messageuserid int references userticket(userid),
  messageremark varchar(20)
)
insert into message values('车票太贵了','去上海的车票太贵了',getdate(),1,'备注')
select *from message
create table ContactInfo
(
   contactid int primary key identity(1,1),
   userid int references userticket(userid),
   contactname varchar(20),
   contactnumber varchar(50),
   contactphone varchar(20),
   contactemail varchar(20),
   contactsex varchar(5)
)
insert into ContactInfo values(1,'李如花','234897197803028934','17687970923','sdffasddf@qq.com','')

 

数据库 先告一段落吧!  现在把ssm 框架搭起来, 电脑由于其他原因,只装了 myeclipse , tomcat

 

 接下来 把热部署 配置一下。 这个必须要配。。。。。

先做前台的 用户登录,购票这个流程吧。  浏览了一下 携程和去哪网的 订票流程和页面还有12306的 感觉都差不多,试着扒一下 12306的页面的 ,前几天 也学了一点vue ,正好拿来练习一下。这个是html+css 静态页面 ,也贴一点吧。

<div style="width:1280px;height: auto;background-color: white;">
            <!--上面第1个大div-->
            <div style="width: 1280px;height: 80px;background-color:white;">
                <div style="width: 220px;height: 60px;background-color: red;float: left;margin-left: 40px;margin-top: 10px;background: url(img/logo.jpg);"></div>
                <div style="width: 965px;height: 60px;background-color: blue;float: right;margin-top: 20px;background: url(img/search.jpg) no-repeat;;">
                    <div style="float: left;width: 460px;height: 30px;background-color: #F8F8F8;margin-left: 130px;margin-top: 5px;">
                        <input type="text" style="width: 420px;height: 27px;border: 1px darkgray solid;position: relative;top: 2px;left: 3px;" placeholder="搜索车票/相关规章";/>
                        <img src="img/searchbtn.jpg" />
                    </div>
                    <div style="width: 180px;height: 35px;background-color:#F8F8F8;float: right;margin-right: 50px;margin-top: 2px;">
                        <ul style="list-style: none;">
<li style="float: left;margin-left: 6px;margin-top: 10px;"><a href="#" style="font-size: 13px;text-decoration: none;">我的订单 |</a></li>
                            <li style="float: left;margin-left: 6px;margin-top: 10px;"><a href="#" style="font-size: 13px;text-decoration: none;">登陆 |</a></li>
                            <li style="float: left;margin-left: 6px;margin-top: 10px;"><a href="#" style="font-size: 13px;text-decoration: none;">注册</a></li>
                        </ul>
                    </div>
                </div>
            </div>

后台把登录的功能实现一下:

@Repository
public interface UserticketMapper {

    public List<Userticket>getlist();
    public int add(Userticket userticket);
    public Userticket getbyid(int id);
    public  int delete(int id);
    public int update(Userticket userticket);
    public Userticket userlogin(Userticket userticket);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
"http://mybatis/dtd/mybatis-3-mapper.dtd">

<select id="getbyid" resultType="com.hp.entity.Userticket" parameterType="_int">
  select *from Userticket u where u.userid=#{id};
</select>

 

posted @ 2020-07-14 17:33  厨房与爱  阅读(148)  评论(0编辑  收藏  举报