| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?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="platform.modules.sys.dao.GroupDao">
- <select id="findByGroupName" resultType="platform.modules.sys.entity.Group">
- select * from sys_group where name=#{name}
- <if test="id!=null and id!=''">
- and id!=#{id}
- </if>
- <if test="user_type!=null ">
- and user_type = #{user_type}
- </if>
- <if test="department_id!=null and department_id!=''">
- and (
- street_id = #{department_id}
- or build_id = #{department_id}
- or company_id = #{department_id}
- )
- </if>
- </select>
- <select id="findByGroupNameOnly" resultType="platform.modules.sys.entity.Group">
- select * from sys_group where name=#{name}
- </select>
- <select id="findUserIdById" resultType="Integer">
- select user_id from sys_user_group where group_id=#{id}
- </select>
- <select id="getHighestApproveLevel" resultType="Integer">
- select
- min(approve_level)
- from sys_user_group ug
- LEFT JOIN sys_group g on g.id = ug.group_id
- left JOIN z_user u on u.id = ug.user_id
- where g.id = #{id}
- </select>
- </mapper>
|