| | |
| | | <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> |
| | | |
| | |
| | | where user_id = #{userId,jdbcType=INTEGER} |
| | | </select> |
| | | |
| | | <select id="selectDeptByUserId" resultType="com.mindskip.xzs.domain.Department"> |
| | | SELECT |
| | | d.id,d.name |
| | | FROM t_user_department ud INNER JOIN t_department d ON ud.department_id = d.id |
| | | WHERE ud.user_id = #{userId} AND d.deleted = 0 |
| | | </select> |
| | | |
| | | <select id="selectByDepartmentId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |