日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > vue >内容正文

vue

基于ssm+vue的综合项目 健康体检管理系统-第六章---移动端体检预约

發布時間:2024/3/24 vue 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 基于ssm+vue的综合项目 健康体检管理系统-第六章---移动端体检预约 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

移動端開發對體檢預約進行的查詢


  • 當頁面加載完畢時,利用vue的鉤子函數
  • 已加載頁面就直接查詢數據將數據進行渲染
created() {axios.post("/setmeal/getSetmeal.do").then((response) => {if (response.data.flag) {this.setmealList = response.data.data;} else {this.$message.error(response.data.message);}});}

根據套餐查詢套餐信息和檢查組、檢查項的信息

  • 點擊套餐前臺進行js截取id以及傳遞的參數傳遞給后臺
  • 后臺接受到數據就進行查詢
  • 由于傳遞到后臺的只有一個id
  • 這里需要多表查詢需要使用到mybatis的高級特性
/*** 查詢套餐的基礎信息* @param id 套餐的id* @return 套餐實體類*/Setmeal findAssociationById(Integer id); <!--查詢套餐的基礎信息--><resultMap id="SetmealResultMap" type="com.itheima.pojo.Setmeal"><id column="id" property="id"/><result column="name" property="name"/><result column="code" property="code"/><result column="helpCode" property="helpCode"/><result column="sex" property="sex"/><result column="age" property="age"/><result column="price" property="price"/><result column="remark" property="remark"/><result column="attention" property="attention"/><result column="img" property="img"/></resultMap><resultMap id="findByIdResult" type="com.itheima.pojo.Setmeal" extends="SetmealResultMap"><collectionproperty="checkGroups"ofType="com.itheima.pojo.CheckGroup"javaType="java.util.List"column="id"select="com.itheima.dao.CheckgroupDao.findCheckgroupBySetmealId"/></resultMap><select id="findAssociationById" resultMap="findByIdResult">select id,name,code,helpCode,sex,age,price,remark,attention,imgfrom t_setmeal where id=#{id}</select>
  • select * from t_setmeal

  • 查詢套餐的基礎信息,將查詢出來的結果的id

  • 傳遞到CheckgroupDao的findCheckgroupBySetmealId

  • CheckGroup findCheckgroupBySetmealId(Integer id);

<!--根據套餐的id查詢檢查組的對應的id的信息--><resultMap id="CheckgroupResult" type="com.itheima.pojo.CheckGroup"><id column="id" property="id"/><result column="code" property="code"/><result column="name" property="name"/><result column="helpCode" property="helpCode"/><result column="sex" property="sex"/><result column="remark" property="remark"/><result column="attention" property="attention"/></resultMap><resultMap id="findCheckgroupById" type="com.itheima.pojo.CheckGroup" extends="CheckgroupResult"><collectionproperty="checkItems"javaType="java.util.List"ofType="com.itheima.pojo.CheckItem"column="id"select="com.itheima.dao.CheckItemDao.findCheckitemByCheckgroup"/></resultMap><select id="findCheckgroupBySetmealId" resultMap="findCheckgroupById">select id, code, name, helpCode, sex, remark, attentionfrom t_checkgroupwhere id in (select checkgroup_id from t_setmeal_checkgroup where setmeal_id = #{id})</select>
  • 根據套餐的id查詢套餐和檢查組的中間表的檢查組的id
  • 然后在根據檢查組的id查詢檢查組的信息
  • SELECT * FROM t_checkgroup WHERE id in(SELECT checkgroup_id FROM t_setmeal_checkgroup where setmeal_id=12)
  • 再將查詢出來的id帶到檢查項去查詢檢查項的信息
<!--根據檢查組的id查詢檢查項信息--><select id="findCheckitemByCheckgroup" resultType="com.itheima.pojo.CheckItem">select id,code,name,sex,age,price,type,attention,remarkfrom t_checkitemwhere id in (select checkitem_id from t_checkgroup_checkitem where checkgroup_id = #{id})</select>

Freemarker入門案例

@Testpublic void test1() throws Exception {/*1.創建freemarker的配置Freemarker為了兼容不同版本,使用配置類的構造方法來創建不同的運行環境2.3.23*/Configuration configuration = new Configuration(Configuration.VERSION_2_3_23);/*2.對配置進行配置 (配置模板的指定目錄,使用類加載器獲取ftl目錄的路徑)*/String ftlDirectory = FreemarkerTest.class.getResource("/ftl/").getPath();//3.設置模板所在的目錄configuration.setDirectoryForTemplateLoading(new File(ftlDirectory));//4.配置模板文件的默認字符集configuration.setDefaultEncoding("utf-8");//5.獲取指定模板文件的對象Template template = configuration.getTemplate("freemarkertest.ftl");//6.構建出數據模型Map<String, Object> map = new HashMap<String, Object>();map.put("name", "kobe");map.put("address", "beijing");//7.生成靜態化文件FileWriter fileWriter = new FileWriter("d:/index.html");template.process(map, fileWriter);//釋放資源fileWriter.close();} <!DOCTYPE html> <html> <head><meta charset="UTF-8"><title>freemarker入門案例</title> </head> <body> 你好${name},歡迎來到${address}。 </body> </html>

總結

以上是生活随笔為你收集整理的基于ssm+vue的综合项目 健康体检管理系统-第六章---移动端体检预约的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。