20200529-zlp-3

优化代码生成
新增评分评价后台代码
This commit is contained in:
paidaxing444 2020-06-01 10:03:21 +08:00
parent abf9dc0b1b
commit e31e7b6c0d
43 changed files with 2300 additions and 1273 deletions

View File

@ -114,6 +114,18 @@ export const constantRoutes = [{
meta: { title: '一日流程标准', icon: '' }
}]
},
{
path: '/video_study',
component: Layout,
hidden: true,
children: [{
path: 'study/detail/:id(\\d+)',
component: () =>
import ('@/views/benyi_train/video_study/detail'),
name: 'Detail',
meta: { title: '培训视频详情', icon: '' }
}]
},
{
path: '/job',
component: Layout,

View File

@ -71,9 +71,20 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="编号" align="center" prop="id" />
<el-table-column label="培训视频标题" align="center" prop="title" :show-overflow-tooltip="true" />
<el-table-column label="视频简介" align="center" prop="information" :show-overflow-tooltip="true" />
<el-table-column
label="视频简介"
align="center"
prop="information"
:show-overflow-tooltip="true"
/>
<el-table-column label="培训讲师" align="center" prop="lecturername" />
<el-table-column label="所属类别" align="center" prop="type" :formatter="typeFormat" />
<el-table-column
label="所属类别"
align="center"
prop="type"
:formatter="typeFormat"
:show-overflow-tooltip="true"
/>
<el-table-column label="创建时间" align="center" prop="createtime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createtime) }}</span>
@ -110,6 +121,17 @@
<!-- 添加或修改培训对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="所属类别" prop="type">
<el-cascader
ref="typeCascader"
placeholder="请选择所属类别"
v-model="form.type"
:options="optionTypes"
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
clearable
@change="getLastChildName"
></el-cascader>
</el-form-item>
<el-form-item label="视频标题" prop="title">
<el-input v-model="form.title" type="textarea" placeholder="请输入内容" />
</el-form-item>
@ -154,15 +176,6 @@
<el-progress v-if="imgFlag == true" type="circle" :percentage="percent"></el-progress>
</el-upload>
</el-form-item>
<el-form-item label="所属类别" prop="type">
<el-cascader
placeholder="请选择所属类别"
v-model="form.type"
:options="optionTypes"
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
clearable
></el-cascader>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -272,6 +285,13 @@ export default {
});
},
methods: {
//label
getLastChildName(val) {
//console.log(val[val.length-1]);
//console.log(this.$refs.myCascader.getCheckedNodes()[0].pathLabels[val.length-1]);
var lastLable=this.$refs.typeCascader.getCheckedNodes()[0].pathLabels[val.length-1];
this.form.title=lastLable;
},
//
typeFormat(row, column) {
var actions = [];

View File

@ -10,7 +10,8 @@
clearable
></el-cascader>
</el-form-item>
<el-form-item label="讲师姓名" prop="lecturer">
<!-- 博士要求注释掉不需要该过滤条件 2020-05-30 zlp -->
<!-- <el-form-item label="讲师姓名" prop="lecturer">
<el-select v-model="queryParams.lecturer" filterable placeholder="请选择讲师">
<el-option
v-for="item in lecturerOptions"
@ -28,7 +29,7 @@
@keyup.enter.native="handleQuery"
placeholder="请输入培训视频标题"
/>
</el-form-item>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -43,10 +44,12 @@
:options="playerOptions[index]"
ref="videoPlayer"
></video-player>
<div class="to-detail" @click="toDetail(o)">
<div class="to-detail">
<el-tooltip effect="dark" :content="o.title" placement="bottom">
<div>
<router-link :to="'/video_study/study/detail/' + o.id" class="link-type">
<p class="info-title">{{o.title}}</p>
</router-link>
</div>
</el-tooltip>
<p class="info-title info-title-name">讲师:{{o.lecturername}}</p>
@ -79,7 +82,6 @@ export default {
name: "VideoStudy",
data() {
return {
qiniuUrl: "https://files.benyiedu.com", // 访
//
loading: true,
//
@ -117,9 +119,6 @@ export default {
});
},
methods: {
toDetail(arg) {
console.log(arg);
},
// childrenundefined
getTreeData(data) {
for (var i = 0; i < data.length; i++) {
@ -201,7 +200,7 @@ export default {
}
.to-detail {
cursor: pointer;
/*cursor: pointer;*/
padding: 14px;
}

View File

@ -1,6 +1,6 @@
<template>
<!-- 导入表 -->
<el-dialog title="导入表" :visible.sync="visible" width="800px" top="5vh">
<el-dialog title="导入表" :visible.sync="visible" width="800px" top="5vh" append-to-body>
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="表名称" prop="tableName">
<el-input

View File

@ -80,7 +80,11 @@
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="序号" align="center" prop="tableId" width="60px" />
<el-table-column label="序号" type="index" width="50" align="center">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column
label="表名称"
align="center"
@ -145,7 +149,7 @@
@pagination="getList"
/>
<!-- 预览界面 -->
<el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh">
<el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body>
<el-tabs v-model="preview.activeName">
<el-tab-pane
v-for="(value, key) in preview.data"

View File

@ -1,6 +1,5 @@
package com.ruoyi.project.benyi.controller;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.SecurityUtils;

View File

@ -3,9 +3,7 @@ package com.ruoyi.project.benyi.controller;
import java.util.Date;
import java.util.List;
import com.qiniu.util.Auth;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.config.FileConfig;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -0,0 +1,103 @@
package com.ruoyi.project.benyi.service.impl;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.benyi.domain.ByTrainVideoFeedback;
import com.ruoyi.project.benyi.service.IByTrainVideoFeedbackService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 培训视频评价反馈Controller
*
* @author tsbz
* @date 2020-06-01
*/
@RestController
@RequestMapping("/benyi/feedback")
public class ByTrainVideoFeedbackController extends BaseController
{
@Autowired
private IByTrainVideoFeedbackService byTrainVideoFeedbackService;
/**
* 查询培训视频评价反馈列表
*/
@PreAuthorize("@ss.hasPermi('benyi:feedback:list')")
@GetMapping("/list")
public TableDataInfo list(ByTrainVideoFeedback byTrainVideoFeedback)
{
startPage();
List<ByTrainVideoFeedback> list = byTrainVideoFeedbackService.selectByTrainVideoFeedbackList(byTrainVideoFeedback);
return getDataTable(list);
}
/**
* 导出培训视频评价反馈列表
*/
@PreAuthorize("@ss.hasPermi('benyi:feedback:export')")
@Log(title = "培训视频评价反馈", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ByTrainVideoFeedback byTrainVideoFeedback)
{
List<ByTrainVideoFeedback> list = byTrainVideoFeedbackService.selectByTrainVideoFeedbackList(byTrainVideoFeedback);
ExcelUtil<ByTrainVideoFeedback> util = new ExcelUtil<ByTrainVideoFeedback>(ByTrainVideoFeedback.class);
return util.exportExcel(list, "feedback");
}
/**
* 获取培训视频评价反馈详细信息
*/
@PreAuthorize("@ss.hasPermi('benyi:feedback:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(byTrainVideoFeedbackService.selectByTrainVideoFeedbackById(id));
}
/**
* 新增培训视频评价反馈
*/
@PreAuthorize("@ss.hasPermi('benyi:feedback:add')")
@Log(title = "培训视频评价反馈", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ByTrainVideoFeedback byTrainVideoFeedback)
{
return toAjax(byTrainVideoFeedbackService.insertByTrainVideoFeedback(byTrainVideoFeedback));
}
/**
* 修改培训视频评价反馈
*/
@PreAuthorize("@ss.hasPermi('benyi:feedback:edit')")
@Log(title = "培训视频评价反馈", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ByTrainVideoFeedback byTrainVideoFeedback)
{
return toAjax(byTrainVideoFeedbackService.updateByTrainVideoFeedback(byTrainVideoFeedback));
}
/**
* 删除培训视频评价反馈
*/
@PreAuthorize("@ss.hasPermi('benyi:feedback:remove')")
@Log(title = "培训视频评价反馈", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(byTrainVideoFeedbackService.deleteByTrainVideoFeedbackByIds(ids));
}
}

View File

@ -0,0 +1,103 @@
package com.ruoyi.project.benyi.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.benyi.domain.ByTrainVideoScore;
import com.ruoyi.project.benyi.service.IByTrainVideoScoreService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 培训视频评分Controller
*
* @author tsbz
* @date 2020-06-01
*/
@RestController
@RequestMapping("/benyi/score")
public class ByTrainVideoScoreController extends BaseController
{
@Autowired
private IByTrainVideoScoreService byTrainVideoScoreService;
/**
* 查询培训视频评分列表
*/
@PreAuthorize("@ss.hasPermi('benyi:score:list')")
@GetMapping("/list")
public TableDataInfo list(ByTrainVideoScore byTrainVideoScore)
{
startPage();
List<ByTrainVideoScore> list = byTrainVideoScoreService.selectByTrainVideoScoreList(byTrainVideoScore);
return getDataTable(list);
}
/**
* 导出培训视频评分列表
*/
@PreAuthorize("@ss.hasPermi('benyi:score:export')")
@Log(title = "培训视频评分", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ByTrainVideoScore byTrainVideoScore)
{
List<ByTrainVideoScore> list = byTrainVideoScoreService.selectByTrainVideoScoreList(byTrainVideoScore);
ExcelUtil<ByTrainVideoScore> util = new ExcelUtil<ByTrainVideoScore>(ByTrainVideoScore.class);
return util.exportExcel(list, "score");
}
/**
* 获取培训视频评分详细信息
*/
@PreAuthorize("@ss.hasPermi('benyi:score:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(byTrainVideoScoreService.selectByTrainVideoScoreById(id));
}
/**
* 新增培训视频评分
*/
@PreAuthorize("@ss.hasPermi('benyi:score:add')")
@Log(title = "培训视频评分", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ByTrainVideoScore byTrainVideoScore)
{
return toAjax(byTrainVideoScoreService.insertByTrainVideoScore(byTrainVideoScore));
}
/**
* 修改培训视频评分
*/
@PreAuthorize("@ss.hasPermi('benyi:score:edit')")
@Log(title = "培训视频评分", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ByTrainVideoScore byTrainVideoScore)
{
return toAjax(byTrainVideoScoreService.updateByTrainVideoScore(byTrainVideoScore));
}
/**
* 删除培训视频评分
*/
@PreAuthorize("@ss.hasPermi('benyi:score:remove')")
@Log(title = "培训视频评分", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(byTrainVideoScoreService.deleteByTrainVideoScoreByIds(ids));
}
}

View File

@ -0,0 +1,97 @@
package com.ruoyi.project.benyi.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import java.util.Date;
/**
* 培训视频评价反馈对象 by_train_video_feedback
*
* @author tsbz
* @date 2020-06-01
*/
public class ByTrainVideoFeedback extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private Long id;
/** 视频id */
@Excel(name = "视频id")
private Long videoid;
/** 反馈意见建议 */
@Excel(name = "反馈意见建议")
private String content;
/** 创建人 */
@Excel(name = "创建人")
private Long createuserid;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createtime;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setVideoid(Long videoid)
{
this.videoid = videoid;
}
public Long getVideoid()
{
return videoid;
}
public void setContent(String content)
{
this.content = content;
}
public String getContent()
{
return content;
}
public void setCreateuserid(Long createuserid)
{
this.createuserid = createuserid;
}
public Long getCreateuserid()
{
return createuserid;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public Date getCreatetime() {
return createtime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("videoid", getVideoid())
.append("content", getContent())
.append("createuserid", getCreateuserid())
.append("createtime", getCreatetime())
.toString();
}
}

View File

@ -0,0 +1,110 @@
package com.ruoyi.project.benyi.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import java.util.Date;
/**
* 培训视频评分对象 by_train_video_score
*
* @author tsbz
* @date 2020-06-01
*/
public class ByTrainVideoScore extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private Long id;
/** 视频编号 */
@Excel(name = "视频编号")
private Long videoid;
/** 讲师id */
@Excel(name = "讲师id")
private Long lecturerid;
/** 评分 */
@Excel(name = "评分")
private Long score;
/** 创建人 */
@Excel(name = "创建人")
private Long createuserid;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createtime;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setVideoid(Long videoid)
{
this.videoid = videoid;
}
public Long getVideoid()
{
return videoid;
}
public void setLecturerid(Long lecturerid)
{
this.lecturerid = lecturerid;
}
public Long getLecturerid()
{
return lecturerid;
}
public void setScore(Long score)
{
this.score = score;
}
public Long getScore()
{
return score;
}
public void setCreateuserid(Long createuserid)
{
this.createuserid = createuserid;
}
public Long getCreateuserid()
{
return createuserid;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public Date getCreatetime() {
return createtime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("videoid", getVideoid())
.append("lecturerid", getLecturerid())
.append("score", getScore())
.append("createuserid", getCreateuserid())
.append("createtime", getCreatetime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.mapper;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByTrainVideoFeedback;
/**
* 培训视频评价反馈Mapper接口
*
* @author tsbz
* @date 2020-06-01
*/
public interface ByTrainVideoFeedbackMapper
{
/**
* 查询培训视频评价反馈
*
* @param id 培训视频评价反馈ID
* @return 培训视频评价反馈
*/
public ByTrainVideoFeedback selectByTrainVideoFeedbackById(Long id);
/**
* 查询培训视频评价反馈列表
*
* @param byTrainVideoFeedback 培训视频评价反馈
* @return 培训视频评价反馈集合
*/
public List<ByTrainVideoFeedback> selectByTrainVideoFeedbackList(ByTrainVideoFeedback byTrainVideoFeedback);
/**
* 新增培训视频评价反馈
*
* @param byTrainVideoFeedback 培训视频评价反馈
* @return 结果
*/
public int insertByTrainVideoFeedback(ByTrainVideoFeedback byTrainVideoFeedback);
/**
* 修改培训视频评价反馈
*
* @param byTrainVideoFeedback 培训视频评价反馈
* @return 结果
*/
public int updateByTrainVideoFeedback(ByTrainVideoFeedback byTrainVideoFeedback);
/**
* 删除培训视频评价反馈
*
* @param id 培训视频评价反馈ID
* @return 结果
*/
public int deleteByTrainVideoFeedbackById(Long id);
/**
* 批量删除培训视频评价反馈
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteByTrainVideoFeedbackByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.mapper;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByTrainVideoScore;
/**
* 培训视频评分Mapper接口
*
* @author tsbz
* @date 2020-06-01
*/
public interface ByTrainVideoScoreMapper
{
/**
* 查询培训视频评分
*
* @param id 培训视频评分ID
* @return 培训视频评分
*/
public ByTrainVideoScore selectByTrainVideoScoreById(Long id);
/**
* 查询培训视频评分列表
*
* @param byTrainVideoScore 培训视频评分
* @return 培训视频评分集合
*/
public List<ByTrainVideoScore> selectByTrainVideoScoreList(ByTrainVideoScore byTrainVideoScore);
/**
* 新增培训视频评分
*
* @param byTrainVideoScore 培训视频评分
* @return 结果
*/
public int insertByTrainVideoScore(ByTrainVideoScore byTrainVideoScore);
/**
* 修改培训视频评分
*
* @param byTrainVideoScore 培训视频评分
* @return 结果
*/
public int updateByTrainVideoScore(ByTrainVideoScore byTrainVideoScore);
/**
* 删除培训视频评分
*
* @param id 培训视频评分ID
* @return 结果
*/
public int deleteByTrainVideoScoreById(Long id);
/**
* 批量删除培训视频评分
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteByTrainVideoScoreByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.service;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByTrainVideoFeedback;
/**
* 培训视频评价反馈Service接口
*
* @author tsbz
* @date 2020-06-01
*/
public interface IByTrainVideoFeedbackService
{
/**
* 查询培训视频评价反馈
*
* @param id 培训视频评价反馈ID
* @return 培训视频评价反馈
*/
public ByTrainVideoFeedback selectByTrainVideoFeedbackById(Long id);
/**
* 查询培训视频评价反馈列表
*
* @param byTrainVideoFeedback 培训视频评价反馈
* @return 培训视频评价反馈集合
*/
public List<ByTrainVideoFeedback> selectByTrainVideoFeedbackList(ByTrainVideoFeedback byTrainVideoFeedback);
/**
* 新增培训视频评价反馈
*
* @param byTrainVideoFeedback 培训视频评价反馈
* @return 结果
*/
public int insertByTrainVideoFeedback(ByTrainVideoFeedback byTrainVideoFeedback);
/**
* 修改培训视频评价反馈
*
* @param byTrainVideoFeedback 培训视频评价反馈
* @return 结果
*/
public int updateByTrainVideoFeedback(ByTrainVideoFeedback byTrainVideoFeedback);
/**
* 批量删除培训视频评价反馈
*
* @param ids 需要删除的培训视频评价反馈ID
* @return 结果
*/
public int deleteByTrainVideoFeedbackByIds(Long[] ids);
/**
* 删除培训视频评价反馈信息
*
* @param id 培训视频评价反馈ID
* @return 结果
*/
public int deleteByTrainVideoFeedbackById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.service;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByTrainVideoScore;
/**
* 培训视频评分Service接口
*
* @author tsbz
* @date 2020-06-01
*/
public interface IByTrainVideoScoreService
{
/**
* 查询培训视频评分
*
* @param id 培训视频评分ID
* @return 培训视频评分
*/
public ByTrainVideoScore selectByTrainVideoScoreById(Long id);
/**
* 查询培训视频评分列表
*
* @param byTrainVideoScore 培训视频评分
* @return 培训视频评分集合
*/
public List<ByTrainVideoScore> selectByTrainVideoScoreList(ByTrainVideoScore byTrainVideoScore);
/**
* 新增培训视频评分
*
* @param byTrainVideoScore 培训视频评分
* @return 结果
*/
public int insertByTrainVideoScore(ByTrainVideoScore byTrainVideoScore);
/**
* 修改培训视频评分
*
* @param byTrainVideoScore 培训视频评分
* @return 结果
*/
public int updateByTrainVideoScore(ByTrainVideoScore byTrainVideoScore);
/**
* 批量删除培训视频评分
*
* @param ids 需要删除的培训视频评分ID
* @return 结果
*/
public int deleteByTrainVideoScoreByIds(Long[] ids);
/**
* 删除培训视频评分信息
*
* @param id 培训视频评分ID
* @return 结果
*/
public int deleteByTrainVideoScoreById(Long id);
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.project.benyi.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.benyi.mapper.ByTrainVideoFeedbackMapper;
import com.ruoyi.project.benyi.domain.ByTrainVideoFeedback;
import com.ruoyi.project.benyi.service.IByTrainVideoFeedbackService;
/**
* 培训视频评价反馈Service业务层处理
*
* @author tsbz
* @date 2020-06-01
*/
@Service
public class ByTrainVideoFeedbackServiceImpl implements IByTrainVideoFeedbackService
{
@Autowired
private ByTrainVideoFeedbackMapper byTrainVideoFeedbackMapper;
/**
* 查询培训视频评价反馈
*
* @param id 培训视频评价反馈ID
* @return 培训视频评价反馈
*/
@Override
public ByTrainVideoFeedback selectByTrainVideoFeedbackById(Long id)
{
return byTrainVideoFeedbackMapper.selectByTrainVideoFeedbackById(id);
}
/**
* 查询培训视频评价反馈列表
*
* @param byTrainVideoFeedback 培训视频评价反馈
* @return 培训视频评价反馈
*/
@Override
public List<ByTrainVideoFeedback> selectByTrainVideoFeedbackList(ByTrainVideoFeedback byTrainVideoFeedback)
{
return byTrainVideoFeedbackMapper.selectByTrainVideoFeedbackList(byTrainVideoFeedback);
}
/**
* 新增培训视频评价反馈
*
* @param byTrainVideoFeedback 培训视频评价反馈
* @return 结果
*/
@Override
public int insertByTrainVideoFeedback(ByTrainVideoFeedback byTrainVideoFeedback)
{
return byTrainVideoFeedbackMapper.insertByTrainVideoFeedback(byTrainVideoFeedback);
}
/**
* 修改培训视频评价反馈
*
* @param byTrainVideoFeedback 培训视频评价反馈
* @return 结果
*/
@Override
public int updateByTrainVideoFeedback(ByTrainVideoFeedback byTrainVideoFeedback)
{
return byTrainVideoFeedbackMapper.updateByTrainVideoFeedback(byTrainVideoFeedback);
}
/**
* 批量删除培训视频评价反馈
*
* @param ids 需要删除的培训视频评价反馈ID
* @return 结果
*/
@Override
public int deleteByTrainVideoFeedbackByIds(Long[] ids)
{
return byTrainVideoFeedbackMapper.deleteByTrainVideoFeedbackByIds(ids);
}
/**
* 删除培训视频评价反馈信息
*
* @param id 培训视频评价反馈ID
* @return 结果
*/
@Override
public int deleteByTrainVideoFeedbackById(Long id)
{
return byTrainVideoFeedbackMapper.deleteByTrainVideoFeedbackById(id);
}
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.project.benyi.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.benyi.mapper.ByTrainVideoScoreMapper;
import com.ruoyi.project.benyi.domain.ByTrainVideoScore;
import com.ruoyi.project.benyi.service.IByTrainVideoScoreService;
/**
* 培训视频评分Service业务层处理
*
* @author tsbz
* @date 2020-06-01
*/
@Service
public class ByTrainVideoScoreServiceImpl implements IByTrainVideoScoreService
{
@Autowired
private ByTrainVideoScoreMapper byTrainVideoScoreMapper;
/**
* 查询培训视频评分
*
* @param id 培训视频评分ID
* @return 培训视频评分
*/
@Override
public ByTrainVideoScore selectByTrainVideoScoreById(Long id)
{
return byTrainVideoScoreMapper.selectByTrainVideoScoreById(id);
}
/**
* 查询培训视频评分列表
*
* @param byTrainVideoScore 培训视频评分
* @return 培训视频评分
*/
@Override
public List<ByTrainVideoScore> selectByTrainVideoScoreList(ByTrainVideoScore byTrainVideoScore)
{
return byTrainVideoScoreMapper.selectByTrainVideoScoreList(byTrainVideoScore);
}
/**
* 新增培训视频评分
*
* @param byTrainVideoScore 培训视频评分
* @return 结果
*/
@Override
public int insertByTrainVideoScore(ByTrainVideoScore byTrainVideoScore)
{
return byTrainVideoScoreMapper.insertByTrainVideoScore(byTrainVideoScore);
}
/**
* 修改培训视频评分
*
* @param byTrainVideoScore 培训视频评分
* @return 结果
*/
@Override
public int updateByTrainVideoScore(ByTrainVideoScore byTrainVideoScore)
{
return byTrainVideoScoreMapper.updateByTrainVideoScore(byTrainVideoScore);
}
/**
* 批量删除培训视频评分
*
* @param ids 需要删除的培训视频评分ID
* @return 结果
*/
@Override
public int deleteByTrainVideoScoreByIds(Long[] ids)
{
return byTrainVideoScoreMapper.deleteByTrainVideoScoreByIds(ids);
}
/**
* 删除培训视频评分信息
*
* @param id 培训视频评分ID
* @return 结果
*/
@Override
public int deleteByTrainVideoScoreById(Long id)
{
return byTrainVideoScoreMapper.deleteByTrainVideoScoreById(id);
}
}

View File

@ -85,8 +85,8 @@ public class SysDictMoedataController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('system:moedata:remove')")
@Log(title = "多级字典管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(sysDictMoedataService.deleteSysDictMoedataByIds(ids));
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id) {
return toAjax(sysDictMoedataService.deleteSysDictMoedataById(id));
}
}

View File

@ -124,6 +124,9 @@ public class GenController extends BaseController
return AjaxResult.success();
}
/**
* 删除代码生成
*/
@PreAuthorize("@ss.hasPermi('tool:gen:remove')")
@Log(title = "代码生成", businessType = BusinessType.DELETE)
@DeleteMapping("/{tableIds}")

View File

@ -138,7 +138,7 @@ public class VelocityUtils
{
fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className);
}
else if (template.contains("service.java.vm"))
else if (template.contains("serviceImpl.java.vm"))
{
fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className);
}
@ -196,6 +196,7 @@ public class VelocityUtils
if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType()))
{
importList.add("java.util.Date");
importList.add("com.fasterxml.jackson.annotation.JsonFormat");
}
else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType()))
{

View File

@ -0,0 +1,74 @@
<?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.ruoyi.project.benyi.mapper.ByTrainVideoFeedbackMapper">
<resultMap type="ByTrainVideoFeedback" id="ByTrainVideoFeedbackResult">
<result property="id" column="id" />
<result property="videoid" column="videoid" />
<result property="content" column="content" />
<result property="createuserid" column="createuserid" />
<result property="createtime" column="createtime" />
</resultMap>
<sql id="selectByTrainVideoFeedbackVo">
select id, videoid, content, createuserid, createtime from by_train_video_feedback
</sql>
<select id="selectByTrainVideoFeedbackList" parameterType="ByTrainVideoFeedback" resultMap="ByTrainVideoFeedbackResult">
<include refid="selectByTrainVideoFeedbackVo"/>
<where>
<if test="videoid != null "> and videoid = #{videoid}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
<if test="createtime != null "> and createtime = #{createtime}</if>
</where>
</select>
<select id="selectByTrainVideoFeedbackById" parameterType="Long" resultMap="ByTrainVideoFeedbackResult">
<include refid="selectByTrainVideoFeedbackVo"/>
where id = #{id}
</select>
<insert id="insertByTrainVideoFeedback" parameterType="ByTrainVideoFeedback">
insert into by_train_video_feedback
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null ">id,</if>
<if test="videoid != null ">videoid,</if>
<if test="content != null and content != ''">content,</if>
<if test="createuserid != null ">createuserid,</if>
<if test="createtime != null ">createtime,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null ">#{id},</if>
<if test="videoid != null ">#{videoid},</if>
<if test="content != null and content != ''">#{content},</if>
<if test="createuserid != null ">#{createuserid},</if>
<if test="createtime != null ">#{createtime},</if>
</trim>
</insert>
<update id="updateByTrainVideoFeedback" parameterType="ByTrainVideoFeedback">
update by_train_video_feedback
<trim prefix="SET" suffixOverrides=",">
<if test="videoid != null ">videoid = #{videoid},</if>
<if test="content != null and content != ''">content = #{content},</if>
<if test="createuserid != null ">createuserid = #{createuserid},</if>
<if test="createtime != null ">createtime = #{createtime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteByTrainVideoFeedbackById" parameterType="Long">
delete from by_train_video_feedback where id = #{id}
</delete>
<delete id="deleteByTrainVideoFeedbackByIds" parameterType="String">
delete from by_train_video_feedback where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,79 @@
<?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.ruoyi.project.benyi.mapper.ByTrainVideoScoreMapper">
<resultMap type="ByTrainVideoScore" id="ByTrainVideoScoreResult">
<result property="id" column="id" />
<result property="videoid" column="videoid" />
<result property="lecturerid" column="lecturerid" />
<result property="score" column="score" />
<result property="createuserid" column="createuserid" />
<result property="createtime" column="createtime" />
</resultMap>
<sql id="selectByTrainVideoScoreVo">
select id, videoid, lecturerid, score, createuserid, createtime from by_train_video_score
</sql>
<select id="selectByTrainVideoScoreList" parameterType="ByTrainVideoScore" resultMap="ByTrainVideoScoreResult">
<include refid="selectByTrainVideoScoreVo"/>
<where>
<if test="videoid != null "> and videoid = #{videoid}</if>
<if test="lecturerid != null "> and lecturerid = #{lecturerid}</if>
<if test="score != null "> and score = #{score}</if>
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
<if test="createtime != null "> and createtime = #{createtime}</if>
</where>
</select>
<select id="selectByTrainVideoScoreById" parameterType="Long" resultMap="ByTrainVideoScoreResult">
<include refid="selectByTrainVideoScoreVo"/>
where id = #{id}
</select>
<insert id="insertByTrainVideoScore" parameterType="ByTrainVideoScore">
insert into by_train_video_score
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null ">id,</if>
<if test="videoid != null ">videoid,</if>
<if test="lecturerid != null ">lecturerid,</if>
<if test="score != null ">score,</if>
<if test="createuserid != null ">createuserid,</if>
<if test="createtime != null ">createtime,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null ">#{id},</if>
<if test="videoid != null ">#{videoid},</if>
<if test="lecturerid != null ">#{lecturerid},</if>
<if test="score != null ">#{score},</if>
<if test="createuserid != null ">#{createuserid},</if>
<if test="createtime != null ">#{createtime},</if>
</trim>
</insert>
<update id="updateByTrainVideoScore" parameterType="ByTrainVideoScore">
update by_train_video_score
<trim prefix="SET" suffixOverrides=",">
<if test="videoid != null ">videoid = #{videoid},</if>
<if test="lecturerid != null ">lecturerid = #{lecturerid},</if>
<if test="score != null ">score = #{score},</if>
<if test="createuserid != null ">createuserid = #{createuserid},</if>
<if test="createtime != null ">createtime = #{createtime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteByTrainVideoScoreById" parameterType="Long">
delete from by_train_video_score where id = #{id}
</delete>
<delete id="deleteByTrainVideoScoreByIds" parameterType="String">
delete from by_train_video_score where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -78,11 +78,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteSysDictMoedataById" parameterType="Long">
update from sys_dict_moedata set isdel='1' where id = #{id}
update sys_dict_moedata set isdel='1' where id = #{id}
</delete>
<delete id="deleteSysDictMoedataByIds" parameterType="String">
update from sys_dict_moedata set isdel='1' where id in
update sys_dict_moedata set isdel='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

View File

@ -1,7 +1,7 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.tool.gen.mapper.GenTableColumnMapper">
<resultMap type="GenTableColumn" id="GenTableColumnResult">

View File

@ -1,7 +1,7 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.tool.gen.mapper.GenTableMapper">
<resultMap type="GenTable" id="GenTableResult">
@ -62,12 +62,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tableComment != null and tableComment != ''">
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
</if>
<!-- <if test="beginTime != null and beginTime != ''">开始时间检索 -->
<!-- AND date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d') -->
<!-- </if> -->
<!-- <if test="endTime != null and endTime != ''">结束时间检索 -->
<!-- AND date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d') -->
<!-- </if> -->
<!-- <if test="beginTime != null and beginTime != ''">开始时间检索 -->
<!-- AND date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d') -->
<!-- </if> -->
<!-- <if test="endTime != null and endTime != ''">结束时间检索 -->
<!-- AND date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d') -->
<!-- </if> -->
</where>
</select>

View File

@ -36,25 +36,25 @@ public class ${ClassName}Controller extends BaseController
@Autowired
private I${ClassName}Service ${className}Service;
/**
/**
* 查询${functionName}列表
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
@GetMapping("/list")
#if($table.crud)
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
@GetMapping("/list")
#if($table.crud)
public TableDataInfo list(${ClassName} ${className})
{
startPage();
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
return getDataTable(list);
}
#elseif($table.tree)
#elseif($table.tree)
public AjaxResult list(${ClassName} ${className})
{
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
return AjaxResult.success(list);
}
#end
#end
/**
* 导出${functionName}列表

View File

@ -1,5 +1,8 @@
package ${packageName}.domain;
#foreach ($import in $importList)
import ${import};
#end
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
@ -8,9 +11,6 @@ import com.ruoyi.framework.web.domain.BaseEntity;
#elseif($table.tree)
import com.ruoyi.framework.web.domain.TreeEntity;
#end
#foreach ($import in $importList)
import ${import};
#end
/**
* ${functionName}对象 ${tableName}
@ -19,43 +19,44 @@ import ${import};
* @date ${datetime}
*/
#if($table.crud)
#set($Entity="BaseEntity")
#set($Entity="BaseEntity")
#elseif($table.tree)
#set($Entity="TreeEntity")
#set($Entity="TreeEntity")
#end
public class ${ClassName} extends ${Entity}
{
private static final long serialVersionUID = 1L;
{
private static final long serialVersionUID = 1L;
#foreach ($column in $columns)
#if(!$table.isSuperColumn($column.javaField))
#if(!$table.isSuperColumn($column.javaField))
/** $column.columnComment */
#if($column.list)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($parentheseIndex != -1)
#if($column.list)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($parentheseIndex != -1)
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
#elseif($column.javaType == 'Date')
#elseif($column.javaType == 'Date')
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
#else
#else
@Excel(name = "${comment}")
#end
#end
#end
#end
private $column.javaType $column.javaField;
#end
#end
#end
#foreach ($column in $columns)
#if(!$table.isSuperColumn($column.javaField))
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
#if(!$table.isSuperColumn($column.javaField))
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
public void set${AttrName}($column.javaType $column.javaField)
{
this.$column.javaField = $column.javaField;
@ -65,20 +66,20 @@ public class ${ClassName} extends ${Entity}
{
return $column.javaField;
}
#end
#end
#end
@Override
public String toString() {
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
#foreach ($column in $columns)
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
#foreach ($column in $columns)
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
.append("${column.javaField}", get${AttrName}())
#end
#end
.toString();
}
}
}

View File

@ -1,12 +1,12 @@
package ${packageName}.service.impl;
import java.util.List;
#foreach ($column in $columns)
#if($column.javaField == 'createTime' || $column.javaField == 'updateTime')
import com.ruoyi.common.utils.DateUtils;
#break
#end
#end
#foreach ($column in $columns)
#if($column.javaField == 'createTime' || $column.javaField == 'updateTime')
import com.ruoyi.common.utils.DateUtils;
#break
#end
#end
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ${packageName}.mapper.${ClassName}Mapper;
@ -58,11 +58,11 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
@Override
public int insert${ClassName}(${ClassName} ${className})
{
#foreach ($column in $columns)
#if($column.javaField == 'createTime')
#foreach ($column in $columns)
#if($column.javaField == 'createTime')
${className}.setCreateTime(DateUtils.getNowDate());
#end
#end
#end
#end
return ${className}Mapper.insert${ClassName}(${className});
}
@ -75,11 +75,11 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
@Override
public int update${ClassName}(${ClassName} ${className})
{
#foreach ($column in $columns)
#if($column.javaField == 'updateTime')
#foreach ($column in $columns)
#if($column.javaField == 'updateTime')
${className}.setUpdateTime(DateUtils.getNowDate());
#end
#end
#end
#end
return ${className}Mapper.update${ClassName}(${className});
}

View File

@ -1,17 +1,17 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
#foreach($column in $columns)
#if($column.query)
#set($dictType=$column.dictType)
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($column.htmlType == "input")
#foreach($column in $columns)
#if($column.query)
#set($dictType=$column.dictType)
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($column.htmlType == "input")
<el-form-item label="${comment}" prop="${column.javaField}">
<el-input
v-model="queryParams.${column.javaField}"
@ -21,7 +21,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
<el-form-item label="${comment}" prop="${column.javaField}">
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable size="small">
<el-option
@ -32,13 +32,13 @@
/>
</el-select>
</el-form-item>
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
<el-form-item label="${comment}" prop="${column.javaField}">
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
#elseif($column.htmlType == "datetime")
#elseif($column.htmlType == "datetime")
<el-form-item label="${comment}" prop="${column.javaField}">
<el-date-picker clearable size="small" style="width: 200px"
v-model="queryParams.${column.javaField}"
@ -47,9 +47,9 @@
placeholder="选择${comment}">
</el-date-picker>
</el-form-item>
#end
#end
#end
#end
#end
#end
<el-form-item>
<el-button
class="filter-item"
@ -76,27 +76,27 @@
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
#foreach($column in $columns)
#set($javaField=$column.javaField)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($column.pk)
#elseif($column.list && $column.htmlType == "datetime")
#foreach($column in $columns)
#set($javaField=$column.javaField)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($column.pk)
#elseif($column.list && $column.htmlType == "datetime")
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.${javaField}) }}</span>
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
#elseif($column.list && "" != $column.dictType)
#elseif($column.list && "" != $column.dictType)
<el-table-column label="${comment}" align="center" prop="${javaField}" :formatter="${javaField}Format" />
#elseif($column.list && "" != $javaField)
#elseif($column.list && "" != $javaField)
<el-table-column label="${comment}" align="center" prop="${javaField}" />
#end
#end
#end
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -118,61 +118,63 @@
</el-table>
<!-- 添加或修改${functionName}对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px">
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
#foreach($column in $columns)
#set($field=$column.javaField)
#if($column.insert && !$column.pk)
#if(($column.usableColumn) || (!$column.superColumn))
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#set($dictType=$column.dictType)
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
#foreach($column in $columns)
#set($field=$column.javaField)
#if($column.insert && !$column.pk)
#if(($column.usableColumn) || (!$column.superColumn))
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#set($dictType=$column.dictType)
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
<el-form-item label="${comment}" prop="${treeParentCode}">
<treeselect v-model="form.${treeParentCode}" :options="${businessName}Options" :normalizer="normalizer" placeholder="请选择${comment}" />
</el-form-item>
#elseif($column.htmlType == "input")
#elseif($column.htmlType == "input")
<el-form-item label="${comment}" prop="${field}">
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
</el-form-item>
#elseif($column.htmlType == "select" && "" != $dictType)
#elseif($column.htmlType == "select" && "" != $dictType)
<el-form-item label="${comment}">
<el-select v-model="form.${field}" placeholder="请选择${comment}">
<el-option
v-for="dict in ${field}Options"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
#if($column.javaType == "Integer"):value="parseInt(dict.dictValue)"#else:value="dict.dictValue"#end
></el-option>
</el-select>
</el-form-item>
#elseif($column.htmlType == "select" && $dictType)
#elseif($column.htmlType == "select" && $dictType)
<el-form-item label="${comment}">
<el-select v-model="form.${field}" placeholder="请选择${comment}">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
#elseif($column.htmlType == "radio" && "" != $dictType)
#elseif($column.htmlType == "radio" && "" != $dictType)
<el-form-item label="${comment}">
<el-radio-group v-model="form.${field}">
<el-radio
v-for="dict in ${field}Options"
:key="dict.dictValue"
:label="dict.dictValue"
#if($column.javaType == "Integer"):label="parseInt(dict.dictValue)"#else:label="dict.dictValue"#end
>{{dict.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
#elseif($column.htmlType == "radio" && $dictType)
#elseif($column.htmlType == "radio" && $dictType)
<el-form-item label="${comment}">
<el-radio-group v-model="form.${field}">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
#elseif($column.htmlType == "datetime")
#elseif($column.htmlType == "datetime")
<el-form-item label="${comment}" prop="${field}">
<el-date-picker clearable size="small" style="width: 200px"
v-model="form.${field}"
@ -181,14 +183,14 @@
placeholder="选择${comment}">
</el-date-picker>
</el-form-item>
#elseif($column.htmlType == "textarea")
#elseif($column.htmlType == "textarea")
<el-form-item label="${comment}" prop="${field}">
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
</el-form-item>
#end
#end
#end
#end
#end
#end
#end
#end
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
@ -199,11 +201,11 @@
</template>
<script>
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
export default {
name: "${BusinessName}",
components: { Treeselect },
data() {
@ -218,59 +220,58 @@ export default {
title: "",
// 是否显示弹出层
open: false,
#foreach ($column in $columns)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if(${column.dictType} != '')
#foreach ($column in $columns)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if(${column.dictType} != '')
// $comment字典
${column.javaField}Options: []#if($velocityCount != $columns.size()),#end
#end
#end
${column.javaField}Options: [],
#end
#end
// 查询参数
queryParams: {
#foreach ($column in $columns)
#if($column.query)
#foreach ($column in $columns)
#if($column.query)
$column.javaField: undefined#if($velocityCount != $columns.size()),#end
#end
#end
#end
#end
},
// 表单参数
form: {},
// 表单校验
rules: {
#foreach ($column in $columns)
#if($column.required)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#set($comment=$column.columnComment)
#foreach ($column in $columns)
#if($column.required)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#set($comment=$column.columnComment)
$column.javaField: [
{ required: true, message: "$comment不能为空", trigger: "blur" }
]#if($velocityCount != $columns.size()),#end
#end
#end
#end
#end
}
};
},
created() {
this.getList();
#foreach ($column in $columns)
#if(${column.dictType} != '')
#foreach ($column in $columns)
#if(${column.dictType} != '')
this.getDicts("${column.dictType}").then(response => {
this.${column.javaField}Options = response.data;
});
#end
#end
#end
#end
},
methods: {
/** 查询${functionName}列表 */
@ -301,20 +302,20 @@ export default {
this.${businessName}Options.push(data);
});
},
#foreach ($column in $columns)
#if(${column.dictType} != '')
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#foreach ($column in $columns)
#if(${column.dictType} != '')
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
// $comment字典翻译
${column.javaField}Format(row, column) {
return this.selectDictLabel(this.${column.javaField}Options, row.${column.javaField});
},
#end
#end
#end
#end
// 取消按钮
cancel() {
this.open = false;
@ -323,15 +324,15 @@ export default {
// 表单重置
reset() {
this.form = {
#foreach ($column in $columns)
#if($column.htmlType == "radio")
#foreach ($column in $columns)
#if($column.htmlType == "radio")
$column.javaField: "0"#if($velocityCount != $columns.size()),#end
#else
#else
$column.javaField: undefined#if($velocityCount != $columns.size()),#end
#end
#end
#end
#end
};
this.resetForm("form");
},
@ -374,8 +375,6 @@ export default {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
} else {
this.msgError(response.msg);
}
});
} else {
@ -384,8 +383,6 @@ export default {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
} else {
this.msgError(response.msg);
}
});
}
@ -406,5 +403,5 @@ export default {
}).catch(function() {});
}
}
};
};
</script>

View File

@ -1,17 +1,17 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
#foreach($column in $columns)
#if($column.query)
#set($dictType=$column.dictType)
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($column.htmlType == "input")
#foreach($column in $columns)
#if($column.query)
#set($dictType=$column.dictType)
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($column.htmlType == "input")
<el-form-item label="${comment}" prop="${column.javaField}">
<el-input
v-model="queryParams.${column.javaField}"
@ -21,7 +21,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
<el-form-item label="${comment}" prop="${column.javaField}">
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable size="small">
<el-option
@ -32,13 +32,13 @@
/>
</el-select>
</el-form-item>
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
<el-form-item label="${comment}" prop="${column.javaField}">
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
#elseif($column.htmlType == "datetime")
#elseif($column.htmlType == "datetime")
<el-form-item label="${comment}" prop="${column.javaField}">
<el-date-picker clearable size="small" style="width: 200px"
v-model="queryParams.${column.javaField}"
@ -47,9 +47,9 @@
placeholder="选择${comment}">
</el-date-picker>
</el-form-item>
#end
#end
#end
#end
#end
#end
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -99,28 +99,28 @@
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
#foreach($column in $columns)
#set($javaField=$column.javaField)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($column.pk)
#foreach($column in $columns)
#set($javaField=$column.javaField)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($column.pk)
<el-table-column label="${comment}" align="center" prop="${javaField}" />
#elseif($column.list && $column.htmlType == "datetime")
#elseif($column.list && $column.htmlType == "datetime")
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.${javaField}) }}</span>
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
#elseif($column.list && "" != $column.dictType)
#elseif($column.list && "" != $column.dictType)
<el-table-column label="${comment}" align="center" prop="${javaField}" :formatter="${javaField}Format" />
#elseif($column.list && "" != $javaField)
#elseif($column.list && "" != $javaField)
<el-table-column label="${comment}" align="center" prop="${javaField}" />
#end
#end
#end
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -150,57 +150,59 @@
/>
<!-- 添加或修改${functionName}对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px">
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
#foreach($column in $columns)
#set($field=$column.javaField)
#if($column.insert && !$column.pk)
#if(($column.usableColumn) || (!$column.superColumn))
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#set($dictType=$column.dictType)
#if($column.htmlType == "input")
#foreach($column in $columns)
#set($field=$column.javaField)
#if($column.insert && !$column.pk)
#if(($column.usableColumn) || (!$column.superColumn))
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#set($dictType=$column.dictType)
#if($column.htmlType == "input")
<el-form-item label="${comment}" prop="${field}">
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
</el-form-item>
#elseif($column.htmlType == "select" && "" != $dictType)
#elseif($column.htmlType == "select" && "" != $dictType)
<el-form-item label="${comment}">
<el-select v-model="form.${field}" placeholder="请选择${comment}">
<el-option
v-for="dict in ${field}Options"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
#if($column.javaType == "Integer"):value="parseInt(dict.dictValue)"#else:value="dict.dictValue"#end
></el-option>
</el-select>
</el-form-item>
#elseif($column.htmlType == "select" && $dictType)
#elseif($column.htmlType == "select" && $dictType)
<el-form-item label="${comment}">
<el-select v-model="form.${field}" placeholder="请选择${comment}">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
#elseif($column.htmlType == "radio" && "" != $dictType)
#elseif($column.htmlType == "radio" && "" != $dictType)
<el-form-item label="${comment}">
<el-radio-group v-model="form.${field}">
<el-radio
v-for="dict in ${field}Options"
:key="dict.dictValue"
:label="dict.dictValue"
#if($column.javaType == "Integer"):label="parseInt(dict.dictValue)"#else:label="dict.dictValue"#end
>{{dict.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
#elseif($column.htmlType == "radio" && $dictType)
#elseif($column.htmlType == "radio" && $dictType)
<el-form-item label="${comment}">
<el-radio-group v-model="form.${field}">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
#elseif($column.htmlType == "datetime")
#elseif($column.htmlType == "datetime")
<el-form-item label="${comment}" prop="${field}">
<el-date-picker clearable size="small" style="width: 200px"
v-model="form.${field}"
@ -209,14 +211,14 @@
placeholder="选择${comment}">
</el-date-picker>
</el-form-item>
#elseif($column.htmlType == "textarea")
#elseif($column.htmlType == "textarea")
<el-form-item label="${comment}" prop="${field}">
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
</el-form-item>
#end
#end
#end
#end
#end
#end
#end
#end
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
@ -227,9 +229,9 @@
</template>
<script>
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
export default {
export default {
name: "${BusinessName}",
data() {
return {
@ -249,61 +251,60 @@ export default {
title: "",
// 是否显示弹出层
open: false,
#foreach ($column in $columns)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if(${column.dictType} != '')
#foreach ($column in $columns)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if(${column.dictType} != '')
// $comment字典
${column.javaField}Options: []#if($velocityCount != $columns.size()),#end
#end
#end
${column.javaField}Options: [],
#end
#end
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
#foreach ($column in $columns)
#if($column.query)
#foreach ($column in $columns)
#if($column.query)
$column.javaField: undefined#if($velocityCount != $columns.size()),#end
#end
#end
#end
#end
},
// 表单参数
form: {},
// 表单校验
rules: {
#foreach ($column in $columns)
#if($column.required)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#set($comment=$column.columnComment)
#foreach ($column in $columns)
#if($column.required)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#set($comment=$column.columnComment)
$column.javaField: [
{ required: true, message: "$comment不能为空", trigger: "blur" }
]#if($velocityCount != $columns.size()),#end
#end
#end
#end
#end
}
};
},
created() {
this.getList();
#foreach ($column in $columns)
#if(${column.dictType} != '')
#foreach ($column in $columns)
#if(${column.dictType} != '')
this.getDicts("${column.dictType}").then(response => {
this.${column.javaField}Options = response.data;
});
#end
#end
#end
#end
},
methods: {
/** 查询${functionName}列表 */
@ -315,20 +316,20 @@ export default {
this.loading = false;
});
},
#foreach ($column in $columns)
#if(${column.dictType} != '')
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#foreach ($column in $columns)
#if(${column.dictType} != '')
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
// $comment字典翻译
${column.javaField}Format(row, column) {
return this.selectDictLabel(this.${column.javaField}Options, row.${column.javaField});
},
#end
#end
#end
#end
// 取消按钮
cancel() {
this.open = false;
@ -337,15 +338,15 @@ export default {
// 表单重置
reset() {
this.form = {
#foreach ($column in $columns)
#if($column.htmlType == "radio")
#foreach ($column in $columns)
#if($column.htmlType == "radio")
$column.javaField: "0"#if($velocityCount != $columns.size()),#end
#else
#else
$column.javaField: undefined#if($velocityCount != $columns.size()),#end
#end
#end
#end
#end
};
this.resetForm("form");
},
@ -391,8 +392,6 @@ export default {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
} else {
this.msgError(response.msg);
}
});
} else {
@ -401,8 +400,6 @@ export default {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
} else {
this.msgError(response.msg);
}
});
}
@ -437,5 +434,5 @@ export default {
}).catch(function() {});
}
}
};
};
</script>

View File

@ -1,13 +1,13 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${packageName}.mapper.${ClassName}Mapper">
<resultMap type="${ClassName}" id="${ClassName}Result">
#foreach ($column in $columns)
#foreach ($column in $columns)
<result property="${column.javaField}" column="${column.columnName}" />
#end
#end
</resultMap>
<sql id="select${ClassName}Vo">
@ -17,32 +17,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="select${ClassName}List" parameterType="${ClassName}" resultMap="${ClassName}Result">
<include refid="select${ClassName}Vo"/>
<where>
#foreach($column in $columns)
#set($queryType=$column.queryType)
#set($javaField=$column.javaField)
#set($javaType=$column.javaType)
#set($columnName=$column.columnName)
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#if($column.query)
#if($column.queryType == "EQ")
#foreach($column in $columns)
#set($queryType=$column.queryType)
#set($javaField=$column.javaField)
#set($javaType=$column.javaType)
#set($columnName=$column.columnName)
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#if($column.query)
#if($column.queryType == "EQ")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName = #{$javaField}</if>
#elseif($queryType == "NE")
#elseif($queryType == "NE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName != #{$javaField}</if>
#elseif($queryType == "GT")
#elseif($queryType == "GT")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt; #{$javaField}</if>
#elseif($queryType == "GTE")
#elseif($queryType == "GTE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt;= #{$javaField}</if>
#elseif($queryType == "LT")
#elseif($queryType == "LT")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt; #{$javaField}</if>
#elseif($queryType == "LTE")
#elseif($queryType == "LTE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt;= #{$javaField}</if>
#elseif($queryType == "LIKE")
#elseif($queryType == "LIKE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName like concat('%', #{$javaField}, '%')</if>
#elseif($queryType == "BETWEEN")
#elseif($queryType == "BETWEEN")
<if test="params.begin$AttrName != null and params.begin$AttrName != '' and params.end$AttrName != null and params.end$AttrName != ''"> and $columnName between #{params.begin$AttrName} and #{params.end$AttrName}</if>
#end
#end
#end
#end
#end
#end
</where>
</select>
@ -54,29 +54,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insert${ClassName}" parameterType="${ClassName}"#if($pkColumn.increment) useGeneratedKeys="true" keyProperty="$pkColumn.javaField"#end>
insert into ${tableName}
<trim prefix="(" suffix=")" suffixOverrides=",">
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
<if test="$column.javaField != null #if($column.javaType == 'String' ) and $column.javaField != ''#end">$column.columnName,</if>
#end
#end
#end
#end
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
<if test="$column.javaField != null #if($column.javaType == 'String' ) and $column.javaField != ''#end">#{$column.javaField},</if>
#end
#end
#end
#end
</trim>
</insert>
<update id="update${ClassName}" parameterType="${ClassName}">
update ${tableName}
<trim prefix="SET" suffixOverrides=",">
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName)
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName)
<if test="$column.javaField != null #if($column.javaType == 'String' ) and $column.javaField != ''#end">$column.columnName = #{$column.javaField},</if>
#end
#end
#end
#end
</trim>
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
</update>