| | |
| | | |
| | | <resultMap type="SysUser" id="SysUserResult"> |
| | | <id property="userId" column="id" /> |
| | | <result property="sort" column="sort" /> |
| | | <result property="deptId" column="dept_id" /> |
| | | <result property="userName" column="account" /> |
| | | <result property="nickName" column="name" /> |
| | |
| | | |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select u.id, |
| | | u.sort, |
| | | u.dept_id, |
| | | u.name, |
| | | u.account, |
| | |
| | | group by u.id |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | | ORDER BY u.sort |
| | | </select> |
| | | |
| | | <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
| | |
| | | <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | insert into user( |
| | | <if test="userId != null and userId != 0">id,</if> |
| | | <if test="sort != null and sort != ''">sort,</if> |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | | <if test="userName != null and userName != ''">account,</if> |
| | | <if test="nickName != null and nickName != ''">`name`,</if> |
| | |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | | <if test="sort != null and sort != ''">#{sort},</if> |
| | | <if test="deptId != null and deptId != ''">#{deptId},</if> |
| | | <if test="userName != null and userName != ''">#{userName},</if> |
| | | <if test="nickName != null and nickName != ''">#{nickName},</if> |