文章目录 5.4.4 机构名称 5.4.4.1 创建实体类Company 5.4.4.2 创建实体类CompanyMapper 5.4.4.3 创建实体类CompanyService 5.4.4.4 创建实体类CompanyController 5.4.4.5 后端测试 5.4.4.6 修改basic.js 5.4.4.7 修改course.vue 5.4.4.8 测试 5.4.5 课程标签 5.4.5.1 效果 5.4.5.2 修改course.vue 5.4.5.3 5.4.5.4 6
5.4.4 机构名称
5.4.4.1 创建实体类Company
package com. zx. system. entity ; import com. baomidou. mybatisplus. annotation. TableName ;
import lombok. AllArgsConstructor ;
import lombok. Data ;
import lombok. NoArgsConstructor ;
import lombok. ToString ;
import lombok. experimental. Accessors ; import java. util. Date ; @Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Accessors ( chain = true )
@TableName ( "tb_company" )
public class Company { private Integer id; private String name; private String orgType; private String phone; private String linkname; private String handPhotos; private String address; private String logo; private String email; private String promiseLetter; private String trademarkPic; private String intro; private String briefIntro; private String mainCategory; private String identityPic; private String workType; private String businessPic; private Date businessTerm; private String businessRegistNo; private String eduCertImg; private String eduCertTerm; private String eduCertNo; private String approvalStatus; private String approvalComment; private String approvalPeople; private Date approvalDate; private Integer approvalNums; private String remark; private Date createDate; private Date changeDate; private Integer tenantId; private String idCard; private String teacherCertImg; private String teacherCertNo; private Integer status; private String majorCertImg; private String majorCertNo; private String workExperience; private String workResults; private String title;
}
5.4.4.2 创建实体类CompanyMapper
package com. zx. system. mapper ; import com. baomidou. mybatisplus. core. mapper. BaseMapper ;
import com. zx. system. entity. Company ;
import org. apache. ibatis. annotations. Mapper ; @Mapper
public interface CompanyMapper extends BaseMapper < Company > {
}
5.4.4.3 创建实体类CompanyService
package com. zx. system. service ; import com. baomidou. mybatisplus. core. conditions. query. QueryWrapper ;
import com. baomidou. mybatisplus. extension. service. impl. ServiceImpl ;
import com. zx. system. entity. Company ;
import com. zx. system. mapper. CompanyMapper ;
import org. springframework. beans. factory. annotation. Autowired ;
import org. springframework. stereotype. Service ; import java. util. List ; @Service
public class CompanyService extends ServiceImpl < CompanyMapper , Company > { @Autowired private CompanyMapper companyMapper; public List < Company > selectAll ( ) { QueryWrapper qw = new QueryWrapper ( ) ; qw. select ( "id" , "name" , "org_type" , "phone" , "linkname" ) ; qw. eq ( "status" , 1 ) ; qw. orderByDesc ( "create_date" ) ; return companyMapper. selectList ( qw) ; } }
5.4.4.4 创建实体类CompanyController
package com. zx. system. controller ; import com. zx. system. entity. Company ;
import com. zx. system. service. CompanyService ;
import org. springframework. beans. factory. annotation. Autowired ;
import org. springframework. web. bind. annotation. CrossOrigin ;
import org. springframework. web. bind. annotation. GetMapping ;
import org. springframework. web. bind. annotation. RequestMapping ;
import org. springframework. web. bind. annotation. RestController ; import java. util. List ; @RestController
@CrossOrigin
@RequestMapping ( "/system/company" )
public class CompanyController { @Autowired private CompanyService companyService; @GetMapping ( "/selectAll" ) public List < Company > selectAll ( ) { return companyService. selectAll ( ) ; }
}
5.4.4.5 后端测试
5.4.4.6 修改basic.js
import axios from '../axios.js'
const zx_basic = 'http://localhost:9999/basic'
export const AllCategory = async ( ) => { const res = await axios. get ( zx_basic+ "/category/getTree" ) return res
}
export const Level1Category = async ( ) => { const res = await axios. get ( zx_basic+ "/category/level1Category" ) return res
}
export const GetDict = async ( code ) => { const res = await axios. get ( zx_basic+ "/dictionary/getDicItems/" + code) return res
}
const zx_system = 'http://localhost:8888/system'
export const GetCompany = async ( ) => { const res = await axios. get ( zx_system+ "/company/selectAll" ) return res
}
5.4.4.7 修改course.vue
< template> < el-card shadow = " always" > < h3> < el-icon> < ElementPlus /> </ el-icon> 课程管理</ h3> < el-row style = " padding : 10px; " gutter = " 3" > < el-col span = " 8" > < el-button type = " primary" size = " small" @click = " toAdd" > < el-icon> < CirclePlus /> </ el-icon> 新增</ el-button> < el-button v-if = " multipleSelection.length" type = " danger" size = " small" @click = " handlerMuchDel" > 删除多条</ el-button> </ el-col> < el-col span = " 16" > < el-input size = " small" v-model = " searchName" placeholder = " 按课程名称搜索" > < template #append > < el-icon> < Search/> </ el-icon> </ template> </ el-input> </ el-col> </ el-row> < el-table :data = " filterData" @selection-change = " handleSelectionChange" border > < el-table-column prop = " id" type = " selection" width = " 55" > </ el-table-column> < el-table-column prop = " planNum" label = " 计划数量" heder-align = " center" > </ el-table-column> < el-table-column prop = " companyName" label = " 公司名称" heder-align = " center" > </ el-table-column> < el-table-column prop = " name" label = " 课程名称" heder-align = " center" > </ el-table-column> < el-table-column prop = " tags" label = " 课程标签" heder-align = " center" > </ el-table-column> < el-table-column prop = " mtName" label = " 大分类名称" heder-align = " center" > </ el-table-column> < el-table-column prop = " stName" label = " 小分类名称" heder-align = " center" > </ el-table-column> < el-table-column prop = " grade" label = " 课程等级" heder-align = " center" > </ el-table-column> < el-table-column prop = " teachmode" label = " 教学模式" heder-align = " center" > </ el-table-column> < el-table-column prop