1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package cc.mrbird.febs.server.system.mapper;
 
import cc.mrbird.febs.common.core.entity.system.Dept;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
 
/**
 * @author MrBird
 */
public interface DeptMapper extends BaseMapper<Dept> {
    @Update("<script>" +
            " update t_dept\n" +
            " set allDeptName = replace(allDeptName, #{fromName}, #{toName})" +
            " where allDeptName like #{queryParam}" +
            "</script>")
    public void changeAllDeptName(@Param("fromName") String fromName, @Param("toName") String toName,@Param("queryParam") String queryParam);
 
    @Update("<script>" +
            " update t_emp_baseinfo\n" +
            " set allDeptName = replace(allDeptName, #{fromName}, #{toName})" +
            " where allDeptName like #{queryParam}" +
            "</script>")
    public void updateEmpAllDeptName(@Param("fromName") String fromName, @Param("toName") String toName,@Param("queryParam") String queryParam);
 
    @Update("<script>" +
            " update t_emp_baseinfo \n" +
            " set deptName = #{newDeptName} \n" +
            " where deptId = #{queryParam} \n" +
            "</script>")
    public void updateEmpDeptName(@Param("newDeptName") String newDeptName,@Param("queryParam") String queryParam);
}