This commit is contained in:
parent
3b4192b848
commit
eb5f3e8884
|
|
@ -55,8 +55,7 @@
|
|||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['test:stu:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
|
@ -67,8 +66,7 @@
|
|||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['test:stu:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
|
@ -79,8 +77,7 @@
|
|||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['test:stu:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
|
@ -90,8 +87,7 @@
|
|||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['test:stu:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
|
@ -110,16 +106,14 @@
|
|||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['test:stu:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['test:stu:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -158,7 +152,8 @@
|
|||
|
||||
export default {
|
||||
name: "Stu",
|
||||
components: {},
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
|
@ -188,7 +183,7 @@
|
|||
name: null,
|
||||
tel: null,
|
||||
email: null,
|
||||
createTime: null
|
||||
createTime: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
|
|
@ -203,11 +198,7 @@
|
|||
],
|
||||
email: [
|
||||
{ required: true, message: "电子邮件不能为空}", trigger: "blur" },
|
||||
{
|
||||
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
|
||||
message: '电子邮件格式有误',
|
||||
trigger: "blur"
|
||||
},
|
||||
{ pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, message: '电子邮件格式有误', trigger:"blur"},
|
||||
],
|
||||
}
|
||||
};
|
||||
|
|
@ -237,7 +228,10 @@
|
|||
name: null,
|
||||
tel: null,
|
||||
email: null,
|
||||
createTime: null
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import java.util.Date;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
|
|
@ -48,6 +49,11 @@ public class BaseEntity implements Serializable {
|
|||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 参数
|
||||
*/
|
||||
private String parameter;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
|
|
@ -65,6 +71,15 @@ public class BaseEntity implements Serializable {
|
|||
*/
|
||||
private Map<String, Object> params;
|
||||
|
||||
public void setParameter(String parameter) {
|
||||
if (parameter != null || parameter.equals("")) {
|
||||
this.parameter = parameter;
|
||||
JSONObject jsonObject = JSONObject.parseObject(parameter);
|
||||
params = new HashMap<>();
|
||||
params.put("",jsonObject.get(""));
|
||||
}
|
||||
}
|
||||
|
||||
public String getSearchValue() {
|
||||
return searchValue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@ import com.hchyun.common.constant.ReturnConstants;
|
|||
import com.hchyun.common.utils.DateUtils;
|
||||
#break
|
||||
#end
|
||||
#if($column.javaField == 'updateBy' || $column.javaField == 'createBy')
|
||||
import com.hchyun.common.utils.SecurityUtils;
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
import com.hchyun.common.utils.ServerResult;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -134,8 +138,8 @@ public class ${ClassName}ServiceImpl implements ${ClassName}Service {
|
|||
#if($column.javaField == 'updateTime')
|
||||
${className}.setUpdateTime(DateUtils.getNowDate());
|
||||
#end
|
||||
#if($column.javaField == 'createBy')
|
||||
${className}.setCreateBy(SecurityUtils.getUserId());
|
||||
#if($column.javaField == 'updateBy')
|
||||
${className}.setUpdateBy(SecurityUtils.getUserId());
|
||||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ export default {
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
#foreach ($column in $columns)
|
||||
#if($column.query)
|
||||
#if($column.query && $column.htmlType != "datetime" && $column.queryType != "BETWEEN")
|
||||
$column.javaField: null#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#end
|
||||
|
|
@ -488,6 +488,7 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
#foreach ($column in $columns)
|
||||
#if($column.htmlType != "datetime" && $column.queryType != "BETWEEN")
|
||||
#if($column.htmlType == "radio")
|
||||
$column.javaField: #if($column.javaType == "Integer" || $column.javaType == "Long")0#else"0"#end#if($velocityCount != $columns.size()),#end
|
||||
|
||||
|
|
@ -497,6 +498,7 @@ export default {
|
|||
#else
|
||||
$column.javaField: null#if($velocityCount != $columns.size()),#end
|
||||
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
};
|
||||
|
|
|
|||
|
|
@ -75,6 +75,9 @@ public class Stu extends BaseEntity
|
|||
.append("tel", getTel())
|
||||
.append("email", getEmail())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
|
||||
import com.hchyun.common.constant.ReturnConstants;
|
||||
import com.hchyun.common.utils.DateUtils;
|
||||
import com.hchyun.common.utils.SecurityUtils;
|
||||
import com.hchyun.common.utils.ServerResult;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -79,6 +80,7 @@ public class StuServiceImpl implements StuService {
|
|||
public ServerResult<Integer> insertStu(Stu stu) {
|
||||
try {
|
||||
stu.setCreateTime(DateUtils.getNowDate());
|
||||
stu.setCreateBy(SecurityUtils.getUserId());
|
||||
Integer renewal = stuDao.insertStu(stu);
|
||||
if (renewal >0){
|
||||
return new ServerResult<Integer>(true,renewal);
|
||||
|
|
@ -100,6 +102,8 @@ public class StuServiceImpl implements StuService {
|
|||
@Override
|
||||
public ServerResult<Integer> updateStu(Stu stu) {
|
||||
try {
|
||||
stu.setUpdateTime(DateUtils.getNowDate());
|
||||
stu.setUpdateBy(SecurityUtils.getUserId());
|
||||
Integer renewal = stuDao.updateStu(stu);
|
||||
if (renewal >0){
|
||||
return new ServerResult<Integer>(true,renewal);
|
||||
|
|
|
|||
|
|
@ -10,18 +10,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="tel" column="tel" />
|
||||
<result property="email" column="email" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectStuVo">
|
||||
select id, name, tel, email, create_time from sys_stu
|
||||
select id, name, tel, email, create_time, create_by, update_time, update_by from sys_stu
|
||||
</sql>
|
||||
|
||||
<select id="selectStuList" parameterType="Stu" resultMap="StuResult">
|
||||
<include refid="selectStuVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="tel != null "> and tel = #{tel}</if>
|
||||
<if test="email != null and email != ''"> and email = #{email}</if>
|
||||
<if test="tel != null "> and tel like concat('%', #{tel}, '%')</if>
|
||||
<if test="email != null and email != ''"> and email like concat('%', #{email}, '%')</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
@ -38,12 +41,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="tel != null">tel,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="tel != null">#{tel},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -54,6 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="tel != null">tel = #{tel},</if>
|
||||
<if test="email != null and email != ''">email = #{email},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
Loading…
Reference in New Issue