| | |
| | | <result column="department_id" jdbcType="INTEGER" property="departmentId" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, user_id, department_id |
| | | id, user_id, department_id, dept_admin |
| | | </sql> |
| | | |
| | | <insert id="insert" parameterType="com.mindskip.xzs.domain.UserDepartment" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into t_user_department (id, user_id, department_id |
| | | insert into t_user_department (id, user_id, department_id, dept_admin |
| | | ) |
| | | values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{departmentId,jdbcType=INTEGER} |
| | | values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{departmentId,jdbcType=INTEGER}, #{deptAdmin} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertBatchByDepartmentExamine"> |
| | | insert into t_user_department (user_id, department_id) |
| | | values |
| | | <foreach collection="departmentIds.split(',')" item="item" separator=","> |
| | | (#{userId}, #{item}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <select id="selectByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> |
| | |
| | | </set> |
| | | where id = #{id} |
| | | </update> |
| | | </mapper> |
| | | |
| | | <select id="getDeptUserList" resultType="com.mindskip.xzs.domain.vo.BaseSelect" > |
| | | SELECT |
| | | tu.id, |
| | | tu.real_name as 'value' |
| | | FROM |
| | | t_user tu |
| | | INNER JOIN t_user_department tud ON tud.user_id = tu.id |
| | | <where> |
| | | AND tud.department_id = #{depId} |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |