9 changed files with 270 additions and 2 deletions
@ -0,0 +1,27 @@ |
|||
package com.ccsens.carbasics.persist.dao; |
|||
|
|||
import com.ccsens.carbasics.bean.po.OrganizationPositionTypeRelation; |
|||
import com.ccsens.carbasics.persist.mapper.OrganizationPositionTypeRelationMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author AUSU |
|||
*/ |
|||
@Repository |
|||
public interface OrganizationPositionTypeRelationDao extends OrganizationPositionTypeRelationMapper { |
|||
|
|||
/** |
|||
* 解除职位与角色的关系 |
|||
* @param positionId 职位id |
|||
*/ |
|||
void unbindRole(@Param("positionId") Long positionId); |
|||
|
|||
/** |
|||
* 绑定职位与角色的关系 |
|||
* @param positionTypeRelationList 职位角色关联列表 |
|||
*/ |
|||
void bindRole(@Param("positionTypeRelationList") List<OrganizationPositionTypeRelation> positionTypeRelationList); |
|||
} |
@ -0,0 +1,26 @@ |
|||
<?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.ccsens.carbasics.persist.dao.OrganizationPositionTypeRelationDao"> |
|||
|
|||
|
|||
<insert id="bindRole"> |
|||
INSERT INTO t_organization_position_type_relation ( |
|||
id, |
|||
position_id, |
|||
position_type_id |
|||
) |
|||
VALUES |
|||
<foreach collection="positionTypeRelationList" item="item" separator=","> |
|||
(#{item.id},#{item.position_id},#{item.position_type_id}) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
|
|||
<update id="unbindRole"> |
|||
UPDATE t_organization_position_type_relation |
|||
SET rec_status = 2 |
|||
WHERE position_id = #{positionId} |
|||
AND rec_status = 0 |
|||
</update> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue