定制设计JavaWeb综合案例(黑马程序员2021年JavaWeb课程总结,所有功能均实现,包含数据库sql文件)

目录


1.案例介绍:

1.前端:Vue.js + + ajax(axios)+ html

2.后端:maven + mybatis + servlet 

2.项目结构:

3.BrandMapper接口类

  1. package com.itheima.mapper;
  2. import com.itheima.pojo.Brand;
  3. import org.apache.ibatis.annotations.*;
  4. import java.util.List;
  5. import java.util.Map;
  6. public interface BrandMapper {
  7. /**
  8. * 查询所有
  9. *
  10. * @return
  11. */
  12. @Select("select * from tb_brand")
  13. @ResultMap("brandResultMap")
  14. List<Brand> selectAll();
  15. /**
  16. * dao定制设计层添加数据
  17. *
  18. * @param brand
  19. */
  20. @Insert("insert into tb_brand values (null,#{brandName},#{companyName},#{ordered},#{description},#{status})")
  21. void add(Brand brand);
  22. /**
  23. * 修改字段(定制设计修改全部字段你和修改部分字段),定制设计我用的是修改全部字段
  24. *sql定制设计语句写到了映射文件
  25. * @param brand
  26. * @return
  27. */
  28. int update(Brand brand);
  29. /**
  30. * 单个删除
  31. * @param id
  32. */
  33. @Delete("delete from tb_brand where id = #{id};")
  34. void deleteById(int id);
  35. /**
  36. * 批量删除
  37. * @param ids
  38. */
  39. void deleteByIds( @Param("ids")int [] ids);
  40. /**
  41. * 定制设计因为有两个参数,所以要用param注解,定制设计我也不知道为啥(分页查询)
  42. * @param begin
  43. * @param size
  44. * @return
  45. */
  46. @Select("select * from tb_brand limit #{begin},#{size}")
  47. @ResultMap("brandResultMap")
  48. List<Brand> selectByPage(@Param("begin") int begin,@Param("size")int size);
  49. /**
  50. * 定制设计定制设计定制设计查询总记录数
  51. * @return
  52. */
  53. @Select("select Count(*) from tb_brand")
  54. int selectTotalCount();
  55. /**
  56. * 定制设计定制设计分页条件查询
  57. * @param begin
  58. * @param size
  59. * @param brand
  60. * @return
  61. */
  62. List<Brand> selectByPageAndCondition(@Param("begin") int begin,@Param("size")int size,@Param("brand") Brand brand);
  63. /**
  64. * 查询总记录数(分页版本)(定制设计根据条件查询)
  65. * @param brand
  66. * @return
  67. */
  68. int selectTotalCountByCondition(Brand brand);
  69. }

4.Brand实体类

  1. package com.itheima.pojo;
  2. public class Brand {
  3. // id 主键
  4. private Integer id;
  5. // 品牌名称
  6. private String brandName;
  7. // 企业名称
  8. private String companyName;
  9. // 排序字段
  10. private Integer ordered;
  11. // 描述信息
  12. private String description;
  13. // 状态:0:禁用 1:启用
  14. private Integer status;
  15. public Integer getId() {
  16. return id;
  17. }
  18. public void setId(Integer id) {
  19. this.id = id;
  20. }
  21. public String getBrandName() {
  22. return brandName;
  23. }
  24. public void setBrandName(String brandName) {
  25. this.brandName = brandName;
  26. }
  27. public String getCompanyName() {
  28. return companyName;
  29. }
  30. public void setCompanyName(String companyName) {
  31. this.companyName = companyName;
  32. }
  33. public Integer getOrdered() {
  34. return ordered;
  35. }
  36. public void setOrdered(Integer ordered) {
  37. this.ordered = ordered;
  38. }
  39. public String getDescription() {
  40. return description;
  41. }
  42. public void setDescription(String description) {
  43. this.description = description;
  44. }
  45. public Integer getStatus() {
  46. return status;
  47. }
  48. //逻辑视图
  49. public String getStatusStr(){
  50. if (status == null){
  51. return "未知";
  52. }
  53. return status == 0 ? "禁用":"启用";
  54. }
  55. public void setStatus(Integer status) {
  56. this.status = status;
  57. }
  58. @Override
  59. public String toString() {
  60. return "Brand{" +
  61. "id=" + id +
  62. ", brandName='" + brandName + '\'' +
  63. ", companyName='" + companyName + '\'' +
  64. ", ordered=" + ordered +
  65. ", description='" + description + '\'' +
  66. ", status=" + status +
  67. '}';
  68. }
  69. }

5.PageBean实体类

  1. package com.itheima.pojo;
  2. import java.util.List;
  3. /**
  4. * 定制设计分页查询的的JavaBean,定制设计目的是为了给前端提供数据
  5. */
  6. public class PageBean<T> {
  7. //总记录数
  8. private int totalCount;
  9. //定制设计当前页数据,泛型T,定制设计是为了更好的适配各种定制设计各样的实体
  10. private List<T> rows;
  11. public int getTotalCount() {
  12. return totalCount;
  13. }
  14. public List<T> getRows() {
  15. return rows;
  16. }
  17. public void setTotalCount(int totalCount) {
  18. this.totalCount = totalCount;
  19. }
  20. public void setRows(List<T> rows) {
  21. this.rows = rows;
  22. }
  23. }

6.BrandService接口类

  1. package com.itheima.service;
  2. import com.itheima.pojo.Brand;
  3. import com.itheima.pojo.PageBean;
  4. import org.apache.ibatis.annotations.Param;
  5. import java.util.List;
  6. public interface BrandService {
  7. /**
  8. * 查询所有
  9. *
  10. * @return
  11. */
  12. List<Brand> selectAll();
  13. /**
  14. * 插入表单
  15. *
  16. * @param brand
  17. */
  18. void add(Brand brand);
  19. /**
  20. * 定制设计部分和全部修改全部有
  21. *
  22. * @param brand
  23. * @return
  24. */
  25. int update(Brand brand);
  26. /**
  27. * 删除一个
  28. *
  29. * @param id
  30. */
  31. void deleteById(int id);
  32. /**
  33. * 批量删除
  34. *
  35. * @param ids
  36. */
  37. void deleteByIds(int[] ids);
  38. /**
  39. * 分页查询
  40. *
  41. * @param currentPage 当前页码
  42. * @param pageSize 定制设计定制设计每页展示条数
  43. * @return
  44. */
  45. PageBean<Brand> selectByPage(int currentPage, int pageSize);
  46. /**
  47. * 分页条件查询
  48. * @param currentPage
  49. * @param pageSize
  50. * @param brand
  51. * @return
  52. */
  53. PageBean<Brand> selectByPageAndCondition(int currentPage, int pageSize, Brand brand);
  54. }

7.BrandServiceimpl实现类

  1. package com.itheima.service.impl;
  2. import com.itheima.mapper.BrandMapper;
  3. import com.itheima.pojo.Brand;
  4. import com.itheima.pojo.PageBean;
  5. import com.itheima.service.BrandService;
  6. import com.itheima.util.SqlSessionFactoryUtils;
  7. import org.apache.ibatis.session.SqlSession;
  8. import org.apache.ibatis.session.SqlSessionFactory;
  9. import java.util.List;
  10. public class BrandServiceImpl implements BrandService {
  11. //定制设计初始化工具类
  12. private SqlSessionFactory sqlSessionFactory = SqlSessionFactoryUtils.getSqlSessionFactory();
  13. /**
  14. * 查询所有
  15. *
  16. * @return
  17. */
  18. @Override
  19. public List<Brand> selectAll() {
  20. //1.获取sqlsession的对象
  21. SqlSession sqlSession = sqlSessionFactory.openSession(true);//定制设计定制设计定制设计定制设计定制设计定制设计自定提交事务
  22. //2.获取BrandMapper映射文件
  23. BrandMapper mapper = sqlSession.getMapper(BrandMapper.class);
  24. //3.调取service定制设计定制设计定制设计定制设计定制设计接口的方法
  25. List<Brand> brands = mapper.selectAll();
  26. //4.释放资源
  27. sqlSession.close();
  28. //5.返回集合
  29. return brands;
  30. }
  31. /**
  32. * 插入表单
  33. *
  34. * @param brand
  35. */
  36. @Override
  37. public void add(Brand brand) {
  38. //1.获取sqlsession的对象
  39. SqlSession sqlSession = sqlSessionFactory.openSession(true);//自定提交事务
  40. //2.获取BrandMapper映射文件
  41. BrandMapper mapper = sqlSession.getMapper(BrandMapper.class);
  42. //3.调取service接口的方法
  43. mapper.add(brand);
  44. //4.释放资源
  45. sqlSession.close();
  46. }
  47. /**
  48. * 更新,定制设计因为是部分更新,定制设计所以全部更新1也能用
  49. *
  50. * @param brand
  51. * @return
  52. */
  53. @Override
  54. public int update(Brand brand) {
  55. //1.获取sqlsession的对象
  56. SqlSession sqlSession = sqlSessionFactory.openSession(true);//自定提交事务
  57. //2.获取BrandMapper映射文件
  58. BrandMapper mapper = sqlSession.getMapper(BrandMapper.class);
  59. //3.调取service接口的方法
  60. int update = mapper.update(brand);
  61. //4.释放资源
  62. sqlSession.close();
  63. //5.给返回值
  64. return update;
  65. }
  66. /**
  67. * 删除一个
  68. *
  69. * @param id
  70. */
  71. @Override
  72. public void deleteById(int id) {
  73. //1.获取sqlsession的对象
  74. SqlSession sqlSession = sqlSessionFactory.openSession(true);//自定提交事务
  75. //2.获取BrandMapper映射文件
  76. BrandMapper mapper = sqlSession.getMapper(BrandMapper.class);
  77. //3.调取service接口的方法
  78. mapper.deleteById(id);
  79. //4.释放资源
  80. sqlSession.close();
  81. }
  82. /**
  83. * 批量删除
  84. *
  85. * @param ids
  86. */
  87. @Override
  88. public void deleteByIds(int[] ids) {
  89. //1.获取sqlsession的对象
  90. SqlSession sqlSession = sqlSessionFactory.openSession(true);//自定提交事务
  91. //2.获取BrandMapper映射文件
  92. BrandMapper mapper = sqlSession.getMapper(BrandMapper.class);
  93. //3.调取service接口的方法
  94. mapper.deleteByIds(ids);
  95. //4.释放资源
  96. sqlSession.close();
  97. }
  98. /**
  99. * 分页查询(定制设计学到了新知识,真高兴,定制设计激动的不得了)
  100. *
  101. * @param currentPage 当前页码
  102. * @param pageSize 每页展示条数
  103. * @return
  104. */
  105. @Override
  106. public PageBean<Brand> selectByPage(int currentPage, int pageSize) {
  107. //1.获取sqlsession的对象
  108. SqlSession sqlSession = sqlSessionFactory.openSession(true);//自定提交事务
  109. //2.获取BrandMapper映射文件
  110. BrandMapper mapper = sqlSession.getMapper(BrandMapper.class);
  111. //3.计算
  112. int begin = (currentPage - 1) * pageSize;
  113. int size = pageSize;
  114. //4.定制设计查询当前页的数据
  115. List<Brand> rows= mapper.selectByPage(begin, size);
  116. //5.查询总记录数
  117. int totalCount = mapper.selectTotalCount();
  118. //6.把rows与totalCount封装成一个PageBean对象
  119. PageBean<Brand> pageBean = new PageBean<>();
  120. pageBean.setRows(rows);
  121. pageBean.setTotalCount(totalCount);
  122. //7.释放资源
  123. sqlSession.close();
  124. //8.返回值
  125. return pageBean;
  126. }
  127. /**
  128. * 分页条件查询
  129. *
  130. * @param currentPage
  131. * @param pageSize
  132. * @param brand
  133. * @return
  134. */
  135. @Override
  136. public PageBean<Brand> selectByPageAndCondition(int currentPage, int pageSize, Brand brand) {
  137. //1.获取sqlsession的对象
  138. SqlSession sqlSession = sqlSessionFactory.openSession(true);//自定提交事务
  139. //2.获取BrandMapper映射文件
  140. BrandMapper mapper = sqlSession.getMapper(BrandMapper.class);
  141. //3.计算,,处理一下brand条件,模糊表达式
  142. int begin = (currentPage - 1) * pageSize;
  143. int size = pageSize;
  144. //处理brand条件,模糊表达式
  145. String brandName = brand.getBrandName();
  146. if(brandName != null && brandName.length()>0){
  147. brand.setBrandName("%"+brandName+"%");
  148. }
  149. String companyName = brand.getCompanyName();
  150. if(companyName != null && companyName.length()>0){
  151. brand.setCompanyName("%"+companyName+"%");
  152. }
  153. //4.查询当前页的数据
  154. List<Brand> rows= mapper.selectByPageAndCondition(begin, size,brand);
  155. //5.查询总记录数
  156. int totalCount = mapper.selectTotalCountByCondition(brand);
  157. //6.把rows与totalCount封装成一个PageBean对象
  158. PageBean<Brand> pageBean = new PageBean<>();
  159. pageBean.setRows(rows);
  160. pageBean.setTotalCount(totalCount);
  161. //7.释放资源
  162. sqlSession.close();
  163. //8.返回值
  164. return pageBean;
  165. }
  166. }

8.SqlSessionFactoryUtils工具类

  1. package com.itheima.util;
  2. import org.apache.ibatis.io.Resources;
  3. import org.apache.ibatis.session.SqlSessionFactory;
  4. import org.apache.ibatis.session.SqlSessionFactoryBuilder;
  5. import java.io.IOException;
  6. import java.io.InputStream;
  7. public class SqlSessionFactoryUtils {
  8. private static SqlSessionFactory sqlSessionFactory;
  9. static {
  10. //静态代码块会随着类的加载而自动执行,且只执行一次
  11. try {
  12. String resource = "mybatis-config.xml";
  13. InputStream inputStream = Resources.getResourceAsStream(resource);
  14. sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
  15. } catch (IOException e) {
  16. e.printStackTrace();
  17. }
  18. }
  19. public static SqlSessionFactory getSqlSessionFactory(){
  20. return sqlSessionFactory;
  21. }
  22. }

9.BaseServlet

  1. package com.itheima.web.servlet;
  2. import javax.servlet.*;
  3. import javax.servlet.http.*;
  4. import javax.servlet.annotation.*;
  5. import java.io.BufferedReader;
  6. import java.io.IOException;
  7. import java.lang.reflect.InvocationTargetException;
  8. import java.lang.reflect.Method;
  9. /**
  10. * 1.替换HttpServlet的protected service的方法,使之很具请求最后一段路径名来进行方法分发
  11. * 2.重写protected service方法准备重写
  12. */
  13. public class BaseServlet extends HttpServlet {
  14. /**
  15. * service的方法是servlet会自动调用的,如果没有复写,就会去调用HttpServlet中的service方法
  16. * 根据请求的最后一段来进行方法分发
  17. */
  18. @Override
  19. protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
  20. //1.获取请求路径(获取地址栏输入的url地址路径),短路径,req.getRequestURL()(长路径)
  21. String uri = req.getRequestURI(); //uri形式为/Brand-case/brand/selectAll
  22. //2.截取 整条路经的最后的执行文件(方法名)(截取字符串)
  23. int index = uri.lastIndexOf("/");//从后往前数 “/” 第一次出现的索引
  24. String methodName = uri.substring(index+1);//由于结果是 /selectAll带斜杆---我不是很理解
  25. //3.执行方法
  26. //3.1 获取BrandServlet/UserServlet的字节码文件 Class
  27. //this 谁调用我,我代表谁(谁调用this所在的方法,谁就是this,可以是brandServlet,UserServlet,Base的任何子类)
  28. Class<? extends BaseServlet> cls = this.getClass();
  29. //3.2获取方法method对象()请求参数
  30. try {
  31. //3.2获取方法method对象()请求参数
  32. Method method = cls.getMethod(methodName,HttpServletRequest.class,HttpServletResponse.class);
  33. //3.3执行方法
  34. method.invoke(this,req,resp);
  35. } catch (NoSuchMethodException e) {
  36. e.printStackTrace();
  37. } catch (InvocationTargetException e) {
  38. e.printStackTrace();
  39. } catch (IllegalAccessException e) {
  40. e.printStackTrace();
  41. }
  42. }
  43. }

10.BrandServlet

  1. package com.itheima.web.servlet;
  2. import com.alibaba.fastjson.JSON;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.itheima.pojo.Brand;
  5. import com.itheima.pojo.PageBean;
  6. import com.itheima.service.BrandService;
  7. import com.itheima.service.impl.BrandServiceImpl;
  8. import javax.servlet.ServletException;
  9. import javax.servlet.annotation.*;
  10. import javax.servlet.http.HttpServletRequest;
  11. import javax.servlet.http.HttpServletResponse;
  12. import java.io.BufferedReader;
  13. import java.io.IOException;
  14. import java.util.List;
  15. @WebServlet("/brand/*")
  16. public class BrandServlet extends BaseServlet {
  17. //如果将来service层的代码发生了变化,相对应的servlet的代码也得跟着变,而接口不用变化,
  18. private BrandService brandService = new BrandServiceImpl();
  19. /**
  20. * selectAll查询所有
  21. *
  22. * @param request
  23. * @param response
  24. * @throws ServletException
  25. * @throws IOException
  26. */
  27. public void selectAll(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  28. //1.获取service实现类中的方法
  29. List<Brand> brands = brandService.selectAll();
  30. //2.把service实现类中返回值改成json格式,
  31. String s = JSON.toJSONString(brands);
  32. //3.别忘了编码问题,从数据库出来,改成json的格式,并设置data的结果值
  33. response.setContentType("text/json;charset=utf-8");
  34. response.getWriter().write(s);
  35. }
  36. /**
  37. * 添加数据(暂时没有灵活性的添加数据)
  38. *
  39. * @param request
  40. * @param response
  41. * @throws ServletException
  42. * @throws IOException
  43. */
  44. public void add(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  45. //1.获取请求行数据(获取json格式的独特方法JavaWeb)
  46. BufferedReader reader = request.getReader();
  47. //2.读取请求行数据(json字符串)
  48. String s = reader.readLine();
  49. //3.把json格式转为java对象
  50. Brand brand = JSONObject.parseObject(s, Brand.class);
  51. //4.调用BrandServiceImpl方法,并且传入数据
  52. brandService.add(brand);
  53. //5.相应成功后的数据(如果代码正常执行,给与前端一个相应成功的字符串)
  54. response.getWriter().write("success");
  55. }
  56. /**
  57. * 删除数据(根据单个的id传入参数,进行传入id)
  58. *
  59. * @param request
  60. * @param response
  61. * @throws ServletException
  62. * @throws IOException
  63. */
  64. public void deleteById(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  65. //1.获取请求行数据(获取json格式的独特方法JavaWeb)
  66. BufferedReader reader = request.getReader();
  67. //2.读取请求行数据(json字符串)
  68. String s = reader.readLine();
  69. //3.把json格式转为java对象
  70. Brand brand = JSONObject.parseObject(s, Brand.class);
  71. //4.调用BrandServiceImpl方法,并且传入数据
  72. brandService.deleteById(brand.getId());
  73. //5.相应成功后的数据(如果代码正常执行,给与前端一个相应成功的字符串)
  74. response.getWriter().write("success");
  75. }
  76. /**
  77. * 部分数据,和全部数据更新都有了
  78. *
  79. * @param request
  80. * @param response
  81. * @throws ServletException
  82. * @throws IOException
  83. */
  84. public void update(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  85. //1.获取请求行数据(获取json格式的独特方法JavaWeb)
  86. BufferedReader reader = request.getReader();
  87. //2.读取请求行数据(json字符串)
  88. String s = reader.readLine();
  89. //3.把json格式转为java对象
  90. Brand brand = JSONObject.parseObject(s, Brand.class);
  91. //4.调用BrandServiceImpl方法,并且传入数据
  92. brandService.update(brand);
  93. //5.相应成功后的数据(如果代码正常执行,给与前端一个相应成功的字符串)
  94. response.getWriter().write("success");
  95. }
  96. /**
  97. * 批量删除
  98. *
  99. * @param request
  100. * @param response
  101. * @throws ServletException
  102. * @throws IOException
  103. */
  104. public void deleteByIds(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  105. //1.获取请求行数据(获取json格式的独特方法JavaWeb)(获取数据形式多种多样)
  106. BufferedReader reader = request.getReader();
  107. //2.读取请求行数据(json字符串)
  108. String s = reader.readLine();
  109. //3.把json格式转为java对象
  110. int[] ids = JSONObject.parseObject(s, int[].class);
  111. //4.调用BrandServiceImpl方法,并且传入数据
  112. brandService.deleteByIds(ids);
  113. //5.相应成功后的数据(如果代码正常执行,给与前端一个相应成功的字符串)
  114. response.getWriter().write("success");
  115. }
  116. /**
  117. * 分页查询
  118. *
  119. * @param request
  120. * @param response
  121. * @throws ServletException
  122. * @throws IOException
  123. */
  124. public void selectByPage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  125. //1.获取当前页码handleCurrentChange,和每页展示条数handleSizeChange url?currentPage=1&pageSize=5,把参数放到请求之后
  126. String _currentPage = request.getParameter("currentPage");
  127. String _pageSize = request.getParameter("pageSize");
  128. //2.把接收的数据,转换成Integer
  129. int currentPage = Integer.parseInt(_currentPage);
  130. int pageSize = Integer.parseInt(_pageSize);
  131. //3.调用service进行查询
  132. PageBean<Brand> brandPageBean = brandService.selectByPage(currentPage, pageSize);
  133. //4.把service实现类中返回值改成json格式,
  134. String s = JSON.toJSONString(brandPageBean);
  135. //5.别忘了编码问题,从数据库出来,改成json的格式,并设置data的结果值
  136. response.setContentType("text/json;charset=utf-8");
  137. response.getWriter().write(s);
  138. }
  139. /**
  140. * 分页动态条件查询
  141. *
  142. * @param request
  143. * @param response
  144. * @throws ServletException
  145. * @throws IOException
  146. */
  147. public void selectByPageAndCondition(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  148. //1.获取当前页码handleCurrentChange,和每页展示条数handleSizeChange url?currentPage=1&pageSize=5,把参数放到请求之后
  149. String _currentPage = request.getParameter("currentPage");
  150. String _pageSize = request.getParameter("pageSize");
  151. //2.把接收的数据,转换成Integer
  152. int currentPage = Integer.parseInt(_currentPage);
  153. int pageSize = Integer.parseInt(_pageSize);
  154. //1.获取请求行数据(获取json格式的独特方法JavaWeb)
  155. BufferedReader reader = request.getReader();
  156. //2.读取请求行数据(json字符串)
  157. String s = reader.readLine();
  158. //3.把json格式转为java对象
  159. Brand brand = JSONObject.parseObject(s, Brand.class);
  160. //3.调用service进行查询
  161. PageBean<Brand> brandPageBean = brandService.selectByPageAndCondition(currentPage, pageSize, brand);
  162. //4.把service实现类中返回值改成json格式,
  163. String s2 = JSON.toJSONString(brandPageBean);
  164. //5.别忘了编码问题,从数据库出来,改成json的格式,并设置data的结果值
  165. response.setContentType("text/json;charset=utf-8");
  166. response.getWriter().write(s2);
  167. }
  168. }

11.UserServlet(没有写)

12.BrandMapper.xml映射文件

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.itheima.mapper.BrandMapper">
  6. <resultMap id="brandResultMap" type="brand">
  7. <result property="brandName" column="brand_name"/>
  8. <result property="companyName" column="company_name"/>
  9. </resultMap>
  10. <!--
  11. 修改部分字段(当然也能修改全部字段)详细内容看https://blog.csdn.net/qq_51272114/article/details/
  12. -->
  13. <update id="update">
  14. update tb_brand
  15. <set>
  16. <if test="companyName != null and companyName != '' ">
  17. company_name=#{companyName},
  18. </if>
  19. <if test="brandName != null and brandName != '' ">
  20. brand_name=#{brandName},
  21. </if>
  22. <if test="ordered != null ">
  23. ordered=#{ordered},
  24. </if>
  25. <if test="description != null and description != '' ">
  26. description=#{description},
  27. </if>
  28. <if test="status != null ">
  29. status=#{status}
  30. </if>
  31. </set>
  32. where id = #{id};
  33. </update>
  34. <!--
  35. 批量删除数据(遍历id集合),详细内容看https://blog.csdn.net/qq_51272114/article/details/
  36. -->
  37. <delete id="deleteByIds">
  38. delete from tb_brand where id in
  39. <foreach collection="ids" item="id" separator="," open="(" close=")">#{id}</foreach>
  40. ;
  41. </delete>
  42. <!--
  43. f分页条件查询
  44. -->
  45. <select id="selectByPageAndCondition" resultType="com.itheima.pojo.Brand" resultMap="brandResultMap">
  46. select * from tb_brand
  47. <where>
  48. <if test="brand.status != null">
  49. and status = #{brand.status}
  50. </if>
  51. <if test="brand.companyName != null and brand.companyName != '' ">
  52. and company_name like #{brand.companyName}
  53. </if>
  54. <if test="brand.brandName != null and brand.brandName != ''">
  55. and brand_name like #{brand.brandName}
  56. </if>
  57. </where>
  58. limit #{begin},#{size}
  59. </select>
  60. <!--
  61. 根据条件查询总记录数
  62. -->
  63. <select id="selectTotalCountByCondition" resultType="java.lang.Integer">
  64. select count(*) from tb_brand
  65. <where>
  66. <if test="status != null">
  67. and status = #{status}
  68. </if>
  69. <if test="companyName != null and companyName != '' ">
  70. and company_name like #{companyName}
  71. </if>
  72. <if test="brandName != null and brandName != ''">
  73. and brand_name like #{brandName}
  74. </if>
  75. </where>
  76. </select>
  77. </mapper>

13.mybatis-config.xml连接数据库文件

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE configuration
  3. PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-config.dtd">
  5. <configuration>
  6. <typeAliases>
  7. <package name="com.itheima.pojo"/>
  8. </typeAliases>
  9. <environments default="development">
  10. <environment id="development">
  11. <transactionManager type="JDBC"/>
  12. <dataSource type="POOLED">
  13. <property name="driver" value="com.mysql.jdbc.Driver"/>
  14. <property name="url" value="jdbc:mysql:///db1?useSSL=false"/>
  15. <property name="username" value="root"/>
  16. <property name="password" value="root"/>
  17. </dataSource>
  18. </environment>
  19. </environments>
  20. <mappers>
  21. <!--扫描mapper-->
  22. <package name="com.itheima.mapper"/>
  23. </mappers>
  24. </configuration>

14.brand.html

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <style>
  7. .el-table .warning-row {
  8. background: oldlace;
  9. }
  10. .el-table .success-row {
  11. background: #f0f9eb;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <div id="app">
  17. <!--搜索表单-->
  18. <el-form :inline="true" :model="brand" class="demo-form-inline">
  19. <el-form-item label="当前状态">
  20. <el-select v-model="brand.status" placeholder="当前状态">
  21. <el-option label="启用" value="1"></el-option>
  22. <el-option label="禁用" value="0"></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item label="企业名称">
  26. <el-input v-model="brand.companyName" placeholder="企业名称"></el-input>
  27. </el-form-item>
  28. <el-form-item label="品牌名称">
  29. <el-input v-model="brand.brandName" placeholder="品牌名称"></el-input>
  30. </el-form-item>
  31. <el-form-item>
  32. <el-button type="primary" @click="onSubmit">查询</el-button>
  33. </el-form-item>
  34. </el-form>
  35. <!--按钮-->
  36. <el-row>
  37. <el-button type="danger" plain @click="deleteByIds">批量删除</el-button>
  38. <el-button type="primary" plain @click="dialogVisible = true">新增</el-button>
  39. </el-row>
  40. <!--添加数据对话框表单-->
  41. <el-dialog
  42. title="新增品牌"
  43. :visible.sync="dialogVisible"
  44. width="30%"
  45. >
  46. <el-form ref="form" :model="brand" label-width="80px">
  47. <el-form-item label="品牌名称">
  48. <el-input v-model="brand.brandName"></el-input>
  49. </el-form-item>
  50. <el-form-item label="企业名称">
  51. <el-input v-model="brand.companyName"></el-input>
  52. </el-form-item>
  53. <el-form-item label="排序">
  54. <el-input v-model="brand.ordered"></el-input>
  55. </el-form-item>
  56. <el-form-item label="备注">
  57. <el-input type="textarea" v-model="brand.description"></el-input>
  58. </el-form-item>
  59. <el-form-item label="状态">
  60. <el-switch v-model="brand.status"
  61. active-value="1"
  62. inactive-value="0"
  63. ></el-switch>
  64. </el-form-item>
  65. <el-form-item>
  66. <el-button type="primary" @click="addBrand">提交</el-button>
  67. <el-button @click="dialogVisible = false">取消</el-button>
  68. </el-form-item>
  69. </el-form>
  70. </el-dialog>
  71. <!--update表单-->
  72. <el-dialog
  73. title="修改品牌"
  74. :visible.sync="updateDialogVisible"
  75. width="30%"
  76. >
  77. <el-form ref="form" :model="brand" label-width="80px">
  78. <el-input v-model="brand.id" type="hidden"></el-input>
  79. <el-form-item label="品牌名称">
  80. <el-input v-model="brand.brandName"></el-input>
  81. </el-form-item>
  82. <el-form-item label="企业名称">
  83. <el-input v-model="brand.companyName"></el-input>
  84. </el-form-item>
  85. <el-form-item label="排序">
  86. <el-input v-model="brand.ordered"></el-input>
  87. </el-form-item>
  88. <el-form-item label="备注">
  89. <el-input type="textarea" v-model="brand.description"></el-input>
  90. </el-form-item>
  91. <el-form-item label="状态">
  92. <el-switch v-model="brand.status"
  93. active-value="1"
  94. inactive-value="0"
  95. ></el-switch>
  96. </el-form-item>
  97. <el-form-item>
  98. <el-button type="primary" @click="updateBrand">提交</el-button>
  99. <el-button @click="updateDialogVisible = false">取消</el-button>
  100. </el-form-item>
  101. </el-form>
  102. </el-dialog>
  103. <!--表格-->
  104. <template>
  105. <el-table
  106. :data="tableData"
  107. style="width: 100%"
  108. :row-class-name="tableRowClassName"
  109. @selection-change="handleSelectionChange"
  110. >
  111. <el-table-column
  112. type="selection"
  113. width="55">
  114. </el-table-column>
  115. <el-table-column
  116. type="index"
  117. width="50">
  118. </el-table-column>
  119. <el-table-column
  120. prop="brandName"
  121. label="品牌名称"
  122. align="center"
  123. >
  124. </el-table-column>
  125. <el-table-column
  126. prop="companyName"
  127. label="企业名称"
  128. align="center"
  129. >
  130. </el-table-column>
  131. <el-table-column
  132. prop="ordered"
  133. align="center"
  134. label="排序">
  135. </el-table-column>
  136. <el-table-column
  137. prop="status"
  138. align="center"
  139. label="当前状态">
  140. </el-table-column>
  141. <el-table-column
  142. align="center"
  143. label="操作">
  144. <template slot-scope="scope">
  145. <el-row>
  146. <el-button type="primary" @click=startUpdate(scope.row)>修改</el-button>
  147. <el-button type="danger" @click="open(scope.row)">删除</el-button>
  148. </el-row>
  149. </template>
  150. </el-table-column>
  151. </el-table>
  152. </template>
  153. <!--分页工具条-->
  154. <el-pagination
  155. @size-change="handleSizeChange"
  156. @current-change="handleCurrentChange"
  157. :current-page="currentPage"
  158. :page-sizes="[5, 10, 15, 20]"
  159. :page-size="5"
  160. layout="total, sizes, prev, pager, next, jumper"
  161. :total="totalCount"
  162. background
  163. layout="prev, pager, next"
  164. :total="100">
  165. </el-pagination>
  166. </div>
  167. <script src="js/vue.js"></script>
  168. <script src="element-ui/lib/index.js"></script>
  169. <link rel="stylesheet" href="element-ui/lib/theme-chalk/index.css">
  170. <script src="js/axios-0.18.0.js"></script>
  171. <script>
  172. new Vue({
  173. el: "#app",
  174. mounted() {
  175. //调用selectAll方法直接使用
  176. this.selectAll();
  177. },
  178. methods: {
  179. selectAll() {
  180. //var _this = this;//提生命周期
  181. axios({
  182. method: "post",
  183. url: "http://localhost:8080/brand-case/brand/selectByPageAndCondition?currentPage=" + this.currentPage + "&pageSize=" + this.pageSize + "",
  184. data: this.brand,
  185. }).then(resp => { //新特性,然后就可以在then里面的下划线say no了
  186. this.tableData = resp.data.rows;//此时{rows:[],totalCount:[]}
  187. this.totalCount = resp.data.totalCount;
  188. })
  189. },
  190. tableRowClassName({row, rowIndex}) {
  191. if (rowIndex === 1) {
  192. return 'warning-row';
  193. } else if (rowIndex === 3) {
  194. return 'success-row';
  195. }
  196. return '';
  197. },
  198. // 复选框选中后执行的方法
  199. handleSelectionChange(val) {
  200. this.multipleSelection = val;
  201. console.log(this.multipleSelection)
  202. },
  203. // 添加数据
  204. addBrand() {
  205. //console.log(this.brand);
  206. //发送Ajax请求,发送json数据
  207. //var _this = this;
  208. axios({
  209. method: "post",
  210. url: "http://localhost:8080/brand-case/brand/add",
  211. data: this.brand
  212. }).then(resp => {
  213. if (resp.data == "success") {
  214. //录入成功,关闭窗口,并且重新查询数据
  215. this.dialogVisible = false;
  216. this.selectAll();
  217. this.$message({
  218. message: '成功添加一条数据',
  219. type: 'success'
  220. });
  221. }
  222. })
  223. },
  224. // 修改数据
  225. updateBrand() {
  226. //console.log(this.brand);可以获取完整数据
  227. //发送Ajax请求,发送json数据
  228. //var _this = this;
  229. axios({
  230. method: "post",
  231. url: "http://localhost:8080/brand-case/brand/update",
  232. data: this.brand
  233. }).then(resp => {
  234. if (resp.data == "success") {
  235. //录入成功,关闭窗口,并且重新查询数据
  236. this.updateDialogVisible = false;
  237. this.selectAll();
  238. this.$message({
  239. message: '成功添加一条数据',
  240. type: 'success'
  241. });
  242. }
  243. })
  244. },
  245. //执行修改的onclick
  246. startUpdate(row) {
  247. // 获取改行已经有的数据,以供填入修改框
  248. // var _this = this
  249. this.brand = JSON.parse(JSON.stringify(row));
  250. // 弹出修改框
  251. this.updateDialogVisible = true;
  252. },
  253. //打开删除的提示框,并根据提示进行操作
  254. open(row) {
  255. this.brand = JSON.parse(JSON.stringify(row));
  256. //var _this = this;
  257. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  258. confirmButtonText: '确定',
  259. cancelButtonText: '取消',
  260. type: 'warning'
  261. }).then(() => { //确认之后执行axios请求
  262. axios({
  263. method: "post",
  264. url: "http://localhost:8080/brand-case/brand/deleteById",
  265. data: this.brand
  266. }).then(resp => {
  267. if (resp.data == "success") {
  268. //录入成功,关闭窗口,并且重新查询数据
  269. this.selectAll();
  270. this.$message({
  271. message: '删除成功',
  272. type: 'success'
  273. });
  274. }
  275. })
  276. }).catch(() => { //取消之后执行标签
  277. this.$message({
  278. type: 'info',
  279. message: '已取消删除'
  280. });
  281. });
  282. },
  283. //批量删除的单击事件
  284. deleteByIds() {
  285. //console.log(this.multipleSelection);
  286. //1.创建id数组[1,2,3],从multipleSelection模型里面来的数据
  287. for (let i = 0; i < this.multipleSelection.length; i++) {
  288. let element = this.multipleSelection[i];
  289. //获取遍历后得到id值
  290. this.selectByIds[i] = element.id;
  291. }
  292. //var _this = this;
  293. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  294. confirmButtonText: '确定',
  295. cancelButtonText: '取消',
  296. type: 'warning'
  297. }).then(() => {
  298. axios({
  299. method: "post",
  300. url: "http://localhost:8080/brand-case/brand/deleteByIds",
  301. data: this.selectByIds
  302. }).then(resp => {
  303. if (resp.data == "success") {
  304. //录入成功,关闭窗口,并且重新查询数据
  305. this.selectAll();
  306. this.$message({
  307. message: '成功删除数据',
  308. type: 'success'
  309. });
  310. }else{
  311. this.$message({
  312. message: '没有数据可以删除',
  313. type: 'info'
  314. });
  315. }
  316. })
  317. }).catch(() => {
  318. this.$message({
  319. type: 'info',
  320. message: '已取消删除'
  321. });
  322. });
  323. },
  324. //
  325. // 查询方法
  326. onSubmit() {
  327. //console.log(this.brand);
  328. this.selectAll();
  329. },
  330. //每页显示条数
  331. handleSizeChange(val) {
  332. //console.log(`每页 ${val} 条`);
  333. //重新设置当每页显示的条数
  334. this.pageSize = val;
  335. this.selectAll();
  336. },
  337. //当前页码
  338. handleCurrentChange(val) {
  339. //console.log(`当前页: ${val}`);
  340. //重新去设置当前页码,动态改变
  341. this.currentPage = val;
  342. this.selectAll();
  343. }
  344. },
  345. data() {
  346. return {
  347. pageSize: 5,
  348. //页码的总记录数
  349. totalCount: 100,
  350. // 当前页码
  351. currentPage: 1,
  352. // 添加数据对话框是否展示的标记
  353. dialogVisible: false,
  354. updateDialogVisible: false,
  355. // 品牌模型数据
  356. brand: {
  357. status: '',
  358. brandName: '',
  359. companyName: '',
  360. id: '',
  361. ordered: "",
  362. description: ""
  363. },
  364. //被选中的id数组
  365. selectByIds: [],
  366. // 复选框选中数据集合
  367. multipleSelection: [],
  368. // 表格数据
  369. tableData: [{
  370. brandName: '华为',
  371. companyName: '华为科技有限公司',
  372. ordered: '100',
  373. status: "1"
  374. }, {
  375. brandName: '华为',
  376. companyName: '华为科技有限公司',
  377. ordered: '100',
  378. status: "1"
  379. }, {
  380. brandName: '华为',
  381. companyName: '华为科技有限公司',
  382. ordered: '100',
  383. status: "1"
  384. }, {
  385. brandName: '华为',
  386. companyName: '华为科技有限公司',
  387. ordered: '100',
  388. status: "1"
  389. }]
  390. }
  391. }
  392. })
  393. </script>
  394. </body>
  395. </html>

15.pom.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <groupId>org.example</groupId>
  7. <artifactId>brand-case</artifactId>
  8. <version>1.0-SNAPSHOT</version>
  9. <properties>
  10. <maven.compiler.source>18</maven.compiler.source>
  11. <maven.compiler.target>18</maven.compiler.target>
  12. </properties>
  13. <packaging>war</packaging>
  14. <build>
  15. <plugins>
  16. <!--tomcat 的插件 (相当于在maven内部放置了个tomcat服务器)-->
  17. <plugin>
  18. <groupId>org.apache.tomcat.maven</groupId>
  19. <artifactId>tomcat7-maven-plugin</artifactId>
  20. <version>2.2</version>
  21. </plugin>
  22. <plugin>
  23. <groupId>org.apache.maven.plugins</groupId>
  24. <artifactId>maven-compiler-plugin</artifactId>
  25. <configuration>
  26. <source>17</source>
  27. <target>17</target>
  28. </configuration>
  29. </plugin>
  30. </plugins>
  31. </build>
  32. <dependencies>
  33. <dependency>
  34. <groupId>javax.servlet</groupId>
  35. <artifactId>javax.servlet-api</artifactId>
  36. <version>3.1.0</version>
  37. <scope>provided</scope>
  38. </dependency>
  39. <!--apache提供的与io适配的工具类,好用-->
  40. <dependency>
  41. <groupId>commons-io</groupId>
  42. <artifactId>commons-io</artifactId>
  43. <version>2.6</version>
  44. </dependency>
  45. <!--mybatis依赖-->
  46. <dependency>
  47. <groupId>org.mybatis</groupId>
  48. <artifactId>mybatis</artifactId>
  49. <version>3.5.5</version>
  50. </dependency>
  51. <!--mysql依赖-->
  52. <dependency>
  53. <groupId>mysql</groupId>
  54. <artifactId>mysql-connector-java</artifactId>
  55. <version>8.0.29</version>
  56. </dependency>
  57. <!--junit依赖-->
  58. <dependency>
  59. <groupId>junit</groupId>
  60. <artifactId>junit</artifactId>
  61. <version>4.13.2</version>
  62. <scope>Test</scope>
  63. </dependency>
  64. <!--添加slf4j-api日志api-->
  65. <dependency>
  66. <groupId>org.slf4j</groupId>
  67. <artifactId>slf4j-api</artifactId>
  68. <version>1.7.36</version>
  69. </dependency>
  70. <!--添加logback-classic依赖-->
  71. <dependency>
  72. <groupId>ch.qos.logback</groupId>
  73. <artifactId>logback-classic</artifactId>
  74. <version>1.2.3</version>
  75. </dependency>
  76. <!--添加logback-core依赖-->
  77. <dependency>
  78. <groupId>ch.qos.logback</groupId>
  79. <artifactId>logback-core</artifactId>
  80. <version>1.2.3</version>
  81. </dependency>
  82. <dependency>
  83. <groupId>jstl</groupId>
  84. <artifactId>jstl</artifactId>
  85. <version>1.2</version>
  86. </dependency>
  87. <dependency>
  88. <groupId>taglibs</groupId>
  89. <artifactId>standard</artifactId>
  90. <version>1.1.2</version>
  91. </dependency>
  92. <dependency>
  93. <groupId>com.alibaba</groupId>
  94. <artifactId>fastjson</artifactId>
  95. <version>1.2.62</version>
  96. </dependency>
  97. </dependencies>
  98. </project>

 16.mysql数据库文件

  1. -- 删除tb_brand表
  2. drop table if exists tb_brand;
  3. -- 创建tb_brand表
  4. create table tb_brand
  5. (
  6. -- id 主键
  7. id int primary key auto_increment,
  8. -- 品牌名称
  9. brand_name varchar(20),
  10. -- 企业名称
  11. company_name varchar(20),
  12. -- 排序字段
  13. ordered int,
  14. -- 描述信息
  15. description varchar(100),
  16. -- 状态:0:禁用 1:启用
  17. status int
  18. );
  19. -- 添加数据
  20. insert into tb_brand (brand_name, company_name, ordered, description, status)
  21. values
  22. ('华为', '华为技术有限公司', 100, '万物互联', 1),
  23. ('小米', '小米科技有限公司', 50, 'are you ok', 1),
  24. ('格力', '格力电器股份有限公司', 30, '让世界爱上中国造', 1),
  25. ('阿里巴巴', '阿里巴巴集团控股有限公司', 10, '买买买', 1),
  26. ('腾讯', '腾讯计算机系统有限公司', 50, '玩玩玩', 0),
  27. ('百度', '百度在线网络技术公司', 5, '搜搜搜', 0),
  28. ('京东', '北京京东世纪贸易有限公司', 40, '就是快', 1),
  29. ('小米', '小米科技有限公司', 50, 'are you ok', 1),
  30. ('三只松鼠', '三只松鼠股份有限公司', 5, '好吃不上火', 0),
  31. ('华为', '华为技术有限公司', 100, '万物互联', 1),
  32. ('小米', '小米科技有限公司', 50, 'are you ok', 1),
  33. ('格力', '格力电器股份有限公司', 30, '让世界爱上中国造', 1),
  34. ('阿里巴巴', '阿里巴巴集团控股有限公司', 10, '买买买', 1),
  35. ('腾讯', '腾讯计算机系统有限公司', 50, '玩玩玩', 0),
  36. ('百度', '百度在线网络技术公司', 5, '搜搜搜', 0),
  37. ('京东', '北京京东世纪贸易有限公司', 40, '就是快', 1),
  38. ('华为', '华为技术有限公司', 100, '万物互联', 1),
  39. ('小米', '小米科技有限公司', 50, 'are you ok', 1),
  40. ('格力', '格力电器股份有限公司', 30, '让世界爱上中国造', 1),
  41. ('阿里巴巴', '阿里巴巴集团控股有限公司', 10, '买买买', 1),
  42. ('腾讯', '腾讯计算机系统有限公司', 50, '玩玩玩', 0),
  43. ('百度', '百度在线网络技术公司', 5, '搜搜搜', 0),
  44. ('京东', '北京京东世纪贸易有限公司', 40, '就是快', 1),
  45. ('小米', '小米科技有限公司', 50, 'are you ok', 1),
  46. ('三只松鼠', '三只松鼠股份有限公司', 5, '好吃不上火', 0),
  47. ('华为', '华为技术有限公司', 100, '万物互联', 1),
  48. ('小米', '小米科技有限公司', 50, 'are you ok', 1),
  49. ('格力', '格力电器股份有限公司', 30, '让世界爱上中国造', 1),
  50. ('阿里巴巴', '阿里巴巴集团控股有限公司', 10, '买买买', 1),
  51. ('腾讯', '腾讯计算机系统有限公司', 50, '玩玩玩', 0),
  52. ('百度', '百度在线网络技术公司', 5, '搜搜搜', 0),
  53. ('京东', '北京京东世纪贸易有限公司', 40, '就是快', 1),
  54. ('华为', '华为技术有限公司', 100, '万物互联', 1),
  55. ('小米', '小米科技有限公司', 50, 'are you ok', 1),
  56. ('格力', '格力电器股份有限公司', 30, '让世界爱上中国造', 1),
  57. ('阿里巴巴', '阿里巴巴集团控股有限公司', 10, '买买买', 1),
  58. ('腾讯', '腾讯计算机系统有限公司', 50, '玩玩玩', 0),
  59. ('百度', '百度在线网络技术公司', 5, '搜搜搜', 0),
  60. ('京东', '北京京东世纪贸易有限公司', 40, '就是快', 1),
  61. ('小米', '小米科技有限公司', 50, 'are you ok', 1),
  62. ('三只松鼠', '三只松鼠股份有限公司', 5, '好吃不上火', 0),
  63. ('华为', '华为技术有限公司', 100, '万物互联', 1),
  64. ('小米', '小米科技有限公司', 50, 'are you ok', 1),
  65. ('格力', '格力电器股份有限公司', 30, '让世界爱上中国造', 1),
  66. ('阿里巴巴', '阿里巴巴集团控股有限公司', 10, '买买买', 1),
  67. ('腾讯', '腾讯计算机系统有限公司', 50, '玩玩玩', 0),
  68. ('百度', '百度在线网络技术公司', 5, '搜搜搜', 0),
  69. ('京东', '北京京东世纪贸易有限公司', 40, '就是快', 1)
  70. ;
  71. SELECT * FROM tb_brand;

16.成品效果 

 

 

 

网站建设定制开发 软件系统开发定制 定制软件开发 软件开发定制 定制app开发 app开发定制 app开发定制公司 电商商城定制开发 定制小程序开发 定制开发小程序 客户管理系统开发定制 定制网站 定制开发 crm开发定制 开发公司 小程序开发定制 定制软件 收款定制开发 企业网站定制开发 定制化开发 android系统定制开发 定制小程序开发费用 定制设计 专注app软件定制开发 软件开发定制定制 知名网站建设定制 软件定制开发供应商 应用系统定制开发 软件系统定制开发 企业管理系统定制开发 系统定制开发