完善权限+正则

master
李永杰 2023-11-19 21:19:56 +08:00
parent c67ec5a6ab
commit 233021c10b
2 changed files with 20 additions and 18 deletions

View File

@ -15,9 +15,8 @@
</where>
</select>
<insert id="add">
insert into tb_employee (emp_name, username, password, emp_tel, emp_id_card, emp_age, emp_gender, emp_address, emp_sal)
values (#{empName},#{username},#{password},#{empTel},#{empIdCard},#{empAge},#{empGender},#{empAddress},#{empSal})
<insert id="add" useGeneratedKeys="true" keyProperty="empId">
<include refid="com.bwie.manage.mapper.ManagerMapper.insertEmp"></include>
</insert>
<select id="findById" resultType="com.bwie.common.domain.Emp">

View File

@ -27,23 +27,26 @@
left join tb_post p on ep.post_id = p.post_id
</sql>
<sql id="insertEmp">
insert into tb_employee (emp_name, username, password, emp_tel, emp_id_card, emp_age, emp_gender, emp_address, emp_sal)
values (#{empName},#{username},#{password},#{empTel},#{empIdCard},#{empAge},#{empGender},#{empAddress},#{empSal})
</sql>
<select id="list" resultType="com.bwie.common.domain.response.EmpResponse">
<include refid="selectEmpVo"/>
<where>
er.role_id = 2 or er.role_id = 3
er.role_id in (2, 3)
<if test="null != empName and '' != empName">
and e.emp_name like concat('%',#{empName},'%')
</if>
</where>
</select>
<insert id="add">
insert into tb_employee (emp_name, username, password, emp_tel, emp_id_card, emp_age, emp_gender, emp_address, emp_sal)
values (#{empName},#{username},#{password},#{empTel},#{empIdCard},#{empAge},#{empGender},#{empAddress},#{empSal})
<insert id="add" useGeneratedKeys="true" keyProperty="empId">
<include refid="insertEmp"></include>
</insert>
<select id="findById" resultType="com.bwie.common.domain.Emp">
<select id="findById" resultType="com.bwie.common.domain.response.EmpResponse">
<include refid="selectEmpVo"/> where e.emp_id = #{empId}
</select>