├── .settings ├── org.eclipse.wst.jsdt.ui.superType.name ├── org.eclipse.wst.jsdt.ui.superType.container ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.common.component └── .jsdtscope ├── image ├── 1.jpg ├── 2.jpg ├── 3.jpg ├── 4.jpg ├── 5.jpg ├── 6.jpg ├── 7.jpg ├── fdrwio1x5mq.jpg ├── sdpztep04rd.jpg ├── vflm4h1bmo1.jpg ├── yr2m2auqjfp.jpg ├── zedgffrz0k2.jpg ├── zenwu0peuby.jpg └── zfjh0frlnrq.jpg ├── limage ├── 1.png └── 2.png ├── .idea ├── compiler.xml ├── encodings.xml ├── modules.xml ├── misc.xml ├── libraries │ └── lib.xml ├── artifacts │ └── house_war_exploded.xml ├── $CACHE_FILE$ └── workspace.xml ├── src ├── log4j.properties ├── com │ ├── entity │ │ ├── Area.java │ │ ├── Admin.java │ │ ├── Notice.java │ │ ├── Liuyan.java │ │ ├── User.java │ │ ├── Kanfang.java │ │ ├── Dingdan.java │ │ ├── Zfang.java │ │ ├── Huser.java │ │ └── Fang.java │ ├── mapper │ │ ├── UserMapper.java │ │ ├── AdminMapper.java │ │ ├── LiuyanMapper.java │ │ ├── NoticeMapper.java │ │ ├── AreaMapper.java │ │ ├── FangMapper.java │ │ ├── HuserMapper.java │ │ ├── ZfangMapper.java │ │ ├── DingdanMapper.java │ │ ├── KanfangMapper.java │ │ ├── Admin.xml │ │ ├── Area.xml │ │ ├── Notice.xml │ │ ├── Liuyan.xml │ │ ├── User.xml │ │ ├── Huser.xml │ │ ├── Kanfang.xml │ │ ├── Dingdan.xml │ │ ├── Zfang.xml │ │ └── Fang.xml │ ├── service │ │ ├── UserService.java │ │ ├── AdminService.java │ │ ├── LiuyanService.java │ │ ├── NoticeService.java │ │ ├── AreaService.java │ │ ├── FangService.java │ │ ├── HuserService.java │ │ ├── ZfangService.java │ │ ├── DingdanService.java │ │ └── KanfangService.java │ └── controller │ │ ├── indexController.java │ │ ├── AreaController.java │ │ ├── loginController.java │ │ ├── NoticeController.java │ │ ├── AdminController.java │ │ ├── UserController.java │ │ ├── LiuyanController.java │ │ ├── HuserController.java │ │ ├── ZfangController.java │ │ ├── KanfangController.java │ │ ├── DingdanController.java │ │ └── FangController.java ├── springMVC.xml └── applicationContext.xml ├── README.md └── house.iml /.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /image/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/1.jpg -------------------------------------------------------------------------------- /image/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/2.jpg -------------------------------------------------------------------------------- /image/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/3.jpg -------------------------------------------------------------------------------- /image/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/4.jpg -------------------------------------------------------------------------------- /image/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/5.jpg -------------------------------------------------------------------------------- /image/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/6.jpg -------------------------------------------------------------------------------- /image/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/7.jpg -------------------------------------------------------------------------------- /limage/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/limage/1.png -------------------------------------------------------------------------------- /limage/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/limage/2.png -------------------------------------------------------------------------------- /image/fdrwio1x5mq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/fdrwio1x5mq.jpg -------------------------------------------------------------------------------- /image/sdpztep04rd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/sdpztep04rd.jpg -------------------------------------------------------------------------------- /image/vflm4h1bmo1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/vflm4h1bmo1.jpg -------------------------------------------------------------------------------- /image/yr2m2auqjfp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/yr2m2auqjfp.jpg -------------------------------------------------------------------------------- /image/zedgffrz0k2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/zedgffrz0k2.jpg -------------------------------------------------------------------------------- /image/zenwu0peuby.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/zenwu0peuby.jpg -------------------------------------------------------------------------------- /image/zfjh0frlnrq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No326Housing-rental-management-system/HEAD/image/zfjh0frlnrq.jpg -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/libraries/lib.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.8 8 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/log4j.properties: -------------------------------------------------------------------------------- 1 | # Global logging configuration 2 | log4j.rootLogger=ERROR, stdout 3 | # MyBatis logging configuration... 4 | log4j.logger.com=TRACE 5 | 6 | # Console output... 7 | log4j.logger.com.ibatis=debug 8 | 9 | log4j.logger.java.sql.Statement=debug 10 | log4j.logger.java.sql.PreparedStatement=debug 11 | 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/com/entity/Area.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | public class Area { 4 | private Integer id; 5 | private String name; 6 | 7 | public Integer getId() 8 | { 9 | return id; 10 | } 11 | public void setId(Integer id) 12 | { 13 | this.id = id; 14 | } 15 | 16 | public String getName() 17 | { 18 | return name; 19 | } 20 | public void setName(String name) 21 | { 22 | this.name = name; 23 | } 24 | @Override 25 | 26 | public String toString() { 27 | 28 | return "Area [id=" + id + ", name=" + name + "]"; 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /src/com/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.entity.User; 6 | public interface UserMapper { 7 | //添加 8 | public int insert(User user); 9 | //删除 10 | public void delete(int id); 11 | //根据id获取数据 12 | public User get(int id); 13 | //修改 14 | public int update(User user); 15 | //列表 16 | public List list(@Param("where") String where); 17 | //分页 18 | public List sealist(@Param("where") String where); 19 | //统计 20 | public int total(); 21 | } -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/mapper/AdminMapper.java: -------------------------------------------------------------------------------- 1 | package com.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.entity.Admin; 6 | public interface AdminMapper { 7 | //添加 8 | public int insert(Admin admin); 9 | //删除 10 | public void delete(int id); 11 | //根据id获取数据 12 | public Admin get(int id); 13 | //修改 14 | public int update(Admin admin); 15 | //列表 16 | public List list(@Param("where") String where); 17 | //分页 18 | public List sealist(@Param("where") String where); 19 | //统计 20 | public int total(); 21 | } -------------------------------------------------------------------------------- /src/com/mapper/LiuyanMapper.java: -------------------------------------------------------------------------------- 1 | package com.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.entity.Liuyan; 6 | public interface LiuyanMapper { 7 | //添加 8 | public int insert(Liuyan liuyan); 9 | //删除 10 | public void delete(int id); 11 | //根据id获取数据 12 | public Liuyan get(int id); 13 | //修改 14 | public int update(Liuyan liuyan); 15 | //列表 16 | public List list(@Param("where") String where); 17 | //分页 18 | public List sealist(@Param("where") String where); 19 | //统计 20 | public int total(); 21 | 22 | } -------------------------------------------------------------------------------- /src/com/mapper/NoticeMapper.java: -------------------------------------------------------------------------------- 1 | package com.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.entity.Notice; 6 | public interface NoticeMapper { 7 | //添加 8 | public int insert(Notice notice); 9 | //删除 10 | public void delete(int id); 11 | //根据id获取数据 12 | public Notice get(int id); 13 | //修改 14 | public int update(Notice notice); 15 | //列表 16 | public List list(@Param("where") String where); 17 | //分页 18 | public List sealist(@Param("where") String where); 19 | //统计 20 | public int total(); 21 | 22 | } -------------------------------------------------------------------------------- /.idea/artifacts/house_war_exploded.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/classes/artifacts/house_war_exploded 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/com/mapper/AreaMapper.java: -------------------------------------------------------------------------------- 1 | package com.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.entity.Area; 6 | public interface AreaMapper { 7 | //添加 8 | public int insert(Area area); 9 | //删除 10 | public void delete(int id); 11 | //根据id获取数据 12 | public Area get(int id); 13 | //修改 14 | public int update(Area area); 15 | //列表 16 | public List list(@Param("where") String where); 17 | //分页 18 | public List sealist(@Param("where") String where); 19 | //统计 20 | public int total(); 21 | public void updatesql(@Param("value")String value); 22 | public void deletesql(@Param("value")String value); 23 | 24 | } -------------------------------------------------------------------------------- /src/com/entity/Admin.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | public class Admin { 4 | private Integer id; 5 | private String adminname; 6 | private String pwd; 7 | 8 | public Integer getId() 9 | { 10 | return id; 11 | } 12 | public void setId(Integer id) 13 | { 14 | this.id = id; 15 | } 16 | 17 | public String getAdminname() 18 | { 19 | return adminname; 20 | } 21 | public void setAdminname(String adminname) 22 | { 23 | this.adminname = adminname; 24 | } 25 | 26 | public String getPwd() 27 | { 28 | return pwd; 29 | } 30 | public void setPwd(String pwd) 31 | { 32 | this.pwd = pwd; 33 | } 34 | @Override 35 | 36 | public String toString() { 37 | 38 | return "Admin [id=" + id + ", adminname=" + adminname + ", pwd=" + pwd + "]"; 39 | 40 | } 41 | } -------------------------------------------------------------------------------- /src/com/mapper/FangMapper.java: -------------------------------------------------------------------------------- 1 | package com.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.entity.Fang; 6 | public interface FangMapper { 7 | //添加 8 | public int insert(Fang fang); 9 | //删除 10 | public void delete(int id); 11 | //根据id获取数据 12 | public Fang get(int id); 13 | //根据条件提取数据 14 | public Fang getsql(@Param("where") String where); 15 | //修改 16 | public int update(Fang fang); 17 | //列表 18 | public List list(@Param("where") String where); 19 | //分页 20 | public List sealist(@Param("where") String where); 21 | //统计 22 | public int total(@Param("where") String where); 23 | public void updatesql(@Param("value") String value); 24 | public void deletesql(@Param("value") String value); 25 | 26 | } -------------------------------------------------------------------------------- /src/com/mapper/HuserMapper.java: -------------------------------------------------------------------------------- 1 | package com.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.entity.Huser; 6 | public interface HuserMapper { 7 | //添加 8 | public int insert(Huser huser); 9 | //删除 10 | public void delete(int id); 11 | //根据id获取数据 12 | public Huser get(int id); 13 | //根据条件提取数据 14 | public Huser getsql(@Param("where") String where); 15 | //修改 16 | public int update(Huser huser); 17 | //列表 18 | public List list(@Param("where") String where); 19 | //分页 20 | public List sealist(@Param("where") String where); 21 | //统计 22 | public int total(@Param("where") String where); 23 | public void updatesql(@Param("value") String value); 24 | public void deletesql(@Param("value") String value); 25 | 26 | } -------------------------------------------------------------------------------- /src/com/mapper/ZfangMapper.java: -------------------------------------------------------------------------------- 1 | package com.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.entity.Zfang; 6 | public interface ZfangMapper { 7 | //添加 8 | public int insert(Zfang zfang); 9 | //删除 10 | public void delete(int id); 11 | //根据id获取数据 12 | public Zfang get(int id); 13 | //根据条件提取数据 14 | public Zfang getsql(@Param("where") String where); 15 | //修改 16 | public int update(Zfang zfang); 17 | //列表 18 | public List list(@Param("where") String where); 19 | //分页 20 | public List sealist(@Param("where") String where); 21 | //统计 22 | public int total(@Param("where") String where); 23 | public void updatesql(@Param("value") String value); 24 | public void deletesql(@Param("value") String value); 25 | 26 | } -------------------------------------------------------------------------------- /src/com/mapper/DingdanMapper.java: -------------------------------------------------------------------------------- 1 | package com.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.entity.Dingdan; 6 | public interface DingdanMapper { 7 | //添加 8 | public int insert(Dingdan dingdan); 9 | //删除 10 | public void delete(int id); 11 | //根据id获取数据 12 | public Dingdan get(int id); 13 | //根据条件提取数据 14 | public Dingdan getsql(@Param("where") String where); 15 | //修改 16 | public int update(Dingdan dingdan); 17 | //列表 18 | public List list(@Param("where") String where); 19 | //分页 20 | public List sealist(@Param("where") String where); 21 | //统计 22 | public int total(@Param("where") String where); 23 | public void updatesql(@Param("value") String value); 24 | public void deletesql(@Param("value") String value); 25 | 26 | } -------------------------------------------------------------------------------- /src/com/mapper/KanfangMapper.java: -------------------------------------------------------------------------------- 1 | package com.mapper; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import com.entity.Kanfang; 6 | public interface KanfangMapper { 7 | //添加 8 | public int insert(Kanfang kanfang); 9 | //删除 10 | public void delete(int id); 11 | //根据id获取数据 12 | public Kanfang get(int id); 13 | //根据条件提取数据 14 | public Kanfang getsql(@Param("where") String where); 15 | //修改 16 | public int update(Kanfang kanfang); 17 | //列表 18 | public List list(@Param("where") String where); 19 | //分页 20 | public List sealist(@Param("where") String where); 21 | //统计 22 | public int total(@Param("where") String where); 23 | public void updatesql(@Param("value") String value); 24 | public void deletesql(@Param("value") String value); 25 | 26 | } -------------------------------------------------------------------------------- /src/com/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.entity.User; 6 | import com.mapper.UserMapper; 7 | @Service 8 | public class UserService{ 9 | @Autowired 10 | UserMapper userMapper; 11 | 12 | public List list(String where){ 13 | return userMapper.list(where); 14 | } 15 | public List sealist(String where) { 16 | // TODO Auto-generated method stub 17 | return userMapper.list(where); 18 | } 19 | 20 | public int total() { 21 | return userMapper.total(); 22 | } 23 | 24 | 25 | public void insert(User c) { 26 | userMapper.insert(c); 27 | 28 | } 29 | 30 | 31 | public void update(User c) { 32 | userMapper.update(c); 33 | } 34 | 35 | 36 | public void delete(User c) { 37 | userMapper.delete(c.getId()); 38 | } 39 | 40 | 41 | public User get(int id) { 42 | // TODO Auto-generated method stub 43 | return userMapper.get(id); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/com/service/AdminService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.entity.Admin; 6 | import com.mapper.AdminMapper; 7 | @Service 8 | public class AdminService{ 9 | @Autowired 10 | AdminMapper adminMapper; 11 | 12 | public List list(String where){ 13 | return adminMapper.list(where); 14 | } 15 | public List sealist(String where) { 16 | // TODO Auto-generated method stub 17 | return adminMapper.list(where); 18 | } 19 | 20 | public int total() { 21 | return adminMapper.total(); 22 | } 23 | 24 | 25 | public void insert(Admin c) { 26 | adminMapper.insert(c); 27 | 28 | } 29 | 30 | 31 | public void update(Admin c) { 32 | adminMapper.update(c); 33 | } 34 | 35 | 36 | public void delete(Admin c) { 37 | adminMapper.delete(c.getId()); 38 | } 39 | 40 | 41 | public Admin get(int id) { 42 | // TODO Auto-generated method stub 43 | return adminMapper.get(id); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/com/service/LiuyanService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.entity.Liuyan; 6 | import com.mapper.LiuyanMapper; 7 | @Service 8 | public class LiuyanService{ 9 | @Autowired 10 | LiuyanMapper liuyanMapper; 11 | 12 | public List list(String where){ 13 | return liuyanMapper.list(where); 14 | } 15 | public List sealist(String where) { 16 | // TODO Auto-generated method stub 17 | return liuyanMapper.list(where); 18 | } 19 | 20 | public int total() { 21 | return liuyanMapper.total(); 22 | } 23 | 24 | 25 | public void insert(Liuyan c) { 26 | liuyanMapper.insert(c); 27 | 28 | } 29 | 30 | 31 | public void update(Liuyan c) { 32 | liuyanMapper.update(c); 33 | } 34 | 35 | 36 | public void delete(Liuyan c) { 37 | liuyanMapper.delete(c.getId()); 38 | } 39 | 40 | 41 | public Liuyan get(int id) { 42 | // TODO Auto-generated method stub 43 | return liuyanMapper.get(id); 44 | } 45 | 46 | 47 | } -------------------------------------------------------------------------------- /src/com/service/NoticeService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.entity.Notice; 6 | import com.mapper.NoticeMapper; 7 | @Service 8 | public class NoticeService{ 9 | @Autowired 10 | NoticeMapper noticeMapper; 11 | 12 | public List list(String where){ 13 | return noticeMapper.list(where); 14 | } 15 | public List sealist(String where) { 16 | // TODO Auto-generated method stub 17 | return noticeMapper.list(where); 18 | } 19 | 20 | public int total() { 21 | return noticeMapper.total(); 22 | } 23 | 24 | 25 | public void insert(Notice c) { 26 | noticeMapper.insert(c); 27 | 28 | } 29 | 30 | 31 | public void update(Notice c) { 32 | noticeMapper.update(c); 33 | } 34 | 35 | 36 | public void delete(Notice c) { 37 | noticeMapper.delete(c.getId()); 38 | } 39 | 40 | 41 | public Notice get(int id) { 42 | // TODO Auto-generated method stub 43 | return noticeMapper.get(id); 44 | } 45 | 46 | 47 | } -------------------------------------------------------------------------------- /src/com/entity/Notice.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | public class Notice { 4 | private Integer id; 5 | private String title; 6 | private String pic; 7 | private String neirong; 8 | private String addtime; 9 | 10 | public Integer getId() 11 | { 12 | return id; 13 | } 14 | public void setId(Integer id) 15 | { 16 | this.id = id; 17 | } 18 | 19 | public String getTitle() 20 | { 21 | return title; 22 | } 23 | public void setTitle(String title) 24 | { 25 | this.title = title; 26 | } 27 | 28 | public String getPic() 29 | { 30 | return pic; 31 | } 32 | public void setPic(String pic) 33 | { 34 | this.pic = pic; 35 | } 36 | 37 | public String getNeirong() 38 | { 39 | return neirong; 40 | } 41 | public void setNeirong(String neirong) 42 | { 43 | this.neirong = neirong; 44 | } 45 | 46 | public String getAddtime() 47 | { 48 | return addtime; 49 | } 50 | public void setAddtime(String addtime) 51 | { 52 | this.addtime = addtime; 53 | } 54 | @Override 55 | 56 | public String toString() { 57 | 58 | return "Notice [id=" + id + ", title=" + title + ", pic=" + pic + ", neirong=" + neirong + ", addtime=" + addtime + "]"; 59 | 60 | } 61 | } -------------------------------------------------------------------------------- /src/com/service/AreaService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.entity.Area; 6 | import com.mapper.AreaMapper; 7 | @Service 8 | public class AreaService{ 9 | @Autowired 10 | AreaMapper areaMapper; 11 | 12 | public List list(String where){ 13 | return areaMapper.list(where); 14 | } 15 | public List sealist(String where) { 16 | // TODO Auto-generated method stub 17 | return areaMapper.sealist(where); 18 | } 19 | 20 | public int total() { 21 | return areaMapper.total(); 22 | } 23 | 24 | 25 | public void insert(Area c) { 26 | areaMapper.insert(c); 27 | 28 | } 29 | 30 | 31 | public void update(Area c) { 32 | areaMapper.update(c); 33 | } 34 | 35 | 36 | public void delete(Area c) { 37 | areaMapper.delete(c.getId()); 38 | } 39 | 40 | 41 | public Area get(int id) { 42 | // TODO Auto-generated method stub 43 | return areaMapper.get(id); 44 | } 45 | 46 | public void updatesql(String value) { 47 | areaMapper.updatesql(value); 48 | } 49 | public void deletesql(String value) { 50 | areaMapper.deletesql(value); 51 | } 52 | } -------------------------------------------------------------------------------- /src/com/service/FangService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.entity.Fang; 6 | import com.mapper.FangMapper; 7 | @Service 8 | public class FangService{ 9 | @Autowired 10 | FangMapper fangMapper; 11 | 12 | public List list(String where){ 13 | return fangMapper.list(where); 14 | } 15 | public List sealist(String where) { 16 | // TODO Auto-generated method stub 17 | return fangMapper.sealist(where); 18 | } 19 | public int total(String where) { 20 | return fangMapper.total(where); 21 | } 22 | 23 | public void insert(Fang c) { 24 | fangMapper.insert(c); 25 | 26 | } 27 | public void update(Fang c) { 28 | fangMapper.update(c); 29 | } 30 | 31 | 32 | public void delete(Fang c) { 33 | fangMapper.delete(c.getId()); 34 | } 35 | 36 | 37 | public Fang get(int id) { 38 | // TODO Auto-generated method stub 39 | return fangMapper.get(id); 40 | } 41 | public Fang getsql(String where) { 42 | return fangMapper.getsql(where); 43 | } 44 | public void updatesql(String value) { 45 | fangMapper.updatesql(value); 46 | } 47 | public void deletesql(String value) { 48 | fangMapper.deletesql(value); 49 | } 50 | } -------------------------------------------------------------------------------- /src/com/service/HuserService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.entity.Huser; 6 | import com.mapper.HuserMapper; 7 | @Service 8 | public class HuserService{ 9 | @Autowired 10 | HuserMapper huserMapper; 11 | 12 | public List list(String where){ 13 | return huserMapper.list(where); 14 | } 15 | public List sealist(String where) { 16 | // TODO Auto-generated method stub 17 | return huserMapper.sealist(where); 18 | } 19 | public int total(String where) { 20 | return huserMapper.total(where); 21 | } 22 | 23 | public void insert(Huser c) { 24 | huserMapper.insert(c); 25 | 26 | } 27 | public void update(Huser c) { 28 | huserMapper.update(c); 29 | } 30 | 31 | 32 | public void delete(Huser c) { 33 | huserMapper.delete(c.getId()); 34 | } 35 | 36 | 37 | public Huser get(int id) { 38 | // TODO Auto-generated method stub 39 | return huserMapper.get(id); 40 | } 41 | public Huser getsql(String where) { 42 | return huserMapper.getsql(where); 43 | } 44 | public void updatesql(String value) { 45 | huserMapper.updatesql(value); 46 | } 47 | public void deletesql(String value) { 48 | huserMapper.deletesql(value); 49 | } 50 | } -------------------------------------------------------------------------------- /src/com/service/ZfangService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.entity.Zfang; 6 | import com.mapper.ZfangMapper; 7 | @Service 8 | public class ZfangService{ 9 | @Autowired 10 | ZfangMapper zfangMapper; 11 | 12 | public List list(String where){ 13 | return zfangMapper.list(where); 14 | } 15 | public List sealist(String where) { 16 | // TODO Auto-generated method stub 17 | return zfangMapper.sealist(where); 18 | } 19 | public int total(String where) { 20 | return zfangMapper.total(where); 21 | } 22 | 23 | public void insert(Zfang c) { 24 | zfangMapper.insert(c); 25 | 26 | } 27 | public void update(Zfang c) { 28 | zfangMapper.update(c); 29 | } 30 | 31 | 32 | public void delete(Zfang c) { 33 | zfangMapper.delete(c.getId()); 34 | } 35 | 36 | 37 | public Zfang get(int id) { 38 | // TODO Auto-generated method stub 39 | return zfangMapper.get(id); 40 | } 41 | public Zfang getsql(String where) { 42 | return zfangMapper.getsql(where); 43 | } 44 | public void updatesql(String value) { 45 | zfangMapper.updatesql(value); 46 | } 47 | public void deletesql(String value) { 48 | zfangMapper.deletesql(value); 49 | } 50 | } -------------------------------------------------------------------------------- /src/com/service/DingdanService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.entity.Dingdan; 6 | import com.mapper.DingdanMapper; 7 | @Service 8 | public class DingdanService{ 9 | @Autowired 10 | DingdanMapper dingdanMapper; 11 | 12 | public List list(String where){ 13 | return dingdanMapper.list(where); 14 | } 15 | public List sealist(String where) { 16 | // TODO Auto-generated method stub 17 | return dingdanMapper.sealist(where); 18 | } 19 | public int total(String where) { 20 | return dingdanMapper.total(where); 21 | } 22 | 23 | public void insert(Dingdan c) { 24 | dingdanMapper.insert(c); 25 | 26 | } 27 | public void update(Dingdan c) { 28 | dingdanMapper.update(c); 29 | } 30 | 31 | 32 | public void delete(Dingdan c) { 33 | dingdanMapper.delete(c.getId()); 34 | } 35 | 36 | 37 | public Dingdan get(int id) { 38 | // TODO Auto-generated method stub 39 | return dingdanMapper.get(id); 40 | } 41 | public Dingdan getsql(String where) { 42 | return dingdanMapper.getsql(where); 43 | } 44 | public void updatesql(String value) { 45 | dingdanMapper.updatesql(value); 46 | } 47 | public void deletesql(String value) { 48 | dingdanMapper.deletesql(value); 49 | } 50 | } -------------------------------------------------------------------------------- /src/com/service/KanfangService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import com.entity.Kanfang; 6 | import com.mapper.KanfangMapper; 7 | @Service 8 | public class KanfangService{ 9 | @Autowired 10 | KanfangMapper kanfangMapper; 11 | 12 | public List list(String where){ 13 | return kanfangMapper.list(where); 14 | } 15 | public List sealist(String where) { 16 | // TODO Auto-generated method stub 17 | return kanfangMapper.sealist(where); 18 | } 19 | public int total(String where) { 20 | return kanfangMapper.total(where); 21 | } 22 | 23 | public void insert(Kanfang c) { 24 | kanfangMapper.insert(c); 25 | 26 | } 27 | public void update(Kanfang c) { 28 | kanfangMapper.update(c); 29 | } 30 | 31 | 32 | public void delete(Kanfang c) { 33 | kanfangMapper.delete(c.getId()); 34 | } 35 | 36 | 37 | public Kanfang get(int id) { 38 | // TODO Auto-generated method stub 39 | return kanfangMapper.get(id); 40 | } 41 | public Kanfang getsql(String where) { 42 | return kanfangMapper.getsql(where); 43 | } 44 | public void updatesql(String value) { 45 | kanfangMapper.updatesql(value); 46 | } 47 | public void deletesql(String value) { 48 | kanfangMapper.deletesql(value); 49 | } 50 | } -------------------------------------------------------------------------------- /src/com/mapper/Admin.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | insert into admin (adminname,pwd) values (#{adminname},#{pwd}) 14 | 15 | 16 | update admin set adminname=#{adminname},pwd=#{pwd} where id=#{id} 17 | 18 | 19 | delete from admin where id= #{id} 20 | 21 | 24 | 27 | 30 | 33 | -------------------------------------------------------------------------------- /src/com/mapper/Area.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | insert into area (name) values (#{name}) 13 | 14 | 15 | update area set name=#{name} where id=#{id} 16 | 17 | 18 | delete from area where id= #{id} 19 | 20 | 23 | 26 | 29 | 32 | 33 | ${value} 34 | 35 | 36 | ${value} 37 | 38 | -------------------------------------------------------------------------------- /src/com/entity/Liuyan.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | public class Liuyan { 4 | private Integer id; 5 | private String title; 6 | private String neirong; 7 | private String huifu; 8 | private String uname; 9 | private String addtime; 10 | 11 | public Integer getId() 12 | { 13 | return id; 14 | } 15 | public void setId(Integer id) 16 | { 17 | this.id = id; 18 | } 19 | 20 | public String getTitle() 21 | { 22 | return title; 23 | } 24 | public void setTitle(String title) 25 | { 26 | this.title = title; 27 | } 28 | 29 | public String getNeirong() 30 | { 31 | return neirong; 32 | } 33 | public void setNeirong(String neirong) 34 | { 35 | this.neirong = neirong; 36 | } 37 | 38 | public String getHuifu() 39 | { 40 | return huifu; 41 | } 42 | public void setHuifu(String huifu) 43 | { 44 | this.huifu = huifu; 45 | } 46 | 47 | public String getUname() 48 | { 49 | return uname; 50 | } 51 | public void setUname(String uname) 52 | { 53 | this.uname = uname; 54 | } 55 | 56 | public String getAddtime() 57 | { 58 | return addtime; 59 | } 60 | public void setAddtime(String addtime) 61 | { 62 | this.addtime = addtime; 63 | } 64 | @Override 65 | 66 | public String toString() { 67 | 68 | return "Liuyan [id=" + id + ", title=" + title + ", neirong=" + neirong + ", huifu=" + huifu + ", uname=" + uname + ", addtime=" + addtime + "]"; 69 | 70 | } 71 | } -------------------------------------------------------------------------------- /src/com/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | public class User { 4 | private Integer id; 5 | private String username; 6 | private String pwd; 7 | private String sex; 8 | private String name; 9 | private String tel; 10 | private String zt; 11 | 12 | public Integer getId() 13 | { 14 | return id; 15 | } 16 | public void setId(Integer id) 17 | { 18 | this.id = id; 19 | } 20 | 21 | public String getUsername() 22 | { 23 | return username; 24 | } 25 | public void setUsername(String username) 26 | { 27 | this.username = username; 28 | } 29 | 30 | public String getPwd() 31 | { 32 | return pwd; 33 | } 34 | public void setPwd(String pwd) 35 | { 36 | this.pwd = pwd; 37 | } 38 | 39 | public String getSex() 40 | { 41 | return sex; 42 | } 43 | public void setSex(String sex) 44 | { 45 | this.sex = sex; 46 | } 47 | 48 | public String getName() 49 | { 50 | return name; 51 | } 52 | public void setName(String name) 53 | { 54 | this.name = name; 55 | } 56 | 57 | public String getTel() 58 | { 59 | return tel; 60 | } 61 | public void setTel(String tel) 62 | { 63 | this.tel = tel; 64 | } 65 | 66 | public String getZt() 67 | { 68 | return zt; 69 | } 70 | public void setZt(String zt) 71 | { 72 | this.zt = zt; 73 | } 74 | @Override 75 | 76 | public String toString() { 77 | 78 | return "User [id=" + id + ", username=" + username + ", pwd=" + pwd + ", sex=" + sex + ", name=" + name + ", tel=" + tel + ", zt=" + zt + "]"; 79 | 80 | } 81 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 基于SSM的房屋出租租赁管理系统(程序+论文) 2 | = 3 | ### 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/)) 4 | ### 作者微信:19941326836 QQ:952045282 5 | ### 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习 6 | ### 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务 7 | ### 所有选题地址https://github.com/nature924/allProject 8 | 9 | 一、项目介绍 10 | --- 11 | 基于SSM框架的房屋出租租赁管理系统,系统分为用户,管理员,房屋中介三个角色:,主要功能如下 12 | 13 | ### 14 | 用户功能: 15 | (1)用户可以登录和注册系统 16 | (2)用户可以查看系统的相关新闻和公告信息 17 | (3)用户查看房屋的出售信息,可以在线订购房屋,输入订购的相关信息,生产订购单 18 | (4)用户查看房屋的出租信息,可以在线预约看房 19 | (5)用户可以发布在线留言信息 20 | (6)用户修改个人资料信息 21 | 房屋中介: 22 | (1)中介发布和管理房屋的出租信息,信息需要管理员审核 23 | (2)中介发布和管理房屋的出售信息,信息需要管理员审核 24 | (3)中介查看用户房屋购买的订单 25 | (4)中介查看用户的预约看房的信息 26 | (5)中介修改个人资料信息 27 | ### 28 | 管理员: 29 | (1)管理员登录系统后台 30 | (2)管理员管理房屋的区域位置信息 31 | (3)管理员对中介发布的出售和出租房屋信息进行审核 32 | (4)管理员管理用户的留言信息进行管理 33 | (5)管理员对网站新闻公告的信息进行管理 34 | (6)管理员可以对添加别的管理员登录后台 35 | (7)管理员对房屋中介账户信息进行管理 36 | (8)管理员对系统注册的用户进行管理 37 | 38 | 39 | 40 | 41 | 二、项目技术 42 | --- 43 | - 编程语言:Java 44 | - 数据库:MySQL 45 | - 项目管理工具:Maven 46 | - 前端技术:JSP、HTML、Jquery、Layui、ECharts 47 | - 后端技术:Spring、SpringMVC、MyBatis 48 | 49 | 三、运行环境 50 | --- 51 | - 操作系统:Windows、macOS都可以 52 | - JDK版本:JDK1.8以上都可以 53 | - 开发工具:IDEA、Ecplise、Myecplise都可以 54 | - 数据库: MySQL5.7以上都可以 55 | - Tomcat:任意版本都可以 56 | - Maven:任意版本都可以 57 | 58 | 四、运行截图 59 | --- 60 | ### 论文截图: 61 | ![image/1.png](limage/1.png) 62 | ![image/1.png](limage/2.png) 63 | 64 | ### 程序截图: 65 | ![image/1.png](image/1.jpg) 66 | ![image/1.png](image/2.jpg) 67 | ![image/1.png](image/3.jpg) 68 | ![image/1.png](image/4.jpg) 69 | ![image/1.png](image/5.jpg) 70 | ![image/1.png](image/6.jpg) 71 | ![image/1.png](image/7.jpg) 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /src/com/controller/indexController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | import java.util.List; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.ui.Model; 9 | 10 | import com.entity.Fang; 11 | import com.entity.Notice; 12 | import com.entity.Zfang; 13 | import com.service.FangService; 14 | import com.service.NoticeService; 15 | import com.service.ZfangService; 16 | import com.util.Page; 17 | import com.util.Pagesize; 18 | import com.util.Pagination; 19 | //告诉spring mvc这是一个控制器类 20 | @Controller 21 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 22 | @RequestMapping("") 23 | public class indexController { 24 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 25 | @Autowired 26 | NoticeService noticeService; 27 | @Autowired 28 | ZfangService zfangService; 29 | @Autowired 30 | FangService fangService; 31 | @Autowired 32 | HttpServletRequest request; 33 | //首页 34 | @RequestMapping("index") 35 | public String indexAll(Model model){ 36 | HttpSession session=request.getSession(); 37 | 38 | String w=""; 39 | List cs= noticeService.list(w); 40 | 41 | if(cs.size()>8) 42 | { 43 | cs=cs.subList(0, 8); 44 | } 45 | model.addAttribute("indexlist", cs); 46 | List cs1= fangService.list(" and zt='已审核'"); 47 | model.addAttribute("fang", cs1); 48 | List zcs= zfangService.list(" and zt='已审核'"); 49 | model.addAttribute("zcs", zcs); 50 | 51 | //session.setAttribute("seacs", seacs); 52 | 53 | 54 | // 放入转发参数 55 | return "pages/index"; 56 | } 57 | 58 | 59 | } -------------------------------------------------------------------------------- /src/com/entity/Kanfang.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | public class Kanfang { 4 | private Integer id; 5 | private Integer zfang; 6 | private Zfang zfangfk; 7 | private String sdate; 8 | private String tel; 9 | private String beizhu; 10 | private String sname; 11 | private String uname; 12 | private String zt; 13 | 14 | public Integer getId() 15 | { 16 | return id; 17 | } 18 | public void setId(Integer id) 19 | { 20 | this.id = id; 21 | } 22 | 23 | public Integer getZfang() 24 | { 25 | return zfang; 26 | } 27 | public void setZfang(Integer zfang) 28 | { 29 | this.zfang = zfang; 30 | } 31 | 32 | public Zfang getZfangfk() { 33 | return zfangfk; 34 | } 35 | public void setZfangfk(Zfang zfangfk) { 36 | this.zfangfk = zfangfk; 37 | } 38 | public String getSdate() 39 | { 40 | return sdate; 41 | } 42 | public void setSdate(String sdate) 43 | { 44 | this.sdate = sdate; 45 | } 46 | 47 | public String getTel() 48 | { 49 | return tel; 50 | } 51 | public void setTel(String tel) 52 | { 53 | this.tel = tel; 54 | } 55 | 56 | public String getBeizhu() 57 | { 58 | return beizhu; 59 | } 60 | public void setBeizhu(String beizhu) 61 | { 62 | this.beizhu = beizhu; 63 | } 64 | 65 | public String getSname() 66 | { 67 | return sname; 68 | } 69 | public void setSname(String sname) 70 | { 71 | this.sname = sname; 72 | } 73 | 74 | public String getUname() 75 | { 76 | return uname; 77 | } 78 | public void setUname(String uname) 79 | { 80 | this.uname = uname; 81 | } 82 | 83 | public String getZt() 84 | { 85 | return zt; 86 | } 87 | public void setZt(String zt) 88 | { 89 | this.zt = zt; 90 | } 91 | @Override 92 | 93 | public String toString() { 94 | 95 | return "Kanfang [id=" + id + ", zfang=" + zfang + ", sdate=" + sdate + ", tel=" + tel + ", beizhu=" + beizhu + ", sname=" + sname + ", uname=" + uname + ", zt=" + zt + "]"; 96 | 97 | } 98 | } -------------------------------------------------------------------------------- /src/com/mapper/Notice.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | insert into notice 16 | 17 | title, 18 | pic, 19 | neirong, 20 | addtime, 21 | 22 | 23 | #{title}, 24 | #{pic}, 25 | #{neirong}, 26 | #{addtime}, 27 | 28 | 29 | 30 | update notice 31 | 32 | title=#{title}, 33 | pic=#{pic}, 34 | neirong=#{neirong}, 35 | addtime=#{addtime}, 36 | 37 | where id=#{id} 38 | 39 | 40 | delete from notice where id= #{id} 41 | 42 | 45 | 48 | 51 | 54 | -------------------------------------------------------------------------------- /src/springMVC.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/com/mapper/Liuyan.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | insert into liuyan 17 | 18 | title, 19 | neirong, 20 | huifu, 21 | uname, 22 | addtime, 23 | 24 | 25 | #{title}, 26 | #{neirong}, 27 | #{huifu}, 28 | #{uname}, 29 | #{addtime}, 30 | 31 | 32 | 33 | update liuyan 34 | 35 | title=#{title}, 36 | neirong=#{neirong}, 37 | huifu=#{huifu}, 38 | uname=#{uname}, 39 | addtime=#{addtime}, 40 | 41 | where id=#{id} 42 | 43 | 44 | delete from liuyan where id= #{id} 45 | 46 | 49 | 52 | 55 | 58 | -------------------------------------------------------------------------------- /house.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | file://$MODULE_DIR$/src/applicationContext.xml 26 | file://$MODULE_DIR$/WebContent/WEB-INF/classes/applicationContext.xml 27 | file://$MODULE_DIR$/src/springMVC.xml 28 | file://$MODULE_DIR$/WebContent/WEB-INF/classes/springMVC.xml 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/com/mapper/User.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | insert into user 18 | 19 | username, 20 | pwd, 21 | sex, 22 | name, 23 | tel, 24 | zt, 25 | 26 | 27 | #{username}, 28 | #{pwd}, 29 | #{sex}, 30 | #{name}, 31 | #{tel}, 32 | #{zt}, 33 | 34 | 35 | 36 | update user 37 | 38 | username=#{username}, 39 | pwd=#{pwd}, 40 | sex=#{sex}, 41 | name=#{name}, 42 | tel=#{tel}, 43 | zt=#{zt}, 44 | 45 | where id=#{id} 46 | 47 | 48 | delete from user where id= #{id} 49 | 50 | 53 | 56 | 59 | 62 | -------------------------------------------------------------------------------- /src/com/entity/Dingdan.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | public class Dingdan { 4 | private Integer id; 5 | private Integer fang; 6 | private Fang fangfk; 7 | private String orderid; 8 | private String jiage; 9 | private String yajin; 10 | private String sdate; 11 | private String tel; 12 | private String beizhu; 13 | private String uname; 14 | private String sname; 15 | private String zt; 16 | 17 | public Integer getId() 18 | { 19 | return id; 20 | } 21 | public void setId(Integer id) 22 | { 23 | this.id = id; 24 | } 25 | 26 | public Integer getFang() 27 | { 28 | return fang; 29 | } 30 | public void setFang(Integer fang) 31 | { 32 | this.fang = fang; 33 | } 34 | 35 | public Fang getFangfk() { 36 | return fangfk; 37 | } 38 | public void setFangfk(Fang fangfk) { 39 | this.fangfk = fangfk; 40 | } 41 | public String getOrderid() 42 | { 43 | return orderid; 44 | } 45 | public void setOrderid(String orderid) 46 | { 47 | this.orderid = orderid; 48 | } 49 | 50 | public String getJiage() 51 | { 52 | return jiage; 53 | } 54 | public void setJiage(String jiage) 55 | { 56 | this.jiage = jiage; 57 | } 58 | 59 | public String getYajin() 60 | { 61 | return yajin; 62 | } 63 | public void setYajin(String yajin) 64 | { 65 | this.yajin = yajin; 66 | } 67 | 68 | public String getSdate() 69 | { 70 | return sdate; 71 | } 72 | public void setSdate(String sdate) 73 | { 74 | this.sdate = sdate; 75 | } 76 | 77 | public String getTel() 78 | { 79 | return tel; 80 | } 81 | public void setTel(String tel) 82 | { 83 | this.tel = tel; 84 | } 85 | 86 | public String getBeizhu() 87 | { 88 | return beizhu; 89 | } 90 | public void setBeizhu(String beizhu) 91 | { 92 | this.beizhu = beizhu; 93 | } 94 | 95 | public String getUname() 96 | { 97 | return uname; 98 | } 99 | public void setUname(String uname) 100 | { 101 | this.uname = uname; 102 | } 103 | 104 | public String getSname() 105 | { 106 | return sname; 107 | } 108 | public void setSname(String sname) 109 | { 110 | this.sname = sname; 111 | } 112 | 113 | public String getZt() 114 | { 115 | return zt; 116 | } 117 | public void setZt(String zt) 118 | { 119 | this.zt = zt; 120 | } 121 | @Override 122 | 123 | public String toString() { 124 | 125 | return "Dingdan [id=" + id + ", fang=" + fang + ", orderid=" + orderid + ", jiage=" + jiage + ", yajin=" + yajin + ", sdate=" + sdate + ", tel=" + tel + ", beizhu=" + beizhu + ", uname=" + uname + ", sname=" + sname + ", zt=" + zt + "]"; 126 | 127 | } 128 | } -------------------------------------------------------------------------------- /src/com/mapper/Huser.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | insert into huser 19 | 20 | username, 21 | pwd, 22 | name, 23 | sex, 24 | tel, 25 | addr, 26 | zt, 27 | 28 | 29 | #{username}, 30 | #{pwd}, 31 | #{name}, 32 | #{sex}, 33 | #{tel}, 34 | #{addr}, 35 | #{zt}, 36 | 37 | 38 | 39 | update huser 40 | 41 | username=#{username}, 42 | pwd=#{pwd}, 43 | name=#{name}, 44 | sex=#{sex}, 45 | tel=#{tel}, 46 | addr=#{addr}, 47 | zt=#{zt}, 48 | 49 | where id=#{id} 50 | 51 | 52 | delete from huser where id= #{id} 53 | 54 | 57 | 60 | 63 | 66 | 69 | ${value} 70 | 71 | 72 | ${value} 73 | 74 | -------------------------------------------------------------------------------- /src/com/entity/Zfang.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | public class Zfang { 4 | private Integer id; 5 | private String name; 6 | private String pic; 7 | private String addr; 8 | private String mianji; 9 | private String louceng; 10 | private String chaoxiang; 11 | private String jiaju; 12 | private String jiage; 13 | private String tel; 14 | private String jieshao; 15 | private String stime; 16 | private String zt; 17 | private String uname; 18 | 19 | public Integer getId() 20 | { 21 | return id; 22 | } 23 | public void setId(Integer id) 24 | { 25 | this.id = id; 26 | } 27 | 28 | public String getName() 29 | { 30 | return name; 31 | } 32 | public void setName(String name) 33 | { 34 | this.name = name; 35 | } 36 | 37 | public String getPic() 38 | { 39 | return pic; 40 | } 41 | public void setPic(String pic) 42 | { 43 | this.pic = pic; 44 | } 45 | 46 | public String getAddr() 47 | { 48 | return addr; 49 | } 50 | public void setAddr(String addr) 51 | { 52 | this.addr = addr; 53 | } 54 | 55 | public String getMianji() 56 | { 57 | return mianji; 58 | } 59 | public void setMianji(String mianji) 60 | { 61 | this.mianji = mianji; 62 | } 63 | 64 | public String getLouceng() 65 | { 66 | return louceng; 67 | } 68 | public void setLouceng(String louceng) 69 | { 70 | this.louceng = louceng; 71 | } 72 | 73 | public String getChaoxiang() 74 | { 75 | return chaoxiang; 76 | } 77 | public void setChaoxiang(String chaoxiang) 78 | { 79 | this.chaoxiang = chaoxiang; 80 | } 81 | 82 | public String getJiaju() 83 | { 84 | return jiaju; 85 | } 86 | public void setJiaju(String jiaju) 87 | { 88 | this.jiaju = jiaju; 89 | } 90 | 91 | public String getJiage() 92 | { 93 | return jiage; 94 | } 95 | public void setJiage(String jiage) 96 | { 97 | this.jiage = jiage; 98 | } 99 | 100 | public String getTel() 101 | { 102 | return tel; 103 | } 104 | public void setTel(String tel) 105 | { 106 | this.tel = tel; 107 | } 108 | 109 | public String getJieshao() 110 | { 111 | return jieshao; 112 | } 113 | public void setJieshao(String jieshao) 114 | { 115 | this.jieshao = jieshao; 116 | } 117 | 118 | public String getStime() 119 | { 120 | return stime; 121 | } 122 | public void setStime(String stime) 123 | { 124 | this.stime = stime; 125 | } 126 | 127 | public String getZt() 128 | { 129 | return zt; 130 | } 131 | public void setZt(String zt) 132 | { 133 | this.zt = zt; 134 | } 135 | 136 | public String getUname() 137 | { 138 | return uname; 139 | } 140 | public void setUname(String uname) 141 | { 142 | this.uname = uname; 143 | } 144 | @Override 145 | 146 | public String toString() { 147 | 148 | return "Zfang [id=" + id + ", name=" + name + ", pic=" + pic + ", addr=" + addr + ", mianji=" + mianji + ", louceng=" + louceng + ", chaoxiang=" + chaoxiang + ", jiaju=" + jiaju + ", jiage=" + jiage + ", tel=" + tel + ", jieshao=" + jieshao + ", stime=" + stime + ", zt=" + zt + ", uname=" + uname + "]"; 149 | 150 | } 151 | } -------------------------------------------------------------------------------- /src/com/mapper/Kanfang.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | insert into kanfang 21 | 22 | zfang, 23 | sdate, 24 | tel, 25 | beizhu, 26 | sname, 27 | uname, 28 | zt, 29 | 30 | 31 | #{zfang}, 32 | #{sdate}, 33 | #{tel}, 34 | #{beizhu}, 35 | #{sname}, 36 | #{uname}, 37 | #{zt}, 38 | 39 | 40 | 41 | update kanfang 42 | 43 | zfang=#{zfang}, 44 | sdate=#{sdate}, 45 | tel=#{tel}, 46 | beizhu=#{beizhu}, 47 | sname=#{sname}, 48 | uname=#{uname}, 49 | zt=#{zt}, 50 | 51 | where id=#{id} 52 | 53 | 54 | delete from kanfang where id= #{id} 55 | 56 | 59 | 62 | 65 | 68 | 71 | ${value} 72 | 73 | 74 | ${value} 75 | 76 | -------------------------------------------------------------------------------- /src/com/entity/Huser.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | public class Huser { 4 | private Integer id; 5 | private String username; 6 | private String pwd; 7 | private String name; 8 | private String sex; 9 | private String tel; 10 | private String addr; 11 | private String zt; 12 | 13 | public Integer getId() { 14 | return id; 15 | } 16 | 17 | public void setId(Integer id) { 18 | this.id = id; 19 | } 20 | 21 | public String getUsername() { 22 | return username; 23 | } 24 | 25 | public void setUsername(String username) { 26 | this.username = username; 27 | } 28 | 29 | public String getPwd() { 30 | return pwd; 31 | } 32 | 33 | public void setPwd(String pwd) { 34 | this.pwd = pwd; 35 | } 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public void setName(String name) { 42 | this.name = name; 43 | } 44 | 45 | public String getSex() { 46 | return sex; 47 | } 48 | 49 | public void setSex(String sex) { 50 | this.sex = sex; 51 | } 52 | 53 | public String getTel() { 54 | return tel; 55 | } 56 | 57 | public void setTel(String tel) { 58 | this.tel = tel; 59 | } 60 | 61 | public String getAddr() { 62 | return addr; 63 | } 64 | 65 | public void setAddr(String addr) { 66 | this.addr = addr; 67 | } 68 | 69 | public String getZt() { 70 | return zt; 71 | } 72 | 73 | public void setZt(String zt) { 74 | this.zt = zt; 75 | } 76 | // public Integer getId() { 77 | // return id; 78 | // } 79 | // 80 | // public void setId(Integer id) { 81 | // this.id = id; 82 | // } 83 | // 84 | // public String getUsername() { 85 | // return username; 86 | // } 87 | // 88 | // public void setUsername(String username) { 89 | // this.username = username; 90 | // } 91 | // 92 | // public String getPwd() { 93 | // return pwd; 94 | // } 95 | // 96 | // public void setPwd(String pwd) { 97 | // this.pwd = pwd; 98 | // } 99 | // 100 | // public String getName() { 101 | // return name; 102 | // } 103 | // 104 | // public void setName(String name) { 105 | // this.name = name; 106 | // } 107 | // 108 | // public String getSex() { 109 | // return sex; 110 | // } 111 | // 112 | // public void setSex(String sex) { 113 | // this.sex = sex; 114 | // } 115 | // 116 | // public String getTel() { 117 | // return tel; 118 | // } 119 | // 120 | // public void setTel(String tel) { 121 | // this.tel = tel; 122 | // } 123 | // 124 | // public String getAddr() { 125 | // return addr; 126 | // } 127 | // 128 | // public void setAddr(String addr) { 129 | // this.addr = addr; 130 | // } 131 | // 132 | // public String getZt() { 133 | // return zt; 134 | // } 135 | // 136 | // public void setZt(String zt) { 137 | // this.zt = zt; 138 | // } 139 | // 140 | // @Override 141 | // public String toString() { 142 | // return "Huser [id=" + id + ", username=" + username + ", pwd=" + pwd + ", name=" + name + ", sex=" + sex + ", tel=" + tel + ", addr=" + addr + ", zt=" + zt + "]"; 143 | // } 144 | } -------------------------------------------------------------------------------- /src/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/com/mapper/Dingdan.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | insert into dingdan 24 | 25 | fang, 26 | orderid, 27 | jiage, 28 | yajin, 29 | sdate, 30 | tel, 31 | beizhu, 32 | uname, 33 | sname, 34 | zt, 35 | 36 | 37 | #{fang}, 38 | #{orderid}, 39 | #{jiage}, 40 | #{yajin}, 41 | #{sdate}, 42 | #{tel}, 43 | #{beizhu}, 44 | #{uname}, 45 | #{sname}, 46 | #{zt}, 47 | 48 | 49 | 50 | update dingdan 51 | 52 | fang=#{fang}, 53 | orderid=#{orderid}, 54 | jiage=#{jiage}, 55 | yajin=#{yajin}, 56 | sdate=#{sdate}, 57 | tel=#{tel}, 58 | beizhu=#{beizhu}, 59 | uname=#{uname}, 60 | sname=#{sname}, 61 | zt=#{zt}, 62 | 63 | where id=#{id} 64 | 65 | 66 | delete from dingdan where id= #{id} 67 | 68 | 71 | 74 | 77 | 80 | 83 | ${value} 84 | 85 | 86 | ${value} 87 | 88 | -------------------------------------------------------------------------------- /src/com/mapper/Zfang.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | insert into zfang 25 | 26 | name, 27 | pic, 28 | addr, 29 | mianji, 30 | louceng, 31 | chaoxiang, 32 | jiaju, 33 | jiage, 34 | tel, 35 | jieshao, 36 | stime, 37 | zt, 38 | uname, 39 | 40 | 41 | #{name}, 42 | #{pic}, 43 | #{addr}, 44 | #{mianji}, 45 | #{louceng}, 46 | #{chaoxiang}, 47 | #{jiaju}, 48 | #{jiage}, 49 | #{tel}, 50 | #{jieshao}, 51 | #{stime}, 52 | #{zt}, 53 | #{uname}, 54 | 55 | 56 | 57 | update zfang 58 | 59 | name=#{name}, 60 | pic=#{pic}, 61 | addr=#{addr}, 62 | mianji=#{mianji}, 63 | louceng=#{louceng}, 64 | chaoxiang=#{chaoxiang}, 65 | jiaju=#{jiaju}, 66 | jiage=#{jiage}, 67 | tel=#{tel}, 68 | jieshao=#{jieshao}, 69 | stime=#{stime}, 70 | zt=#{zt}, 71 | uname=#{uname}, 72 | 73 | where id=#{id} 74 | 75 | 76 | delete from zfang where id= #{id} 77 | 78 | 81 | 84 | 87 | 90 | 93 | ${value} 94 | 95 | 96 | ${value} 97 | 98 | -------------------------------------------------------------------------------- /src/com/entity/Fang.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | public class Fang { 4 | private Integer id; 5 | private String name; 6 | private String pic; 7 | private String area; 8 | private Area areafk; 9 | private String xiaoqu; 10 | private String chanquan; 11 | private String niandai; 12 | private String chaoxiang; 13 | private String zhuangxiu; 14 | private String mianji; 15 | private String jiage; 16 | private String dizhi; 17 | private String lianxiren; 18 | private String tel; 19 | private String gongjiao; 20 | private String uname; 21 | private String jieshao; 22 | private String addtime; 23 | private String zt; 24 | 25 | public Integer getId() 26 | { 27 | return id; 28 | } 29 | public void setId(Integer id) 30 | { 31 | this.id = id; 32 | } 33 | 34 | public String getName() 35 | { 36 | return name; 37 | } 38 | public void setName(String name) 39 | { 40 | this.name = name; 41 | } 42 | 43 | public String getPic() 44 | { 45 | return pic; 46 | } 47 | public void setPic(String pic) 48 | { 49 | this.pic = pic; 50 | } 51 | 52 | public String getArea() 53 | { 54 | return area; 55 | } 56 | public void setArea(String area) 57 | { 58 | this.area = area; 59 | } 60 | 61 | public Area getAreafk() { 62 | return areafk; 63 | } 64 | public void setAreafk(Area areafk) { 65 | this.areafk = areafk; 66 | } 67 | public String getXiaoqu() 68 | { 69 | return xiaoqu; 70 | } 71 | public void setXiaoqu(String xiaoqu) 72 | { 73 | this.xiaoqu = xiaoqu; 74 | } 75 | 76 | public String getChanquan() 77 | { 78 | return chanquan; 79 | } 80 | public void setChanquan(String chanquan) 81 | { 82 | this.chanquan = chanquan; 83 | } 84 | 85 | public String getNiandai() 86 | { 87 | return niandai; 88 | } 89 | public void setNiandai(String niandai) 90 | { 91 | this.niandai = niandai; 92 | } 93 | 94 | public String getChaoxiang() 95 | { 96 | return chaoxiang; 97 | } 98 | public void setChaoxiang(String chaoxiang) 99 | { 100 | this.chaoxiang = chaoxiang; 101 | } 102 | 103 | public String getZhuangxiu() 104 | { 105 | return zhuangxiu; 106 | } 107 | public void setZhuangxiu(String zhuangxiu) 108 | { 109 | this.zhuangxiu = zhuangxiu; 110 | } 111 | 112 | public String getMianji() 113 | { 114 | return mianji; 115 | } 116 | public void setMianji(String mianji) 117 | { 118 | this.mianji = mianji; 119 | } 120 | 121 | public String getJiage() 122 | { 123 | return jiage; 124 | } 125 | public void setJiage(String jiage) 126 | { 127 | this.jiage = jiage; 128 | } 129 | 130 | public String getDizhi() 131 | { 132 | return dizhi; 133 | } 134 | public void setDizhi(String dizhi) 135 | { 136 | this.dizhi = dizhi; 137 | } 138 | 139 | public String getLianxiren() 140 | { 141 | return lianxiren; 142 | } 143 | public void setLianxiren(String lianxiren) 144 | { 145 | this.lianxiren = lianxiren; 146 | } 147 | 148 | public String getTel() 149 | { 150 | return tel; 151 | } 152 | public void setTel(String tel) 153 | { 154 | this.tel = tel; 155 | } 156 | 157 | public String getGongjiao() 158 | { 159 | return gongjiao; 160 | } 161 | public void setGongjiao(String gongjiao) 162 | { 163 | this.gongjiao = gongjiao; 164 | } 165 | 166 | public String getUname() 167 | { 168 | return uname; 169 | } 170 | public void setUname(String uname) 171 | { 172 | this.uname = uname; 173 | } 174 | 175 | public String getJieshao() 176 | { 177 | return jieshao; 178 | } 179 | public void setJieshao(String jieshao) 180 | { 181 | this.jieshao = jieshao; 182 | } 183 | 184 | public String getAddtime() 185 | { 186 | return addtime; 187 | } 188 | public void setAddtime(String addtime) 189 | { 190 | this.addtime = addtime; 191 | } 192 | 193 | public String getZt() 194 | { 195 | return zt; 196 | } 197 | public void setZt(String zt) 198 | { 199 | this.zt = zt; 200 | } 201 | @Override 202 | 203 | public String toString() { 204 | 205 | return "Fang [id=" + id + ", name=" + name + ", pic=" + pic + ", area=" + area + ", xiaoqu=" + xiaoqu + ", chanquan=" + chanquan + ", niandai=" + niandai + ", chaoxiang=" + chaoxiang + ", zhuangxiu=" + zhuangxiu + ", mianji=" + mianji + ", jiage=" + jiage + ", dizhi=" + dizhi + ", lianxiren=" + lianxiren + ", tel=" + tel + ", gongjiao=" + gongjiao + ", uname=" + uname + ", jieshao=" + jieshao + ", addtime=" + addtime + ", zt=" + zt + "]"; 206 | 207 | } 208 | } -------------------------------------------------------------------------------- /src/com/controller/AreaController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | import java.util.List; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.ui.Model; 9 | 10 | import com.entity.Area; 11 | import com.service.AreaService; 12 | 13 | import com.util.Page; 14 | import com.util.Pagesize; 15 | import com.util.Pagination; 16 | //告诉spring mvc这是一个控制器类 17 | @Controller 18 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 19 | @RequestMapping("") 20 | public class AreaController { 21 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 22 | @Autowired 23 | AreaService areaService; 24 | @Autowired 25 | HttpServletRequest request; 26 | //列表管理页面 27 | @RequestMapping("arealist") 28 | public String listArea(Model model){ 29 | String w=""; 30 | 31 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") !=null) 32 | w=w+ " and name like '%"+request.getParameter("name")+"%'"; 33 | 34 | List cs= areaService.list(w); 35 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 47 | Pagination p = new Pagination();//创建 分页对象 48 | p.setIndex(index);//设置页数 49 | p.setPageSize(Pagesize.size); 50 | p.setTotle(cs.size());//设置总共的条数 51 | p.setData(cs1);//设置数据 52 | 53 | // 放入转发参数 54 | model.addAttribute("cs", p); 55 | model.addAttribute("page", p); 56 | model.addAttribute("dlist", cs); 57 | // 放入转发参数 58 | 59 | return "pages/area/arealist"; 60 | } 61 | 62 | @RequestMapping("areaadd") 63 | public String addarea(Model model){ 64 | 65 | return "pages/area/areaadd"; 66 | } 67 | //添加数据 68 | @RequestMapping("areainsert") 69 | public String insertArea(Area area,Model model){ 70 | String forword=request.getParameter("forword"); 71 | areaService.insert(area); 72 | model.addAttribute("msg","成功"); 73 | model.addAttribute("path",forword); 74 | return "success"; 75 | 76 | } 77 | //删除数据 78 | @RequestMapping("areadel") 79 | public String deleteArea(Area area,Model model){ 80 | String forword=request.getParameter("forword"); 81 | areaService.delete(area); 82 | model.addAttribute("msg","删除成功"); 83 | model.addAttribute("path",forword); 84 | return "success"; 85 | }//提取要修改的数据 86 | @RequestMapping("areaedit") 87 | public String editArea(Model model,Area area){ 88 | Area c= areaService.get(area.getId()); 89 | 90 | model.addAttribute("c", c); 91 | return "pages/area/areaedit"; 92 | } 93 | 94 | //修改的数据 95 | @RequestMapping("areaupdate") 96 | public String updateArea(Area area,Model model){ 97 | String forword=request.getParameter("forword"); 98 | areaService.update(area); 99 | model.addAttribute("msg","操作成功"); 100 | model.addAttribute("path",forword); 101 | return "success"; 102 | } 103 | //所有列表页 104 | @RequestMapping("areaAll") 105 | public String listAreaAll(Model model){ 106 | String w=""; 107 | 108 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") !=null) 109 | w=w+ " and name like '%"+request.getParameter("name")+"%'"; 110 | 111 | List cs= areaService.list(w); 112 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 124 | Pagination p = new Pagination();//创建 分页对象 125 | p.setIndex(index);//设置页数 126 | p.setPageSize(Pagesize.size); 127 | p.setTotle(cs.size());//设置总共的条数 128 | p.setData(cs1);//设置数据 129 | 130 | // 放入转发参数 131 | model.addAttribute("cs", p); 132 | model.addAttribute("page", p); 133 | model.addAttribute("dlist", cs); 134 | // 放入转发参数 135 | return "pages/area/areaAll"; 136 | } 137 | } -------------------------------------------------------------------------------- /src/com/controller/loginController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpSession; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | import org.springframework.ui.Model; 15 | 16 | import com.entity.Admin; 17 | import com.entity.Huser; 18 | import com.entity.User; 19 | import com.util.Result; 20 | 21 | //告诉spring mvc这是一个控制器类 22 | @Controller 23 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 24 | @RequestMapping("") 25 | public class loginController { 26 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 27 | @Autowired 28 | com.service.AdminService adminService; 29 | @Autowired 30 | com.service.HuserService huserService; 31 | @Autowired 32 | com.service.UserService userService; 33 | @Autowired 34 | HttpServletRequest request; 35 | 36 | @RequestMapping("check") 37 | @ResponseBody 38 | public Result login(String username,String pwd,String userType){ 39 | Result rs=null; 40 | String w=""; 41 | //System.out.println("userType"+userType); 42 | Map data=new HashMap(); 43 | if(userType.equals("0")) 44 | {System.out.println(username); 45 | if (!"".equals(username) && username!=null) 46 | w=w+ " and adminname ='"+username+"'"; 47 | if (!"".equals(pwd) && pwd!=null) 48 | w=w+ " and pwd ='"+pwd+"'"; 49 | List cs= adminService.sealist(w); 50 | if(cs.size()>0) 51 | { 52 | HttpSession session=request.getSession(); 53 | session.setAttribute("userType", userType); 54 | Admin s=(Admin)cs.get(0); 55 | session.setAttribute("admin", s); 56 | session.setAttribute("loginname", username); 57 | 58 | rs=new Result("1", "登陆成功", data);//将json数据返回 59 | System.out.println(rs.toString()); 60 | } 61 | else 62 | { 63 | rs=new Result("0", "登陆失败", data); 64 | System.out.println(rs.toString()); 65 | } 66 | } 67 | 68 | 69 | if(userType.equals("1"))//用户 70 | { 71 | if (!"".equals(username) && username!=null) 72 | w=w+ " and username ='"+username+"'"; 73 | if (!"".equals(pwd) && pwd!=null) 74 | w=w+ " and pwd ='"+pwd+"'"; 75 | 76 | List cs= userService.sealist(w); 77 | if(cs.size()>0) 78 | { 79 | HttpSession session=request.getSession(); 80 | session.setAttribute("userType", userType); 81 | User s=(User)cs.get(0); 82 | session.setAttribute("user", s); 83 | session.setAttribute("loginid", s.getId()); 84 | 85 | session.setAttribute("loginname", username); 86 | rs=new Result("1", "登陆成功", data);//将信息返回给ajax 87 | System.out.println(rs.toString()); 88 | 89 | } 90 | else 91 | { 92 | rs=new Result("0", "登陆失败", data); 93 | System.out.println(rs.toString()); 94 | 95 | } 96 | } 97 | if(userType.equals("2"))//中介 98 | { 99 | if (!"".equals(username) && username!=null) 100 | w=w+ " and username ='"+username+"'"; 101 | if (!"".equals(pwd) && pwd!=null) 102 | w=w+ " and pwd ='"+pwd+"'"; 103 | 104 | List cs= huserService.sealist(w); 105 | if(cs.size()>0) 106 | { 107 | HttpSession session=request.getSession(); 108 | session.setAttribute("userType", userType); 109 | Huser s=(Huser)cs.get(0); 110 | session.setAttribute("huser", s); 111 | session.setAttribute("loginid", s.getId()); 112 | session.setAttribute("loginname", username); 113 | rs=new Result("1", "登陆成功", data);//将信息返回给ajax 114 | System.out.println(rs.toString()); 115 | 116 | } 117 | else 118 | { 119 | rs=new Result("0", "登陆失败", data); 120 | System.out.println(rs.toString()); 121 | 122 | } 123 | } 124 | 125 | return rs; 126 | 127 | } 128 | @RequestMapping("userLogout") 129 | public String userLogout(Model model) 130 | { String forword=request.getParameter("forword"); 131 | 132 | HttpSession session=request.getSession(); 133 | 134 | session.setAttribute("userType", null); 135 | session.setAttribute("user", null); 136 | session.setAttribute("huser", null); 137 | 138 | session.setAttribute("loginid", null); 139 | 140 | session.setAttribute("loginname", null); 141 | model.addAttribute("msg","退出成功"); 142 | model.addAttribute("path",forword); 143 | return "success"; 144 | } 145 | } -------------------------------------------------------------------------------- /src/com/controller/NoticeController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | import java.util.List; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.ui.Model; 9 | 10 | import com.entity.Notice; 11 | import com.service.NoticeService; 12 | 13 | import com.util.Page; 14 | import com.util.Pagesize; 15 | import com.util.Pagination; 16 | //告诉spring mvc这是一个控制器类 17 | @Controller 18 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 19 | @RequestMapping("") 20 | public class NoticeController { 21 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 22 | @Autowired 23 | NoticeService noticeService; 24 | @Autowired 25 | HttpServletRequest request; 26 | //列表管理页面 27 | @RequestMapping("noticelist") 28 | public String listNotice(Model model){ 29 | String w=""; 30 | 31 | if (!"".equals(request.getParameter("title")) && request.getParameter("title") !=null) 32 | w=w+ " and title like '%"+request.getParameter("title")+"%'"; 33 | 34 | List cs= noticeService.list(w); 35 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 47 | Pagination p = new Pagination();//创建 分页对象 48 | p.setIndex(index);//设置页数 49 | p.setPageSize(Pagesize.size); 50 | p.setTotle(cs.size());//设置总共的条数 51 | p.setData(cs1);//设置数据 52 | 53 | // 放入转发参数 54 | model.addAttribute("cs", p); 55 | model.addAttribute("page", p); 56 | model.addAttribute("dlist", cs); 57 | // 放入转发参数 58 | 59 | return "pages/notice/noticelist"; 60 | } 61 | 62 | @RequestMapping("noticeadd") 63 | public String addnotice(Model model){ 64 | 65 | return "pages/notice/noticeadd"; 66 | } 67 | //添加数据 68 | @RequestMapping("noticeinsert") 69 | public String insertNotice(Notice notice,Model model){ 70 | String forword=request.getParameter("forword"); 71 | noticeService.insert(notice); 72 | model.addAttribute("msg","成功"); 73 | model.addAttribute("path",forword); 74 | return "success"; 75 | 76 | } 77 | //删除数据 78 | @RequestMapping("noticedel") 79 | public String deleteNotice(Notice notice,Model model){ 80 | String forword=request.getParameter("forword"); 81 | noticeService.delete(notice); 82 | model.addAttribute("msg","删除成功"); 83 | model.addAttribute("path",forword); 84 | return "success"; 85 | }//提取要修改的数据 86 | @RequestMapping("noticeedit") 87 | public String editNotice(Model model,Notice notice){ 88 | Notice c= noticeService.get(notice.getId()); 89 | 90 | model.addAttribute("c", c); 91 | return "pages/notice/noticeedit"; 92 | } 93 | 94 | //修改的数据 95 | @RequestMapping("noticeupdate") 96 | public String updateNotice(Notice notice,Model model){ 97 | String forword=request.getParameter("forword"); 98 | noticeService.update(notice); 99 | model.addAttribute("msg","操作成功"); 100 | model.addAttribute("path",forword); 101 | return "success"; 102 | } 103 | //所有列表页 104 | @RequestMapping("noticeAll") 105 | public String listNoticeAll(Model model){ 106 | String w=""; 107 | 108 | if (!"".equals(request.getParameter("title")) && request.getParameter("title") !=null) 109 | w=w+ " and title like '%"+request.getParameter("title")+"%'"; 110 | 111 | List cs= noticeService.list(w); 112 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 124 | Pagination p = new Pagination();//创建 分页对象 125 | p.setIndex(index);//设置页数 126 | p.setPageSize(Pagesize.size); 127 | p.setTotle(cs.size());//设置总共的条数 128 | p.setData(cs1);//设置数据 129 | 130 | // 放入转发参数 131 | model.addAttribute("cs", p); 132 | model.addAttribute("page", p); 133 | model.addAttribute("dlist", cs); 134 | // 放入转发参数 135 | return "pages/notice/noticeAll"; 136 | } 137 | 138 | @RequestMapping("noticeview") 139 | public String viewNotice(Model model,Notice notice){ 140 | Notice c= noticeService.get(notice.getId()); 141 | model.addAttribute("c", c); 142 | return "pages/notice/noticeview"; 143 | } 144 | } -------------------------------------------------------------------------------- /src/com/mapper/Fang.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | insert into fang 30 | 31 | name, 32 | pic, 33 | area, 34 | xiaoqu, 35 | chanquan, 36 | niandai, 37 | chaoxiang, 38 | zhuangxiu, 39 | mianji, 40 | jiage, 41 | dizhi, 42 | lianxiren, 43 | tel, 44 | gongjiao, 45 | uname, 46 | jieshao, 47 | addtime, 48 | zt, 49 | 50 | 51 | #{name}, 52 | #{pic}, 53 | #{area}, 54 | #{xiaoqu}, 55 | #{chanquan}, 56 | #{niandai}, 57 | #{chaoxiang}, 58 | #{zhuangxiu}, 59 | #{mianji}, 60 | #{jiage}, 61 | #{dizhi}, 62 | #{lianxiren}, 63 | #{tel}, 64 | #{gongjiao}, 65 | #{uname}, 66 | #{jieshao}, 67 | #{addtime}, 68 | #{zt}, 69 | 70 | 71 | 72 | update fang 73 | 74 | name=#{name}, 75 | pic=#{pic}, 76 | area=#{area}, 77 | xiaoqu=#{xiaoqu}, 78 | chanquan=#{chanquan}, 79 | niandai=#{niandai}, 80 | chaoxiang=#{chaoxiang}, 81 | zhuangxiu=#{zhuangxiu}, 82 | mianji=#{mianji}, 83 | jiage=#{jiage}, 84 | dizhi=#{dizhi}, 85 | lianxiren=#{lianxiren}, 86 | tel=#{tel}, 87 | gongjiao=#{gongjiao}, 88 | uname=#{uname}, 89 | jieshao=#{jieshao}, 90 | addtime=#{addtime}, 91 | zt=#{zt}, 92 | 93 | where id=#{id} 94 | 95 | 96 | delete from fang where id= #{id} 97 | 98 | 101 | 104 | 107 | 110 | 113 | ${value} 114 | 115 | 116 | ${value} 117 | 118 | -------------------------------------------------------------------------------- /src/com/controller/AdminController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | import java.util.List; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.ui.Model; 9 | 10 | import com.entity.Admin; 11 | import com.service.AdminService; 12 | 13 | import com.util.Page; 14 | import com.util.Pagesize; 15 | import com.util.Pagination; 16 | //告诉spring mvc这是一个控制器类 17 | @Controller 18 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 19 | @RequestMapping("") 20 | public class AdminController { 21 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 22 | @Autowired 23 | AdminService adminService; 24 | @Autowired 25 | HttpServletRequest request; 26 | //列表管理页面 27 | @RequestMapping("adminlist") 28 | public String listAdmin(Model model){ 29 | String w=""; 30 | 31 | if (!"".equals(request.getParameter("adminname")) && request.getParameter("adminname") !=null) 32 | w=w+ " and adminname like '%"+request.getParameter("adminname")+"%'"; 33 | 34 | List cs= adminService.list(w); 35 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 47 | Pagination p = new Pagination();//创建 分页对象 48 | p.setIndex(index);//设置页数 49 | p.setPageSize(Pagesize.size); 50 | p.setTotle(cs.size());//设置总共的条数 51 | p.setData(cs1);//设置数据 52 | 53 | // 放入转发参数 54 | model.addAttribute("cs", p); 55 | model.addAttribute("page", p); 56 | model.addAttribute("dlist", cs); 57 | // 放入转发参数 58 | 59 | return "pages/admin/adminlist"; 60 | } 61 | 62 | @RequestMapping("adminadd") 63 | public String addadmin(Model model){ 64 | 65 | return "pages/admin/adminadd"; 66 | } 67 | //添加数据 68 | @RequestMapping("admininsert") 69 | public String insertAdmin(Admin admin,Model model){ 70 | String forword=request.getParameter("forword"); 71 | adminService.insert(admin); 72 | model.addAttribute("msg","成功"); 73 | model.addAttribute("path",forword); 74 | return "success"; 75 | 76 | } 77 | //删除数据 78 | @RequestMapping("admindel") 79 | public String deleteAdmin(Admin admin,Model model){ 80 | String forword=request.getParameter("forword"); 81 | adminService.delete(admin); 82 | model.addAttribute("msg","删除成功"); 83 | model.addAttribute("path",forword); 84 | return "success"; 85 | }//提取要修改的数据 86 | @RequestMapping("adminedit") 87 | public String editAdmin(Model model,Admin admin){ 88 | Admin c= adminService.get(admin.getId()); 89 | 90 | model.addAttribute("c", c); 91 | return "pages/admin/adminedit"; 92 | } 93 | 94 | //修改的数据 95 | @RequestMapping("adminupdate") 96 | public String updateAdmin(Admin admin,Model model){ 97 | String forword=request.getParameter("forword"); 98 | adminService.update(admin); 99 | model.addAttribute("msg","操作成功"); 100 | model.addAttribute("path",forword); 101 | return "success"; 102 | } 103 | //所有列表页 104 | @RequestMapping("adminAll") 105 | public String listAdminAll(Model model){ 106 | String w=""; 107 | 108 | if (!"".equals(request.getParameter("adminname")) && request.getParameter("adminname") !=null) 109 | w=w+ " and adminname like '%"+request.getParameter("adminname")+"%'"; 110 | 111 | List cs= adminService.list(w); 112 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 124 | Pagination p = new Pagination();//创建 分页对象 125 | p.setIndex(index);//设置页数 126 | p.setPageSize(Pagesize.size); 127 | p.setTotle(cs.size());//设置总共的条数 128 | p.setData(cs1);//设置数据 129 | 130 | // 放入转发参数 131 | model.addAttribute("cs", p); 132 | model.addAttribute("page", p); 133 | model.addAttribute("dlist", cs); 134 | // 放入转发参数 135 | return "pages/admin/adminAll"; 136 | } 137 | //注册 138 | @RequestMapping("adminreg") 139 | public String insertreg(Admin admin,Model model){ 140 | String forword=request.getParameter("forword"); 141 | String w=" and username='"+request.getParameter("username")+"'"; 142 | List cs= adminService.list(w); 143 | if (cs.size()>0) 144 | { 145 | model.addAttribute("msg","用户名重复!请重试"); 146 | model.addAttribute("path",forword); 147 | } 148 | else{ 149 | adminService.insert(admin); 150 | model.addAttribute("msg","成功"); 151 | model.addAttribute("path",forword); 152 | } 153 | return "success"; 154 | 155 | } 156 | //修改个人资料 157 | @RequestMapping("admininfo") 158 | public String editAdmininfo(Model model,Admin admin){ 159 | Admin c= adminService.get(admin.getId()); 160 | 161 | model.addAttribute("c", c); 162 | return "pages/admin/admininfo"; 163 | } 164 | 165 | //保存修改个人资料数据 166 | @RequestMapping("admininfosave") 167 | public String Admininfosave(Admin admin,Model model){ 168 | String forword=request.getParameter("forword"); 169 | adminService.update(admin); 170 | model.addAttribute("msg","修改成功"); 171 | model.addAttribute("path",forword); 172 | return "success"; 173 | } 174 | } -------------------------------------------------------------------------------- /src/com/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | import java.util.List; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.ui.Model; 9 | 10 | import com.entity.User; 11 | import com.service.UserService; 12 | 13 | import com.util.Page; 14 | import com.util.Pagesize; 15 | import com.util.Pagination; 16 | //告诉spring mvc这是一个控制器类 17 | @Controller 18 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 19 | @RequestMapping("") 20 | public class UserController { 21 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 22 | @Autowired 23 | UserService userService; 24 | @Autowired 25 | HttpServletRequest request; 26 | //列表管理页面 27 | @RequestMapping("userlist") 28 | public String listUser(Model model){ 29 | String w=""; 30 | 31 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") !=null) 32 | w=w+ " and name like '%"+request.getParameter("name")+"%'"; 33 | 34 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 35 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 36 | 37 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 38 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 39 | 40 | List cs= userService.list(w); 41 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 53 | Pagination p = new Pagination();//创建 分页对象 54 | p.setIndex(index);//设置页数 55 | p.setPageSize(Pagesize.size); 56 | p.setTotle(cs.size());//设置总共的条数 57 | p.setData(cs1);//设置数据 58 | 59 | // 放入转发参数 60 | model.addAttribute("cs", p); 61 | model.addAttribute("page", p); 62 | model.addAttribute("dlist", cs); 63 | // 放入转发参数 64 | 65 | return "pages/user/userlist"; 66 | } 67 | 68 | @RequestMapping("useradd") 69 | public String adduser(Model model){ 70 | 71 | return "pages/user/useradd"; 72 | } 73 | //添加数据 74 | @RequestMapping("userinsert") 75 | public String insertUser(User user,Model model){ 76 | String forword=request.getParameter("forword"); 77 | userService.insert(user); 78 | model.addAttribute("msg","成功"); 79 | model.addAttribute("path",forword); 80 | return "success"; 81 | 82 | } 83 | //删除数据 84 | @RequestMapping("userdel") 85 | public String deleteUser(User user,Model model){ 86 | String forword=request.getParameter("forword"); 87 | userService.delete(user); 88 | model.addAttribute("msg","删除成功"); 89 | model.addAttribute("path",forword); 90 | return "success"; 91 | }//提取要修改的数据 92 | @RequestMapping("useredit") 93 | public String editUser(Model model,User user){ 94 | User c= userService.get(user.getId()); 95 | 96 | model.addAttribute("c", c); 97 | return "pages/user/useredit"; 98 | } 99 | 100 | //修改的数据 101 | @RequestMapping("userupdate") 102 | public String updateUser(User user,Model model){ 103 | String forword=request.getParameter("forword"); 104 | userService.update(user); 105 | model.addAttribute("msg","操作成功"); 106 | model.addAttribute("path",forword); 107 | return "success"; 108 | } 109 | //所有列表页 110 | @RequestMapping("userAll") 111 | public String listUserAll(Model model){ 112 | String w=""; 113 | 114 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") !=null) 115 | w=w+ " and name like '%"+request.getParameter("name")+"%'"; 116 | 117 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 118 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 119 | 120 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 121 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 122 | 123 | List cs= userService.list(w); 124 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 136 | Pagination p = new Pagination();//创建 分页对象 137 | p.setIndex(index);//设置页数 138 | p.setPageSize(Pagesize.size); 139 | p.setTotle(cs.size());//设置总共的条数 140 | p.setData(cs1);//设置数据 141 | 142 | // 放入转发参数 143 | model.addAttribute("cs", p); 144 | model.addAttribute("page", p); 145 | model.addAttribute("dlist", cs); 146 | // 放入转发参数 147 | return "pages/user/userAll"; 148 | } 149 | //注册 150 | @RequestMapping("userreg") 151 | public String insertreg(User user,Model model){ 152 | String forword=request.getParameter("forword"); 153 | String w=" and username='"+request.getParameter("username")+"'"; 154 | List cs= userService.list(w); 155 | if (cs.size()>0) 156 | { 157 | model.addAttribute("msg","用户名重复!请重试"); 158 | model.addAttribute("path",forword); 159 | } 160 | else{ 161 | userService.insert(user); 162 | model.addAttribute("msg","成功"); 163 | model.addAttribute("path",forword); 164 | } 165 | return "success"; 166 | 167 | } 168 | //修改个人资料 169 | @RequestMapping("userinfo") 170 | public String editUserinfo(Model model,User user){ 171 | User c= userService.get(user.getId()); 172 | 173 | model.addAttribute("c", c); 174 | return "pages/user/userinfo"; 175 | } 176 | 177 | //保存修改个人资料数据 178 | @RequestMapping("userinfosave") 179 | public String Userinfosave(User user,Model model){ 180 | String forword=request.getParameter("forword"); 181 | userService.update(user); 182 | model.addAttribute("msg","修改成功"); 183 | model.addAttribute("path",forword); 184 | return "success"; 185 | } 186 | } -------------------------------------------------------------------------------- /src/com/controller/LiuyanController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | import java.util.List; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.ui.Model; 9 | 10 | import com.entity.Liuyan; 11 | import com.service.LiuyanService; 12 | 13 | import com.util.Page; 14 | import com.util.Pagesize; 15 | import com.util.Pagination; 16 | //告诉spring mvc这是一个控制器类 17 | @Controller 18 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 19 | @RequestMapping("") 20 | public class LiuyanController { 21 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 22 | @Autowired 23 | LiuyanService liuyanService; 24 | @Autowired 25 | HttpServletRequest request; 26 | //个人列表页 27 | @RequestMapping("liuyanmy") 28 | public String listLiuyanmy(Model model){ 29 | HttpSession session=request.getSession(); 30 | String uname= (String) session.getAttribute("loginname"); 31 | String w=" and uname='"+uname+"'"; 32 | 33 | if (!"".equals(request.getParameter("title")) && request.getParameter("title") !=null) 34 | w=w+ " and title like '%"+request.getParameter("title")+"%'"; 35 | 36 | if (!"".equals(request.getParameter("huifu")) && request.getParameter("huifu") !=null) 37 | w=w+ " and huifu like '%"+request.getParameter("huifu")+"%'"; 38 | 39 | List cs= liuyanService.list(w); 40 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 52 | Pagination p = new Pagination();//创建 分页对象 53 | p.setIndex(index);//设置页数 54 | p.setPageSize(Pagesize.size); 55 | p.setTotle(cs.size());//设置总共的条数 56 | p.setData(cs1);//设置数据 57 | 58 | // 放入转发参数 59 | model.addAttribute("cs", p); 60 | model.addAttribute("page", p); 61 | model.addAttribute("dlist", cs); 62 | return "pages/liuyan/liuyanmy"; 63 | } 64 | //列表管理页面 65 | @RequestMapping("liuyanlist") 66 | public String listLiuyan(Model model){ 67 | String w=""; 68 | 69 | if (!"".equals(request.getParameter("title")) && request.getParameter("title") !=null) 70 | w=w+ " and title like '%"+request.getParameter("title")+"%'"; 71 | 72 | if (!"".equals(request.getParameter("huifu")) && request.getParameter("huifu") !=null) 73 | w=w+ " and huifu like '%"+request.getParameter("huifu")+"%'"; 74 | 75 | List cs= liuyanService.list(w); 76 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 88 | Pagination p = new Pagination();//创建 分页对象 89 | p.setIndex(index);//设置页数 90 | p.setPageSize(Pagesize.size); 91 | p.setTotle(cs.size());//设置总共的条数 92 | p.setData(cs1);//设置数据 93 | 94 | // 放入转发参数 95 | model.addAttribute("cs", p); 96 | model.addAttribute("page", p); 97 | model.addAttribute("dlist", cs); 98 | // 放入转发参数 99 | 100 | return "pages/liuyan/liuyanlist"; 101 | } 102 | 103 | @RequestMapping("liuyanadd") 104 | public String addliuyan(Model model){ 105 | 106 | return "pages/liuyan/liuyanadd"; 107 | } 108 | //添加数据 109 | @RequestMapping("liuyaninsert") 110 | public String insertLiuyan(Liuyan liuyan,Model model){ 111 | String forword=request.getParameter("forword"); 112 | liuyanService.insert(liuyan); 113 | model.addAttribute("msg","成功"); 114 | model.addAttribute("path",forword); 115 | return "success"; 116 | 117 | } 118 | //删除数据 119 | @RequestMapping("liuyandel") 120 | public String deleteLiuyan(Liuyan liuyan,Model model){ 121 | String forword=request.getParameter("forword"); 122 | liuyanService.delete(liuyan); 123 | model.addAttribute("msg","删除成功"); 124 | model.addAttribute("path",forword); 125 | return "success"; 126 | }//提取要修改的数据 127 | @RequestMapping("liuyanedit") 128 | public String editLiuyan(Model model,Liuyan liuyan){ 129 | Liuyan c= liuyanService.get(liuyan.getId()); 130 | 131 | model.addAttribute("c", c); 132 | return "pages/liuyan/liuyanedit"; 133 | } 134 | 135 | //修改的数据 136 | @RequestMapping("liuyanupdate") 137 | public String updateLiuyan(Liuyan liuyan,Model model){ 138 | String forword=request.getParameter("forword"); 139 | liuyanService.update(liuyan); 140 | model.addAttribute("msg","操作成功"); 141 | model.addAttribute("path",forword); 142 | return "success"; 143 | } 144 | //所有列表页 145 | @RequestMapping("liuyanAll") 146 | public String listLiuyanAll(Model model){ 147 | String w=""; 148 | 149 | if (!"".equals(request.getParameter("title")) && request.getParameter("title") !=null) 150 | w=w+ " and title like '%"+request.getParameter("title")+"%'"; 151 | 152 | if (!"".equals(request.getParameter("huifu")) && request.getParameter("huifu") !=null) 153 | w=w+ " and huifu like '%"+request.getParameter("huifu")+"%'"; 154 | 155 | List cs= liuyanService.list(w); 156 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 168 | Pagination p = new Pagination();//创建 分页对象 169 | p.setIndex(index);//设置页数 170 | p.setPageSize(Pagesize.size); 171 | p.setTotle(cs.size());//设置总共的条数 172 | p.setData(cs1);//设置数据 173 | 174 | // 放入转发参数 175 | model.addAttribute("cs", p); 176 | model.addAttribute("page", p); 177 | model.addAttribute("dlist", cs); 178 | // 放入转发参数 179 | return "pages/liuyan/liuyanAll"; 180 | } 181 | 182 | @RequestMapping("liuyanview") 183 | public String viewLiuyan(Model model,Liuyan liuyan){ 184 | Liuyan c= liuyanService.get(liuyan.getId()); 185 | model.addAttribute("c", c); 186 | return "pages/liuyan/liuyanview"; 187 | } 188 | } -------------------------------------------------------------------------------- /src/com/controller/HuserController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.util.List; 4 | import javax.servlet.http.HttpServletRequest; 5 | import javax.servlet.http.HttpSession; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.ui.Model; 11 | import com.entity.Huser; 12 | import com.service.HuserService; 13 | import com.util.Page; 14 | import com.util.Pagesize; 15 | import com.util.Pagination; 16 | 17 | //告诉spring mvc这是一个控制器类 18 | @Controller 19 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 20 | @RequestMapping("") 21 | public class HuserController { 22 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 23 | @Autowired 24 | HuserService huserService; 25 | @Autowired 26 | HttpServletRequest request; 27 | 28 | //中介列表管理页面 29 | @RequestMapping("huserlist") 30 | public String listHuser(Model model) { 31 | String w = ""; 32 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") != null) 33 | w = w + " and name like '%" + request.getParameter("name") + "%'"; 34 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") != null) 35 | w = w + " and tel like '%" + request.getParameter("tel") + "%'"; 36 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") != null) 37 | w = w + " and zt like '%" + request.getParameter("zt") + "%'"; 38 | List cs = huserService.list(w); 39 | for (int i = 0; i < cs.size(); i++) { 40 | Huser huser = (Huser) cs.get(i); 41 | } 42 | int index = 0; 43 | if (request.getParameter("index") == null) { 44 | index = 1; 45 | } else { 46 | index = Integer.parseInt(request.getParameter("index")); 47 | } 48 | int fromIndex = (index - 1) * Pagesize.size; 49 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 50 | List cs1 = cs.subList(fromIndex, toIndex); 51 | Pagination p = new Pagination();//创建 分页对象 52 | p.setIndex(index);//设置页数 53 | p.setPageSize(Pagesize.size); 54 | p.setTotle(cs.size());//设置总共的条数 55 | p.setData(cs1);//设置数据 56 | // 放入转发参数 57 | model.addAttribute("cs", p); 58 | model.addAttribute("page", p); 59 | model.addAttribute("dlist", cs); 60 | // 放入转发参数 61 | return "pages/huser/huserlist"; 62 | } 63 | 64 | @RequestMapping("huseradd") 65 | public String addhuser(Model model) { 66 | return "pages/huser/huseradd"; 67 | } 68 | 69 | //添加中介数据 70 | @RequestMapping("huserinsert") 71 | public String insertHuser(Huser huser, Model model) { 72 | String forword = request.getParameter("forword"); 73 | huserService.insert(huser); 74 | model.addAttribute("msg", "成功"); 75 | model.addAttribute("path", forword); 76 | return "success"; 77 | } 78 | 79 | //删除中介数据 80 | @RequestMapping("huserdel") 81 | public String deleteHuser(Huser huser, Model model) { 82 | String forword = request.getParameter("forword"); 83 | huserService.delete(huser); 84 | model.addAttribute("msg", "删除成功"); 85 | model.addAttribute("path", forword); 86 | return "success"; 87 | }//提取要修改的中介数据 88 | 89 | @RequestMapping("huseredit") 90 | public String editHuser(Model model, Huser huser) { 91 | Huser c = huserService.get(huser.getId()); 92 | model.addAttribute("c", c); 93 | return "pages/huser/huseredit"; 94 | } 95 | 96 | //修改的中介数据 97 | @RequestMapping("huserupdate") 98 | public String updateHuser(Huser huser, Model model) { 99 | String forword = request.getParameter("forword"); 100 | huserService.update(huser); 101 | model.addAttribute("msg", "操作成功"); 102 | model.addAttribute("path", forword); 103 | return "success"; 104 | } 105 | 106 | //中介所有列表页 107 | @RequestMapping("huserAll") 108 | public String listHuserAll(Model model) { 109 | String w = ""; 110 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") != null) 111 | w = w + " and name like '%" + request.getParameter("name") + "%'"; 112 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") != null) 113 | w = w + " and tel like '%" + request.getParameter("tel") + "%'"; 114 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") != null) 115 | w = w + " and zt like '%" + request.getParameter("zt") + "%'"; 116 | List cs = huserService.list(w); 117 | for (int i = 0; i < cs.size(); i++) { 118 | Huser huser = (Huser) cs.get(i); 119 | } 120 | int index = 0; 121 | if (request.getParameter("index") == null) { 122 | index = 1; 123 | } else { 124 | index = Integer.parseInt(request.getParameter("index")); 125 | } 126 | int fromIndex = (index - 1) * Pagesize.size; 127 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 128 | List cs1 = cs.subList(fromIndex, toIndex); 129 | Pagination p = new Pagination();//创建 分页对象 130 | p.setIndex(index);//设置页数 131 | p.setPageSize(Pagesize.size); 132 | p.setTotle(cs.size());//设置总共的条数 133 | p.setData(cs1);//设置数据 134 | // 放入转发参数 135 | model.addAttribute("cs", p); 136 | model.addAttribute("page", p); 137 | model.addAttribute("dlist", cs); 138 | // 放入转发参数 139 | return "pages/huser/huserAll"; 140 | } 141 | 142 | //注册 143 | @RequestMapping("huserreg") 144 | public String insertreg(Huser huser, Model model) { 145 | String forword = request.getParameter("forword"); 146 | String w = " and username='" + request.getParameter("username") + "'"; 147 | List cs = huserService.list(w); 148 | if (cs.size() > 0) { 149 | model.addAttribute("msg", "用户名重复!请重试"); 150 | model.addAttribute("path", forword); 151 | } else { 152 | huserService.insert(huser); 153 | model.addAttribute("msg", "成功"); 154 | model.addAttribute("path", forword); 155 | } 156 | return "success"; 157 | } 158 | 159 | //修改个人资料 160 | @RequestMapping("huserinfo") 161 | public String editHuserinfo(Model model, Huser huser) { 162 | Huser c = huserService.get(huser.getId()); 163 | model.addAttribute("c", c); 164 | return "pages/huser/huserinfo"; 165 | } 166 | 167 | //保存修改个人资料数据 168 | @RequestMapping("huserinfosave") 169 | public String Huserinfosave(Huser huser, Model model) { 170 | String forword = request.getParameter("forword"); 171 | huserService.update(huser); 172 | model.addAttribute("msg", "修改成功"); 173 | model.addAttribute("path", forword); 174 | return "success"; 175 | } 176 | } -------------------------------------------------------------------------------- /src/com/controller/ZfangController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | import java.util.List; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.ui.Model; 9 | 10 | import com.entity.Zfang; 11 | import com.service.ZfangService; 12 | 13 | import com.util.Page; 14 | import com.util.Pagesize; 15 | import com.util.Pagination; 16 | //告诉spring mvc这是一个控制器类 17 | @Controller 18 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 19 | @RequestMapping("") 20 | public class ZfangController { 21 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 22 | @Autowired 23 | ZfangService zfangService; 24 | @Autowired 25 | HttpServletRequest request; 26 | //个人列表页 27 | @RequestMapping("zfangmy") 28 | public String listZfangmy(Model model){ 29 | HttpSession session=request.getSession(); 30 | String uname= (String) session.getAttribute("loginname"); 31 | String w=" and uname='"+uname+"'"; 32 | 33 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") !=null) 34 | w=w+ " and name like '%"+request.getParameter("name")+"%'"; 35 | 36 | if (!"".equals(request.getParameter("mianji")) && request.getParameter("mianji") !=null) 37 | w=w+ " and mianji like '%"+request.getParameter("mianji")+"%'"; 38 | 39 | if (!"".equals(request.getParameter("louceng")) && request.getParameter("louceng") !=null) 40 | w=w+ " and louceng like '%"+request.getParameter("louceng")+"%'"; 41 | 42 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 43 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 44 | 45 | List cs= zfangService.list(w); 46 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 58 | Pagination p = new Pagination();//创建 分页对象 59 | p.setIndex(index);//设置页数 60 | p.setPageSize(Pagesize.size); 61 | p.setTotle(cs.size());//设置总共的条数 62 | p.setData(cs1);//设置数据 63 | 64 | // 放入转发参数 65 | model.addAttribute("cs", p); 66 | model.addAttribute("page", p); 67 | model.addAttribute("dlist", cs); 68 | return "pages/zfang/zfangmy"; 69 | } 70 | //租房信息列表管理页面 71 | @RequestMapping("zfanglist") 72 | public String listZfang(Model model){ 73 | String w=""; 74 | 75 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") !=null) 76 | w=w+ " and name like '%"+request.getParameter("name")+"%'"; 77 | 78 | if (!"".equals(request.getParameter("mianji")) && request.getParameter("mianji") !=null) 79 | w=w+ " and mianji like '%"+request.getParameter("mianji")+"%'"; 80 | 81 | if (!"".equals(request.getParameter("louceng")) && request.getParameter("louceng") !=null) 82 | w=w+ " and louceng like '%"+request.getParameter("louceng")+"%'"; 83 | 84 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 85 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 86 | 87 | List cs= zfangService.list(w); 88 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 100 | Pagination p = new Pagination();//创建 分页对象 101 | p.setIndex(index);//设置页数 102 | p.setPageSize(Pagesize.size); 103 | p.setTotle(cs.size());//设置总共的条数 104 | p.setData(cs1);//设置数据 105 | 106 | // 放入转发参数 107 | model.addAttribute("cs", p); 108 | model.addAttribute("page", p); 109 | model.addAttribute("dlist", cs); 110 | // 放入转发参数 111 | 112 | return "pages/zfang/zfanglist"; 113 | } 114 | 115 | @RequestMapping("zfangadd") 116 | public String addzfang(Model model){ 117 | 118 | return "pages/zfang/zfangadd"; 119 | } 120 | //添加租房信息数据 121 | @RequestMapping("zfanginsert") 122 | public String insertZfang(Zfang zfang,Model model){ 123 | String forword=request.getParameter("forword"); 124 | zfangService.insert(zfang); 125 | model.addAttribute("msg","成功"); 126 | model.addAttribute("path",forword); 127 | return "success"; 128 | 129 | } 130 | //删除租房信息数据 131 | @RequestMapping("zfangdel") 132 | public String deleteZfang(Zfang zfang,Model model){ 133 | String forword=request.getParameter("forword"); 134 | zfangService.delete(zfang); 135 | model.addAttribute("msg","删除成功"); 136 | model.addAttribute("path",forword); 137 | return "success"; 138 | }//提取要修改的租房信息数据 139 | @RequestMapping("zfangedit") 140 | public String editZfang(Model model,Zfang zfang){ 141 | Zfang c= zfangService.get(zfang.getId()); 142 | 143 | model.addAttribute("c", c); 144 | return "pages/zfang/zfangedit"; 145 | } 146 | 147 | //修改的租房信息数据 148 | @RequestMapping("zfangupdate") 149 | public String updateZfang(Zfang zfang,Model model){ 150 | String forword=request.getParameter("forword"); 151 | zfangService.update(zfang); 152 | model.addAttribute("msg","操作成功"); 153 | model.addAttribute("path",forword); 154 | return "success"; 155 | } 156 | //租房信息所有列表页 157 | @RequestMapping("zfangAll") 158 | public String listZfangAll(Model model){ 159 | String w=" and zt='已审核'"; 160 | 161 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") !=null) 162 | w=w+ " and name like '%"+request.getParameter("name")+"%'"; 163 | 164 | if (!"".equals(request.getParameter("mianji")) && request.getParameter("mianji") !=null) 165 | w=w+ " and mianji like '%"+request.getParameter("mianji")+"%'"; 166 | 167 | if (!"".equals(request.getParameter("louceng")) && request.getParameter("louceng") !=null) 168 | w=w+ " and louceng like '%"+request.getParameter("louceng")+"%'"; 169 | 170 | 171 | 172 | List cs= zfangService.list(w); 173 | for(int i=0;i cs1 = cs.subList(fromIndex, toIndex); 185 | Pagination p = new Pagination();//创建 分页对象 186 | p.setIndex(index);//设置页数 187 | p.setPageSize(Pagesize.size); 188 | p.setTotle(cs.size());//设置总共的条数 189 | p.setData(cs1);//设置数据 190 | 191 | // 放入转发参数 192 | model.addAttribute("cs", p); 193 | model.addAttribute("page", p); 194 | model.addAttribute("dlist", cs); 195 | // 放入转发参数 196 | return "pages/zfang/zfangAll"; 197 | } 198 | 199 | @RequestMapping("zfangview") 200 | public String viewZfang(Model model,Zfang zfang){ 201 | Zfang c= zfangService.get(zfang.getId()); 202 | model.addAttribute("c", c); 203 | return "pages/zfang/zfangview"; 204 | } 205 | } -------------------------------------------------------------------------------- /.idea/$CACHE_FILE$: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Abstraction issuesJava 10 | 11 | 12 | Android 13 | 14 | 15 | Assignment issuesJava 16 | 17 | 18 | Bitwise operation issuesJava 19 | 20 | 21 | Bitwise operation issuesJavaScript 22 | 23 | 24 | CDI (Contexts and Dependency Injection) 25 | 26 | 27 | Class metricsJava 28 | 29 | 30 | Class structureJava 31 | 32 | 33 | Cloning issuesJava 34 | 35 | 36 | Code maturityJava 37 | 38 | 39 | Code style issuesJava 40 | 41 | 42 | Code style issuesJavaScript 43 | 44 | 45 | CodePlugin DevKit 46 | 47 | 48 | CodeSpring CoreSpring 49 | 50 | 51 | Compiler issuesJava 52 | 53 | 54 | Control flow issuesJava 55 | 56 | 57 | Control flow issuesJavaScript 58 | 59 | 60 | CorrectnessLintAndroid 61 | 62 | 63 | DOM issuesJavaScript 64 | 65 | 66 | Data flowJava 67 | 68 | 69 | Data flowJavaScript 70 | 71 | 72 | Declaration redundancyJava 73 | 74 | 75 | ECMAScript 6 migration aidsJavaScript 76 | 77 | 78 | EncapsulationJava 79 | 80 | 81 | Error handlingJava 82 | 83 | 84 | Error handlingJavaScript 85 | 86 | 87 | FinalizationJava 88 | 89 | 90 | General 91 | 92 | 93 | GeneralJavaScript 94 | 95 | 96 | Google Web Toolkit 97 | 98 | 99 | Groovy 100 | 101 | 102 | ImportsJava 103 | 104 | 105 | Inheritance issuesJava 106 | 107 | 108 | InitializationJava 109 | 110 | 111 | InternationalizationJava 112 | 113 | 114 | J2ME issuesJava 115 | 116 | 117 | JBoss Seam 118 | 119 | 120 | JSP 121 | 122 | 123 | JUnitJava 124 | 125 | 126 | Java 127 | 128 | 129 | Java 5Java language level migration aidsJava 130 | 131 | 132 | Java 8Java language level migration aidsJava 133 | 134 | 135 | Java 9Java language level migration aidsJava 136 | 137 | 138 | Java EE 139 | 140 | 141 | Java interop issuesKotlin 142 | 143 | 144 | Java language level migration aidsJava 145 | 146 | 147 | JavaBeans issuesJava 148 | 149 | 150 | JavaFX 151 | 152 | 153 | JavaScript 154 | 155 | 156 | JavaScript function metricsJavaScript 157 | 158 | 159 | JavadocJava 160 | 161 | 162 | Kotlin 163 | 164 | 165 | LintAndroid 166 | 167 | 168 | LoggingJava 169 | 170 | 171 | MemoryJava 172 | 173 | 174 | Method metricsJava 175 | 176 | 177 | Naming conventionsJava 178 | 179 | 180 | Nullability problemsProbable bugsJava 181 | 182 | 183 | Numeric issuesJava 184 | 185 | 186 | PerformanceJava 187 | 188 | 189 | PerformanceLintAndroid 190 | 191 | 192 | Plugin DevKit 193 | 194 | 195 | PortabilityJava 196 | 197 | 198 | Potentially confusing code constructsJavaScript 199 | 200 | 201 | Probable bugsGroovy 202 | 203 | 204 | Probable bugsJava 205 | 206 | 207 | Probable bugsJavaScript 208 | 209 | 210 | Probable bugsKotlin 211 | 212 | 213 | SecurityJava 214 | 215 | 216 | SecurityLintAndroid 217 | 218 | 219 | Serialization issuesJava 220 | 221 | 222 | Spring 223 | 224 | 225 | Spring CoreSpring 226 | 227 | 228 | Spring DataSpring 229 | 230 | 231 | Threading issuesGroovy 232 | 233 | 234 | Threading issuesJava 235 | 236 | 237 | UsabilityLintAndroid 238 | 239 | 240 | Verbose or redundant code constructsJava 241 | 242 | 243 | VisibilityJava 244 | 245 | 246 | Web Services 247 | 248 | 249 | 250 | 251 | 252 | -------------------------------------------------------------------------------- /src/com/controller/KanfangController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | import java.util.List; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.ui.Model; 9 | 10 | import com.entity.Kanfang; 11 | import com.service.KanfangService; 12 | import com.entity.Zfang; 13 | import com.service.ZfangService; 14 | 15 | import com.util.Page; 16 | import com.util.Pagesize; 17 | import com.util.Pagination; 18 | //告诉spring mvc这是一个控制器类 19 | @Controller 20 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 21 | @RequestMapping("") 22 | public class KanfangController { 23 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 24 | @Autowired 25 | KanfangService kanfangService; 26 | @Autowired 27 | ZfangService zfangService; 28 | @Autowired 29 | HttpServletRequest request; 30 | //个人列表页 31 | @RequestMapping("kanfangmy") 32 | public String listKanfangmy(Model model){ 33 | HttpSession session=request.getSession(); 34 | String uname= (String) session.getAttribute("loginname"); 35 | String w=" and uname='"+uname+"'"; 36 | 37 | if (!"".equals(request.getParameter("zfang")) && request.getParameter("zfang") !=null) 38 | w=w+ " and zfang = "+request.getParameter("zfang")+""; 39 | 40 | if (!"".equals(request.getParameter("sdate")) && request.getParameter("sdate") !=null) 41 | w=w+ " and sdate like '%"+request.getParameter("sdate")+"%'"; 42 | 43 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 44 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 45 | 46 | if (!"".equals(request.getParameter("sname")) && request.getParameter("sname") !=null) 47 | w=w+ " and sname like '%"+request.getParameter("sname")+"%'"; 48 | 49 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 50 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 51 | 52 | List cs= kanfangService.list(w); 53 | for(int i=0;i zfang= zfangService.list(""); 59 | // 放入转发参数 60 | model.addAttribute("zfang", zfang); 61 | int index=0; 62 | if(request.getParameter("index")==null) 63 | {index=1;} 64 | else 65 | {index=Integer.parseInt(request.getParameter("index"));} 66 | int fromIndex = (index - 1) * Pagesize.size; 67 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 68 | List cs1 = cs.subList(fromIndex, toIndex); 69 | Pagination p = new Pagination();//创建 分页对象 70 | p.setIndex(index);//设置页数 71 | p.setPageSize(Pagesize.size); 72 | p.setTotle(cs.size());//设置总共的条数 73 | p.setData(cs1);//设置数据 74 | 75 | // 放入转发参数 76 | model.addAttribute("cs", p); 77 | model.addAttribute("page", p); 78 | model.addAttribute("dlist", cs); 79 | return "pages/kanfang/kanfangmy"; 80 | } 81 | //预约看房列表管理页面 82 | @RequestMapping("kanfanglist") 83 | public String listKanfang(Model model){ 84 | String w=""; 85 | 86 | if (!"".equals(request.getParameter("zfang")) && request.getParameter("zfang") !=null) 87 | w=w+ " and zfang = "+request.getParameter("zfang")+""; 88 | 89 | if (!"".equals(request.getParameter("sdate")) && request.getParameter("sdate") !=null) 90 | w=w+ " and sdate like '%"+request.getParameter("sdate")+"%'"; 91 | 92 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 93 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 94 | 95 | if (!"".equals(request.getParameter("sname")) && request.getParameter("sname") !=null) 96 | w=w+ " and sname like '%"+request.getParameter("sname")+"%'"; 97 | 98 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 99 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 100 | 101 | List cs= kanfangService.list(w); 102 | for(int i=0;i zfang= zfangService.list(""); 108 | // 放入转发参数 109 | model.addAttribute("zfang", zfang); 110 | int index=0; 111 | if(request.getParameter("index")==null) 112 | {index=1;} 113 | else 114 | {index=Integer.parseInt(request.getParameter("index"));} 115 | int fromIndex = (index - 1) * Pagesize.size; 116 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 117 | List cs1 = cs.subList(fromIndex, toIndex); 118 | Pagination p = new Pagination();//创建 分页对象 119 | p.setIndex(index);//设置页数 120 | p.setPageSize(Pagesize.size); 121 | p.setTotle(cs.size());//设置总共的条数 122 | p.setData(cs1);//设置数据 123 | 124 | // 放入转发参数 125 | model.addAttribute("cs", p); 126 | model.addAttribute("page", p); 127 | model.addAttribute("dlist", cs); 128 | // 放入转发参数 129 | 130 | return "pages/kanfang/kanfanglist"; 131 | } 132 | 133 | @RequestMapping("kanfangadd") 134 | public String addkanfang(Model model){ 135 | List zfang= zfangService.list(""); 136 | // 放入转发参数 137 | model.addAttribute("zfang", zfang); 138 | 139 | return "pages/kanfang/kanfangadd"; 140 | } 141 | //添加预约看房数据 142 | @RequestMapping("kanfanginsert") 143 | public String insertKanfang(Kanfang kanfang,Model model){ 144 | String forword=request.getParameter("forword"); 145 | kanfangService.insert(kanfang); 146 | model.addAttribute("msg","成功"); 147 | model.addAttribute("path",forword); 148 | return "success"; 149 | 150 | } 151 | //删除预约看房数据 152 | @RequestMapping("kanfangdel") 153 | public String deleteKanfang(Kanfang kanfang,Model model){ 154 | String forword=request.getParameter("forword"); 155 | kanfangService.delete(kanfang); 156 | model.addAttribute("msg","删除成功"); 157 | model.addAttribute("path",forword); 158 | return "success"; 159 | }//提取要修改的预约看房数据 160 | @RequestMapping("kanfangedit") 161 | public String editKanfang(Model model,Kanfang kanfang){ 162 | Kanfang c= kanfangService.get(kanfang.getId()); 163 | List zfang= zfangService.list(""); 164 | // 放入转发参数 165 | model.addAttribute("zfang", zfang); 166 | 167 | model.addAttribute("c", c); 168 | return "pages/kanfang/kanfangedit"; 169 | } 170 | 171 | //修改的预约看房数据 172 | @RequestMapping("kanfangupdate") 173 | public String updateKanfang(Kanfang kanfang,Model model){ 174 | String forword=request.getParameter("forword"); 175 | kanfangService.update(kanfang); 176 | model.addAttribute("msg","操作成功"); 177 | model.addAttribute("path",forword); 178 | return "success"; 179 | } 180 | //预约看房所有列表页 181 | @RequestMapping("kanfangAll") 182 | public String listKanfangAll(Model model){ 183 | String w=""; 184 | 185 | if (!"".equals(request.getParameter("zfang")) && request.getParameter("zfang") !=null) 186 | w=w+ " and zfang = "+request.getParameter("zfang")+""; 187 | 188 | if (!"".equals(request.getParameter("sdate")) && request.getParameter("sdate") !=null) 189 | w=w+ " and sdate like '%"+request.getParameter("sdate")+"%'"; 190 | 191 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 192 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 193 | 194 | if (!"".equals(request.getParameter("sname")) && request.getParameter("sname") !=null) 195 | w=w+ " and sname like '%"+request.getParameter("sname")+"%'"; 196 | 197 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 198 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 199 | 200 | List cs= kanfangService.list(w); 201 | for(int i=0;i zfang= zfangService.list(""); 207 | // 放入转发参数 208 | model.addAttribute("zfang", zfang); 209 | int index=0; 210 | if(request.getParameter("index")==null) 211 | {index=1;} 212 | else 213 | {index=Integer.parseInt(request.getParameter("index"));} 214 | int fromIndex = (index - 1) * Pagesize.size; 215 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 216 | List cs1 = cs.subList(fromIndex, toIndex); 217 | Pagination p = new Pagination();//创建 分页对象 218 | p.setIndex(index);//设置页数 219 | p.setPageSize(Pagesize.size); 220 | p.setTotle(cs.size());//设置总共的条数 221 | p.setData(cs1);//设置数据 222 | 223 | // 放入转发参数 224 | model.addAttribute("cs", p); 225 | model.addAttribute("page", p); 226 | model.addAttribute("dlist", cs); 227 | // 放入转发参数 228 | return "pages/kanfang/kanfangAll"; 229 | } 230 | } -------------------------------------------------------------------------------- /src/com/controller/DingdanController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | import java.util.List; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.ui.Model; 9 | 10 | import com.entity.Dingdan; 11 | import com.service.DingdanService; 12 | import com.entity.Fang; 13 | import com.service.FangService; 14 | 15 | import com.util.Page; 16 | import com.util.Pagesize; 17 | import com.util.Pagination; 18 | //告诉spring mvc这是一个控制器类 19 | @Controller 20 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 21 | @RequestMapping("") 22 | public class DingdanController { 23 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 24 | @Autowired 25 | DingdanService dingdanService; 26 | @Autowired 27 | FangService fangService; 28 | @Autowired 29 | HttpServletRequest request; 30 | //个人列表页 31 | @RequestMapping("dingdanmy") 32 | public String listDingdanmy(Model model){ 33 | HttpSession session=request.getSession(); 34 | String uname= (String) session.getAttribute("loginname"); 35 | String w=" and uname='"+uname+"'"; 36 | 37 | if (!"".equals(request.getParameter("fang")) && request.getParameter("fang") !=null) 38 | w=w+ " and fang = "+request.getParameter("fang")+""; 39 | 40 | if (!"".equals(request.getParameter("orderid")) && request.getParameter("orderid") !=null) 41 | w=w+ " and orderid like '%"+request.getParameter("orderid")+"%'"; 42 | 43 | if (!"".equals(request.getParameter("yajin")) && request.getParameter("yajin") !=null) 44 | w=w+ " and yajin like '%"+request.getParameter("yajin")+"%'"; 45 | 46 | if (!"".equals(request.getParameter("sdate")) && request.getParameter("sdate") !=null) 47 | w=w+ " and sdate like '%"+request.getParameter("sdate")+"%'"; 48 | 49 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 50 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 51 | 52 | if (!"".equals(request.getParameter("sname")) && request.getParameter("sname") !=null) 53 | w=w+ " and sname like '%"+request.getParameter("sname")+"%'"; 54 | 55 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 56 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 57 | 58 | List cs= dingdanService.list(w); 59 | for(int i=0;i fang= fangService.list(""); 65 | // 放入转发参数 66 | model.addAttribute("fang", fang); 67 | int index=0; 68 | if(request.getParameter("index")==null) 69 | {index=1;} 70 | else 71 | {index=Integer.parseInt(request.getParameter("index"));} 72 | int fromIndex = (index - 1) * Pagesize.size; 73 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 74 | List cs1 = cs.subList(fromIndex, toIndex); 75 | Pagination p = new Pagination();//创建 分页对象 76 | p.setIndex(index);//设置页数 77 | p.setPageSize(Pagesize.size); 78 | p.setTotle(cs.size());//设置总共的条数 79 | p.setData(cs1);//设置数据 80 | 81 | // 放入转发参数 82 | model.addAttribute("cs", p); 83 | model.addAttribute("page", p); 84 | model.addAttribute("dlist", cs); 85 | return "pages/dingdan/dingdanmy"; 86 | } 87 | //购房订单列表管理页面 88 | @RequestMapping("dingdanlist") 89 | public String listDingdan(Model model){ 90 | HttpSession session=request.getSession(); 91 | String uname= (String) session.getAttribute("loginname"); 92 | String w=" and sname='"+uname+"'"; 93 | 94 | if (!"".equals(request.getParameter("fang")) && request.getParameter("fang") !=null) 95 | w=w+ " and fang = "+request.getParameter("fang")+""; 96 | 97 | if (!"".equals(request.getParameter("orderid")) && request.getParameter("orderid") !=null) 98 | w=w+ " and orderid like '%"+request.getParameter("orderid")+"%'"; 99 | 100 | if (!"".equals(request.getParameter("yajin")) && request.getParameter("yajin") !=null) 101 | w=w+ " and yajin like '%"+request.getParameter("yajin")+"%'"; 102 | 103 | if (!"".equals(request.getParameter("sdate")) && request.getParameter("sdate") !=null) 104 | w=w+ " and sdate like '%"+request.getParameter("sdate")+"%'"; 105 | 106 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 107 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 108 | 109 | 110 | 111 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 112 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 113 | 114 | List cs= dingdanService.list(w); 115 | for(int i=0;i fang= fangService.list(""); 121 | // 放入转发参数 122 | model.addAttribute("fang", fang); 123 | int index=0; 124 | if(request.getParameter("index")==null) 125 | {index=1;} 126 | else 127 | {index=Integer.parseInt(request.getParameter("index"));} 128 | int fromIndex = (index - 1) * Pagesize.size; 129 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 130 | List cs1 = cs.subList(fromIndex, toIndex); 131 | Pagination p = new Pagination();//创建 分页对象 132 | p.setIndex(index);//设置页数 133 | p.setPageSize(Pagesize.size); 134 | p.setTotle(cs.size());//设置总共的条数 135 | p.setData(cs1);//设置数据 136 | 137 | // 放入转发参数 138 | model.addAttribute("cs", p); 139 | model.addAttribute("page", p); 140 | model.addAttribute("dlist", cs); 141 | // 放入转发参数 142 | 143 | return "pages/dingdan/dingdanlist"; 144 | } 145 | 146 | @RequestMapping("dingdanadd") 147 | public String adddingdan(Model model){ 148 | List fang= fangService.list(""); 149 | // 放入转发参数 150 | model.addAttribute("fang", fang); 151 | 152 | return "pages/dingdan/dingdanadd"; 153 | } 154 | //添加购房订单数据 155 | @RequestMapping("dingdaninsert") 156 | public String insertDingdan(Dingdan dingdan,Model model){ 157 | String forword=request.getParameter("forword"); 158 | dingdanService.insert(dingdan); 159 | model.addAttribute("msg","成功"); 160 | model.addAttribute("path",forword); 161 | return "success"; 162 | 163 | } 164 | //删除购房订单数据 165 | @RequestMapping("dingdandel") 166 | public String deleteDingdan(Dingdan dingdan,Model model){ 167 | String forword=request.getParameter("forword"); 168 | dingdanService.delete(dingdan); 169 | model.addAttribute("msg","删除成功"); 170 | model.addAttribute("path",forword); 171 | return "success"; 172 | }//提取要修改的购房订单数据 173 | @RequestMapping("dingdanedit") 174 | public String editDingdan(Model model,Dingdan dingdan){ 175 | Dingdan c= dingdanService.get(dingdan.getId()); 176 | List fang= fangService.list(""); 177 | // 放入转发参数 178 | model.addAttribute("fang", fang); 179 | 180 | model.addAttribute("c", c); 181 | return "pages/dingdan/dingdanedit"; 182 | } 183 | 184 | //修改的购房订单数据 185 | @RequestMapping("dingdanupdate") 186 | public String updateDingdan(Dingdan dingdan,Model model){ 187 | String forword=request.getParameter("forword"); 188 | dingdanService.update(dingdan); 189 | model.addAttribute("msg","操作成功"); 190 | model.addAttribute("path",forword); 191 | return "success"; 192 | } 193 | //购房订单所有列表页 194 | @RequestMapping("dingdanAll") 195 | public String listDingdanAll(Model model){ 196 | String w=""; 197 | 198 | if (!"".equals(request.getParameter("fang")) && request.getParameter("fang") !=null) 199 | w=w+ " and fang = "+request.getParameter("fang")+""; 200 | 201 | if (!"".equals(request.getParameter("orderid")) && request.getParameter("orderid") !=null) 202 | w=w+ " and orderid like '%"+request.getParameter("orderid")+"%'"; 203 | 204 | if (!"".equals(request.getParameter("yajin")) && request.getParameter("yajin") !=null) 205 | w=w+ " and yajin like '%"+request.getParameter("yajin")+"%'"; 206 | 207 | if (!"".equals(request.getParameter("sdate")) && request.getParameter("sdate") !=null) 208 | w=w+ " and sdate like '%"+request.getParameter("sdate")+"%'"; 209 | 210 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 211 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 212 | 213 | if (!"".equals(request.getParameter("sname")) && request.getParameter("sname") !=null) 214 | w=w+ " and sname like '%"+request.getParameter("sname")+"%'"; 215 | 216 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 217 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 218 | 219 | List cs= dingdanService.list(w); 220 | for(int i=0;i fang= fangService.list(""); 226 | // 放入转发参数 227 | model.addAttribute("fang", fang); 228 | int index=0; 229 | if(request.getParameter("index")==null) 230 | {index=1;} 231 | else 232 | {index=Integer.parseInt(request.getParameter("index"));} 233 | int fromIndex = (index - 1) * Pagesize.size; 234 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 235 | List cs1 = cs.subList(fromIndex, toIndex); 236 | Pagination p = new Pagination();//创建 分页对象 237 | p.setIndex(index);//设置页数 238 | p.setPageSize(Pagesize.size); 239 | p.setTotle(cs.size());//设置总共的条数 240 | p.setData(cs1);//设置数据 241 | 242 | // 放入转发参数 243 | model.addAttribute("cs", p); 244 | model.addAttribute("page", p); 245 | model.addAttribute("dlist", cs); 246 | // 放入转发参数 247 | return "pages/dingdan/dingdanAll"; 248 | } 249 | } -------------------------------------------------------------------------------- /src/com/controller/FangController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | import java.util.List; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.ui.Model; 9 | 10 | import com.entity.Fang; 11 | import com.service.FangService; 12 | import com.entity.Area; 13 | import com.service.AreaService; 14 | 15 | import com.util.Page; 16 | import com.util.Pagesize; 17 | import com.util.Pagination; 18 | //告诉spring mvc这是一个控制器类 19 | @Controller 20 | //RequestMapping注解会将 HTTP 请求映射到 MVC 和 REST 控制器的处理方法上。 21 | @RequestMapping("") 22 | public class FangController { 23 | //它可以对类成员变量,方法及构造函数进行标注,完成自动装配的工作,通过 @Autowired的使用来消除 set,get方法 24 | @Autowired 25 | FangService fangService; 26 | @Autowired 27 | AreaService areaService; 28 | @Autowired 29 | HttpServletRequest request; 30 | //个人列表页 31 | @RequestMapping("fangmy") 32 | public String listFangmy(Model model){ 33 | HttpSession session=request.getSession(); 34 | String uname= (String) session.getAttribute("loginname"); 35 | String w=" and uname='"+uname+"'"; 36 | 37 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") !=null) 38 | w=w+ " and name like '%"+request.getParameter("name")+"%'"; 39 | 40 | if (!"".equals(request.getParameter("area")) && request.getParameter("area") !=null) 41 | w=w+ " and area = '"+request.getParameter("area")+"'"; 42 | 43 | if (!"".equals(request.getParameter("xiaoqu")) && request.getParameter("xiaoqu") !=null) 44 | w=w+ " and xiaoqu like '%"+request.getParameter("xiaoqu")+"%'"; 45 | 46 | if (!"".equals(request.getParameter("chanquan")) && request.getParameter("chanquan") !=null) 47 | w=w+ " and chanquan like '%"+request.getParameter("chanquan")+"%'"; 48 | 49 | if (!"".equals(request.getParameter("niandai")) && request.getParameter("niandai") !=null) 50 | w=w+ " and niandai like '%"+request.getParameter("niandai")+"%'"; 51 | 52 | if (!"".equals(request.getParameter("chaoxiang")) && request.getParameter("chaoxiang") !=null) 53 | w=w+ " and chaoxiang like '%"+request.getParameter("chaoxiang")+"%'"; 54 | 55 | if (!"".equals(request.getParameter("zhuangxiu")) && request.getParameter("zhuangxiu") !=null) 56 | w=w+ " and zhuangxiu like '%"+request.getParameter("zhuangxiu")+"%'"; 57 | 58 | if (!"".equals(request.getParameter("mianji")) && request.getParameter("mianji") !=null) 59 | w=w+ " and mianji like '%"+request.getParameter("mianji")+"%'"; 60 | 61 | if (!"".equals(request.getParameter("lianxiren")) && request.getParameter("lianxiren") !=null) 62 | w=w+ " and lianxiren like '%"+request.getParameter("lianxiren")+"%'"; 63 | 64 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 65 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 66 | 67 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 68 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 69 | 70 | List cs= fangService.list(w); 71 | for(int i=0;i area= areaService.list(""); 76 | // 放入转发参数 77 | model.addAttribute("area", area); 78 | int index=0; 79 | if(request.getParameter("index")==null) 80 | {index=1;} 81 | else 82 | {index=Integer.parseInt(request.getParameter("index"));} 83 | int fromIndex = (index - 1) * Pagesize.size; 84 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 85 | List cs1 = cs.subList(fromIndex, toIndex); 86 | Pagination p = new Pagination();//创建 分页对象 87 | p.setIndex(index);//设置页数 88 | p.setPageSize(Pagesize.size); 89 | p.setTotle(cs.size());//设置总共的条数 90 | p.setData(cs1);//设置数据 91 | 92 | // 放入转发参数 93 | model.addAttribute("cs", p); 94 | model.addAttribute("page", p); 95 | model.addAttribute("dlist", cs); 96 | return "pages/fang/fangmy"; 97 | } 98 | //房屋信息列表管理页面 99 | @RequestMapping("fanglist") 100 | public String listFang(Model model){ 101 | String w=""; 102 | 103 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") !=null) 104 | w=w+ " and name like '%"+request.getParameter("name")+"%'"; 105 | 106 | if (!"".equals(request.getParameter("area")) && request.getParameter("area") !=null) 107 | w=w+ " and area = '"+request.getParameter("area")+"'"; 108 | 109 | if (!"".equals(request.getParameter("xiaoqu")) && request.getParameter("xiaoqu") !=null) 110 | w=w+ " and xiaoqu like '%"+request.getParameter("xiaoqu")+"%'"; 111 | 112 | if (!"".equals(request.getParameter("chanquan")) && request.getParameter("chanquan") !=null) 113 | w=w+ " and chanquan like '%"+request.getParameter("chanquan")+"%'"; 114 | 115 | if (!"".equals(request.getParameter("niandai")) && request.getParameter("niandai") !=null) 116 | w=w+ " and niandai like '%"+request.getParameter("niandai")+"%'"; 117 | 118 | if (!"".equals(request.getParameter("chaoxiang")) && request.getParameter("chaoxiang") !=null) 119 | w=w+ " and chaoxiang like '%"+request.getParameter("chaoxiang")+"%'"; 120 | 121 | if (!"".equals(request.getParameter("zhuangxiu")) && request.getParameter("zhuangxiu") !=null) 122 | w=w+ " and zhuangxiu like '%"+request.getParameter("zhuangxiu")+"%'"; 123 | 124 | if (!"".equals(request.getParameter("mianji")) && request.getParameter("mianji") !=null) 125 | w=w+ " and mianji like '%"+request.getParameter("mianji")+"%'"; 126 | 127 | if (!"".equals(request.getParameter("lianxiren")) && request.getParameter("lianxiren") !=null) 128 | w=w+ " and lianxiren like '%"+request.getParameter("lianxiren")+"%'"; 129 | 130 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 131 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 132 | 133 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 134 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 135 | 136 | List cs= fangService.list(w); 137 | for(int i=0;i area= areaService.list(""); 142 | // 放入转发参数 143 | model.addAttribute("area", area); 144 | int index=0; 145 | if(request.getParameter("index")==null) 146 | {index=1;} 147 | else 148 | {index=Integer.parseInt(request.getParameter("index"));} 149 | int fromIndex = (index - 1) * Pagesize.size; 150 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 151 | List cs1 = cs.subList(fromIndex, toIndex); 152 | Pagination p = new Pagination();//创建 分页对象 153 | p.setIndex(index);//设置页数 154 | p.setPageSize(Pagesize.size); 155 | p.setTotle(cs.size());//设置总共的条数 156 | p.setData(cs1);//设置数据 157 | 158 | // 放入转发参数 159 | model.addAttribute("cs", p); 160 | model.addAttribute("page", p); 161 | model.addAttribute("dlist", cs); 162 | // 放入转发参数 163 | 164 | return "pages/fang/fanglist"; 165 | } 166 | 167 | @RequestMapping("fangadd") 168 | public String addfang(Model model){ 169 | List area= areaService.list(""); 170 | // 放入转发参数 171 | model.addAttribute("area", area); 172 | 173 | return "pages/fang/fangadd"; 174 | } 175 | //添加房屋信息数据 176 | @RequestMapping("fanginsert") 177 | public String insertFang(Fang fang,Model model){ 178 | String forword=request.getParameter("forword"); 179 | fangService.insert(fang); 180 | model.addAttribute("msg","成功"); 181 | model.addAttribute("path",forword); 182 | return "success"; 183 | 184 | } 185 | //删除房屋信息数据 186 | @RequestMapping("fangdel") 187 | public String deleteFang(Fang fang,Model model){ 188 | String forword=request.getParameter("forword"); 189 | fangService.delete(fang); 190 | model.addAttribute("msg","删除成功"); 191 | model.addAttribute("path",forword); 192 | return "success"; 193 | }//提取要修改的房屋信息数据 194 | @RequestMapping("fangedit") 195 | public String editFang(Model model,Fang fang){ 196 | Fang c= fangService.get(fang.getId()); 197 | List area= areaService.list(""); 198 | // 放入转发参数 199 | model.addAttribute("area", area); 200 | 201 | model.addAttribute("c", c); 202 | return "pages/fang/fangedit"; 203 | } 204 | 205 | //修改的房屋信息数据 206 | @RequestMapping("fangupdate") 207 | public String updateFang(Fang fang,Model model){ 208 | String forword=request.getParameter("forword"); 209 | fangService.update(fang); 210 | model.addAttribute("msg","操作成功"); 211 | model.addAttribute("path",forword); 212 | return "success"; 213 | } 214 | //房屋信息所有列表页 215 | @RequestMapping("fangAll") 216 | public String listFangAll(Model model){ 217 | String w=" and zt='已审核'"; 218 | 219 | 220 | if (!"".equals(request.getParameter("name")) && request.getParameter("name") !=null) 221 | w=w+ " and name like '%"+request.getParameter("name")+"%'"; 222 | 223 | if (!"".equals(request.getParameter("area")) && request.getParameter("area") !=null) 224 | w=w+ " and area = '"+request.getParameter("area")+"'"; 225 | 226 | if (!"".equals(request.getParameter("xiaoqu")) && request.getParameter("xiaoqu") !=null) 227 | w=w+ " and xiaoqu like '%"+request.getParameter("xiaoqu")+"%'"; 228 | 229 | if (!"".equals(request.getParameter("chanquan")) && request.getParameter("chanquan") !=null) 230 | w=w+ " and chanquan like '%"+request.getParameter("chanquan")+"%'"; 231 | 232 | if (!"".equals(request.getParameter("niandai")) && request.getParameter("niandai") !=null) 233 | w=w+ " and niandai like '%"+request.getParameter("niandai")+"%'"; 234 | 235 | if (!"".equals(request.getParameter("chaoxiang")) && request.getParameter("chaoxiang") !=null) 236 | w=w+ " and chaoxiang like '%"+request.getParameter("chaoxiang")+"%'"; 237 | 238 | if (!"".equals(request.getParameter("zhuangxiu")) && request.getParameter("zhuangxiu") !=null) 239 | w=w+ " and zhuangxiu like '%"+request.getParameter("zhuangxiu")+"%'"; 240 | 241 | if (!"".equals(request.getParameter("mianji")) && request.getParameter("mianji") !=null) 242 | w=w+ " and mianji like '%"+request.getParameter("mianji")+"%'"; 243 | 244 | if (!"".equals(request.getParameter("lianxiren")) && request.getParameter("lianxiren") !=null) 245 | w=w+ " and lianxiren like '%"+request.getParameter("lianxiren")+"%'"; 246 | 247 | if (!"".equals(request.getParameter("tel")) && request.getParameter("tel") !=null) 248 | w=w+ " and tel like '%"+request.getParameter("tel")+"%'"; 249 | 250 | if (!"".equals(request.getParameter("zt")) && request.getParameter("zt") !=null) 251 | w=w+ " and zt like '%"+request.getParameter("zt")+"%'"; 252 | 253 | List cs= fangService.list(w); 254 | for(int i=0;i area= areaService.list(""); 259 | // 放入转发参数 260 | model.addAttribute("area", area); 261 | int index=0; 262 | if(request.getParameter("index")==null) 263 | {index=1;} 264 | else 265 | {index=Integer.parseInt(request.getParameter("index"));} 266 | int fromIndex = (index - 1) * Pagesize.size; 267 | int toIndex = Math.min(fromIndex + Pagesize.size, cs.size()); 268 | List cs1 = cs.subList(fromIndex, toIndex); 269 | Pagination p = new Pagination();//创建 分页对象 270 | p.setIndex(index);//设置页数 271 | p.setPageSize(Pagesize.size); 272 | p.setTotle(cs.size());//设置总共的条数 273 | p.setData(cs1);//设置数据 274 | 275 | // 放入转发参数 276 | model.addAttribute("cs", p); 277 | model.addAttribute("page", p); 278 | model.addAttribute("dlist", cs); 279 | // 放入转发参数 280 | return "pages/fang/fangAll"; 281 | } 282 | 283 | @RequestMapping("fangview") 284 | public String viewFang(Model model,Fang fang){ 285 | Fang c= fangService.get(fang.getId()); 286 | model.addAttribute("c", c); 287 | return "pages/fang/fangview"; 288 | } 289 | } -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 22 | 23 | 30 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 132 | 133 | 134 |