bug修复
This commit is contained in:
parent
a18ec54d1d
commit
0dcd14e887
|
|
@ -2,15 +2,28 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.gs.sub.evaluate.evaluate.dao.PersonDao">
|
||||
<insert id="addPersonInfo" keyProperty="userId" useGeneratedKeys="true">
|
||||
insert into sys_user(username, password, nickname, id_card, phone, sex, status, org_id)
|
||||
values (#{name},
|
||||
#{password},
|
||||
#{name},
|
||||
#{idCard},
|
||||
#{phone},
|
||||
#{sex},
|
||||
'1',
|
||||
#{deptId})
|
||||
INSERT INTO sys_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">username,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="name != null and name != ''">nickname,</if>
|
||||
<if test="idCard != null and idCard != ''">id_card,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="sex != null">sex,</if>
|
||||
<if test="deptId != null and deptId != ''">org_id,</if>
|
||||
status
|
||||
</trim>
|
||||
VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="idCard != null and idCard != ''">#{idCard},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="sex != null">#{sex},</if>
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
'1'
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="addPersonRole">
|
||||
insert into sys_role_user(userId, roleId) values
|
||||
|
|
@ -22,14 +35,30 @@
|
|||
insert into sys_role_user(userId, roleId) values (#{id}, #{roleId})
|
||||
</insert>
|
||||
<update id="updatePerson">
|
||||
update sys_user
|
||||
set username = #{name},
|
||||
id_card = #{idCard},
|
||||
phone = #{phone},
|
||||
UPDATE sys_user
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
username = #{name},
|
||||
nickname = #{name},
|
||||
sex =#{sex},
|
||||
</if>
|
||||
|
||||
<if test="idCard != null and idCard != ''">
|
||||
id_card = #{idCard},
|
||||
</if>
|
||||
|
||||
<if test="phone != null and phone != ''">
|
||||
phone = #{phone},
|
||||
</if>
|
||||
|
||||
<if test="sex != null">
|
||||
sex = #{sex},
|
||||
</if>
|
||||
|
||||
<if test="deptId != null and deptId != ''">
|
||||
org_id = #{deptId}
|
||||
where id = #{id}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updateOldUser">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-item" id="dept">
|
||||
<label class="layui-form-label" style="width: 150px"><span
|
||||
style="color: red">*</span>所属项目/部门:</label>
|
||||
<div class="layui-input-inline" style="width: 60%">
|
||||
|
|
@ -148,6 +148,7 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getDeptSelect() {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
|
|
@ -158,6 +159,7 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
layui.use(['form', 'laydate'], function () {
|
||||
var form = layui.form;
|
||||
var laydate = layui.laydate;
|
||||
|
|
@ -178,9 +180,15 @@
|
|||
if (obj.value == 5) {
|
||||
$('#deptId').val(7); // 设置为发展运营中心
|
||||
$('#deptId').attr('disabled', 'disabled');
|
||||
} else if (obj.value == 7) {
|
||||
$('#deptId').val("");
|
||||
$('#deptId').removeAttr('lay-verify');
|
||||
$('#dept').hide();
|
||||
} else {
|
||||
$('#deptId').val("");
|
||||
$('#deptId').removeAttr('disabled');
|
||||
$('#deptId').attr('lay-verify','required');
|
||||
$('#dept').show();
|
||||
}
|
||||
layui.form.render('select'); // 刷新下拉框
|
||||
});
|
||||
|
|
@ -216,10 +224,10 @@
|
|||
layer.msg("请选择角色", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}
|
||||
if ($('#deptId').val() == null || $('#deptId').val() == "") {
|
||||
layer.msg("请选择所属部门", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}
|
||||
// if ($('#deptId').val() == null || $('#deptId').val() == "") {
|
||||
// layer.msg("请选择所属部门", {icon: 2, time: 2000});
|
||||
// return false;
|
||||
// }
|
||||
|
||||
$.ajax({
|
||||
url: ctxPath + '/evaluatePerson/addPersonInfo',
|
||||
|
|
|
|||
Loading…
Reference in New Issue