健康报告dao生成

This commit is contained in:
limqhz
2021-03-07 09:57:34 +08:00
parent 0b651dc87d
commit d35edae11e
6 changed files with 628 additions and 14 deletions

View File

@@ -0,0 +1,122 @@
package com.sv.entity;
import java.util.Date;
public class HealthDoc {
private Integer id;
private Integer memberId;
private String docName;
private String docType;
private String fileType;
private String docPath;
private Integer platformId;
private Date createdTime;
private Date modifiedTime;
private Byte deleted;
public HealthDoc(Integer id, Integer memberId, String docName, String docType, String fileType, String docPath, Integer platformId, Date createdTime, Date modifiedTime, Byte deleted) {
this.id = id;
this.memberId = memberId;
this.docName = docName;
this.docType = docType;
this.fileType = fileType;
this.docPath = docPath;
this.platformId = platformId;
this.createdTime = createdTime;
this.modifiedTime = modifiedTime;
this.deleted = deleted;
}
public HealthDoc() {
super();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getMemberId() {
return memberId;
}
public void setMemberId(Integer memberId) {
this.memberId = memberId;
}
public String getDocName() {
return docName;
}
public void setDocName(String docName) {
this.docName = docName == null ? null : docName.trim();
}
public String getDocType() {
return docType;
}
public void setDocType(String docType) {
this.docType = docType == null ? null : docType.trim();
}
public String getFileType() {
return fileType;
}
public void setFileType(String fileType) {
this.fileType = fileType == null ? null : fileType.trim();
}
public String getDocPath() {
return docPath;
}
public void setDocPath(String docPath) {
this.docPath = docPath == null ? null : docPath.trim();
}
public Integer getPlatformId() {
return platformId;
}
public void setPlatformId(Integer platformId) {
this.platformId = platformId;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getModifiedTime() {
return modifiedTime;
}
public void setModifiedTime(Date modifiedTime) {
this.modifiedTime = modifiedTime;
}
public Byte getDeleted() {
return deleted;
}
public void setDeleted(Byte deleted) {
this.deleted = deleted;
}
}

View File

@@ -23,10 +23,10 @@
</template>
</el-table-column>
<!-- 场馆ID -->
<el-table-column align="center" label="报告ID">
<!-- 文档名称 -->
<el-table-column align="center" label="报告名称">
<template scope="scope">
<span>{{scope.row.docId}}</span>
<span>{{scope.row.docName}}</span>
</template>
</el-table-column>
@@ -44,6 +44,11 @@
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150">
<template scope="scope">
<el-button size="small" type="text" @click="handleEdit(scope.row.id)">查看</el-button>
</template>
</el-table-column>
</Pagination>
</div>
</template>
@@ -54,7 +59,7 @@ import waves from '@/directive/waves.js'// 水波纹指令
import Pagination from '@/components/Pagination'
export default {
name: 'memberCard_list',
name: 'healthDocs_list',
components: { Pagination },
directives: {
waves
@@ -62,10 +67,8 @@ export default {
data() {
return {
params: {
veneuType: undefined,
search_eq_card_type: undefined,
search_eq_doc_type: undefined,
search_like_nickname: undefined,
venueName: undefined
},
options: {
docType: [
@@ -83,15 +86,14 @@ export default {
},
methods: {
/**
* 搜索用户会员卡
* 搜索健康报告
*/
handleSearch() {
// this.$refs.pagination.pageRequest()
this.$refs.pagination.handleSearch()
},
/**
* 编辑用户会员卡
* 编辑健康报告
*/
handleEdit(id) {
this.$router.push({ path: '/member/card/edit', query: { id: id }})

View File

@@ -23,4 +23,29 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
<configurationFile>src/main/resources/tools/generatorConfig.xml</configurationFile>
</configuration>
<dependencies>
<!-- 数据库驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.41</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,17 @@
package com.sv.mapper;
import com.sv.entity.HealthDoc;
public interface HealthDocMapper {
int deleteByPrimaryKey(Integer id);
int insert(HealthDoc record);
int insertSelective(HealthDoc record);
HealthDoc selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(HealthDoc record);
int updateByPrimaryKey(HealthDoc record);
}

View File

@@ -0,0 +1,444 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sv.mapper.HealthDocMapper">
<resultMap id="BaseResultMap" type="com.sv.entity.HealthDoc">
<constructor>
<idArg column="id" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="member_id" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="doc_name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="doc_type" javaType="java.lang.String" jdbcType="CHAR" />
<arg column="file_type" javaType="java.lang.String" jdbcType="CHAR" />
<arg column="doc_path" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="platform_id" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="created_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="modified_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="deleted" javaType="java.lang.Byte" jdbcType="TINYINT" />
</constructor>
</resultMap>
<sql id="Base_Column_List">
id, member_id, doc_name, doc_type, file_type, doc_path, platform_id, created_time,
modified_time, deleted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sv_health_docs
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sv_health_docs
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.sv.entity.HealthDoc">
insert into sv_health_docs (id, member_id, doc_name,
doc_type, file_type, doc_path,
platform_id, created_time, modified_time,
deleted)
values (#{id,jdbcType=INTEGER}, #{memberId,jdbcType=INTEGER}, #{docName,jdbcType=VARCHAR},
#{docType,jdbcType=CHAR}, #{fileType,jdbcType=CHAR}, #{docPath,jdbcType=VARCHAR},
#{platformId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP},
#{deleted,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.sv.entity.HealthDoc">
insert into sv_health_docs
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="docName != null">
doc_name,
</if>
<if test="docType != null">
doc_type,
</if>
<if test="fileType != null">
file_type,
</if>
<if test="docPath != null">
doc_path,
</if>
<if test="platformId != null">
platform_id,
</if>
<if test="createdTime != null">
created_time,
</if>
<if test="modifiedTime != null">
modified_time,
</if>
<if test="deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="memberId != null">
#{memberId,jdbcType=INTEGER},
</if>
<if test="docName != null">
#{docName,jdbcType=VARCHAR},
</if>
<if test="docType != null">
#{docType,jdbcType=CHAR},
</if>
<if test="fileType != null">
#{fileType,jdbcType=CHAR},
</if>
<if test="docPath != null">
#{docPath,jdbcType=VARCHAR},
</if>
<if test="platformId != null">
#{platformId,jdbcType=INTEGER},
</if>
<if test="createdTime != null">
#{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedTime != null">
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
#{deleted,jdbcType=TINYINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sv.entity.HealthDoc">
update sv_health_docs
<set>
<if test="memberId != null">
member_id = #{memberId,jdbcType=INTEGER},
</if>
<if test="docName != null">
doc_name = #{docName,jdbcType=VARCHAR},
</if>
<if test="docType != null">
doc_type = #{docType,jdbcType=CHAR},
</if>
<if test="fileType != null">
file_type = #{fileType,jdbcType=CHAR},
</if>
<if test="docPath != null">
doc_path = #{docPath,jdbcType=VARCHAR},
</if>
<if test="platformId != null">
platform_id = #{platformId,jdbcType=INTEGER},
</if>
<if test="createdTime != null">
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedTime != null">
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sv.entity.HealthDoc">
update sv_health_docs
set member_id = #{memberId,jdbcType=INTEGER},
doc_name = #{docName,jdbcType=VARCHAR},
doc_type = #{docType,jdbcType=CHAR},
file_type = #{fileType,jdbcType=CHAR},
doc_path = #{docPath,jdbcType=VARCHAR},
platform_id = #{platformId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap id="BaseResultMap" type="com.sv.entity.HealthDoc">
<constructor>
<idArg column="id" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="member_id" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="doc_name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="doc_type" javaType="java.lang.String" jdbcType="CHAR" />
<arg column="file_type" javaType="java.lang.String" jdbcType="CHAR" />
<arg column="doc_path" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="platform_id" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="created_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="modified_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="deleted" javaType="java.lang.Byte" jdbcType="TINYINT" />
</constructor>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, member_id, doc_name, doc_type, file_type, doc_path, platform_id, created_time,
modified_time, deleted
</sql>
<select id="selectByExample" parameterType="com.sv.entity.HealthDocExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sv_health_docs
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sv_health_docs
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sv_health_docs
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sv.entity.HealthDocExample">
delete from sv_health_docs
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sv.entity.HealthDoc">
insert into sv_health_docs (id, member_id, doc_name,
doc_type, file_type, doc_path,
platform_id, created_time, modified_time,
deleted)
values (#{id,jdbcType=INTEGER}, #{memberId,jdbcType=INTEGER}, #{docName,jdbcType=VARCHAR},
#{docType,jdbcType=CHAR}, #{fileType,jdbcType=CHAR}, #{docPath,jdbcType=VARCHAR},
#{platformId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP},
#{deleted,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.sv.entity.HealthDoc">
insert into sv_health_docs
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="docName != null">
doc_name,
</if>
<if test="docType != null">
doc_type,
</if>
<if test="fileType != null">
file_type,
</if>
<if test="docPath != null">
doc_path,
</if>
<if test="platformId != null">
platform_id,
</if>
<if test="createdTime != null">
created_time,
</if>
<if test="modifiedTime != null">
modified_time,
</if>
<if test="deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="memberId != null">
#{memberId,jdbcType=INTEGER},
</if>
<if test="docName != null">
#{docName,jdbcType=VARCHAR},
</if>
<if test="docType != null">
#{docType,jdbcType=CHAR},
</if>
<if test="fileType != null">
#{fileType,jdbcType=CHAR},
</if>
<if test="docPath != null">
#{docPath,jdbcType=VARCHAR},
</if>
<if test="platformId != null">
#{platformId,jdbcType=INTEGER},
</if>
<if test="createdTime != null">
#{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedTime != null">
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
#{deleted,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sv.entity.HealthDocExample" resultType="java.lang.Integer">
select count(*) from sv_health_docs
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sv_health_docs
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.memberId != null">
member_id = #{record.memberId,jdbcType=INTEGER},
</if>
<if test="record.docName != null">
doc_name = #{record.docName,jdbcType=VARCHAR},
</if>
<if test="record.docType != null">
doc_type = #{record.docType,jdbcType=CHAR},
</if>
<if test="record.fileType != null">
file_type = #{record.fileType,jdbcType=CHAR},
</if>
<if test="record.docPath != null">
doc_path = #{record.docPath,jdbcType=VARCHAR},
</if>
<if test="record.platformId != null">
platform_id = #{record.platformId,jdbcType=INTEGER},
</if>
<if test="record.createdTime != null">
created_time = #{record.createdTime,jdbcType=TIMESTAMP},
</if>
<if test="record.modifiedTime != null">
modified_time = #{record.modifiedTime,jdbcType=TIMESTAMP},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sv_health_docs
set id = #{record.id,jdbcType=INTEGER},
member_id = #{record.memberId,jdbcType=INTEGER},
doc_name = #{record.docName,jdbcType=VARCHAR},
doc_type = #{record.docType,jdbcType=CHAR},
file_type = #{record.fileType,jdbcType=CHAR},
doc_path = #{record.docPath,jdbcType=VARCHAR},
platform_id = #{record.platformId,jdbcType=INTEGER},
created_time = #{record.createdTime,jdbcType=TIMESTAMP},
modified_time = #{record.modifiedTime,jdbcType=TIMESTAMP},
deleted = #{record.deleted,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sv.entity.HealthDoc">
update sv_health_docs
<set>
<if test="memberId != null">
member_id = #{memberId,jdbcType=INTEGER},
</if>
<if test="docName != null">
doc_name = #{docName,jdbcType=VARCHAR},
</if>
<if test="docType != null">
doc_type = #{docType,jdbcType=CHAR},
</if>
<if test="fileType != null">
file_type = #{fileType,jdbcType=CHAR},
</if>
<if test="docPath != null">
doc_path = #{docPath,jdbcType=VARCHAR},
</if>
<if test="platformId != null">
platform_id = #{platformId,jdbcType=INTEGER},
</if>
<if test="createdTime != null">
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedTime != null">
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sv.entity.HealthDoc">
update sv_health_docs
set member_id = #{memberId,jdbcType=INTEGER},
doc_name = #{docName,jdbcType=VARCHAR},
doc_type = #{docType,jdbcType=CHAR},
file_type = #{fileType,jdbcType=CHAR},
doc_path = #{docPath,jdbcType=VARCHAR},
platform_id = #{platformId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -66,7 +66,7 @@
所以,如果 javaClientGenerator配置中配置了需要生成XML的话这个元素就必须配置
targetPackage/targetProject:同javaModelGenerator
-->
<sqlMapGenerator targetPackage="com.sv.mapper" targetProject="src/main/resources">
<sqlMapGenerator targetPackage="mybatis.mapper.sv" targetProject="src/main/resources">
<!-- 在targetPackage的基础上根据数据库的schema再生成一层package最终生成的类放在这个package下默认为false -->
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
@@ -80,7 +80,7 @@
3XMLMAPPER会生成Mapper接口接口完全依赖XML
注意如果context是MyBatis3Simple只支持ANNOTATEDMAPPER和XMLMAPPER
-->
<javaClientGenerator targetPackage="mybatis.mapper.sv" type="XMLMAPPER" targetProject="src/main/java">
<javaClientGenerator targetPackage="com.sv.mapper" type="XMLMAPPER" targetProject="src/main/java">
<!-- 在targetPackage的基础上根据数据库的schema再生成一层package最终生成的类放在这个package下默认为false -->
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
@@ -90,7 +90,11 @@
domainObjectName 给表对应的 model 起名字
注意:大小写敏感问题。
-->
<table tableName="sv_device" domainObjectName="Device">
<table tableName="sv_health_docs" domainObjectName="HealthDoc"
enableCountByExample="false"
enableDeleteByExample="false"
enableSelectByExample="false"
enableUpdateByExample="false" >
<!--用来修改表中某个列的属性,一个table元素中可以有多个columnOverride元素哈.
property属性来指定列要生成的属性名称.