|
@@ -3,22 +3,147 @@
|
|
|
<mapper namespace="com.css.simulation.resource.system.mapper.UserMapper" >
|
|
|
|
|
|
|
|
|
- <select id="getUserInfo" parameterType="java.lang.String" resultType="api.common.pojo.vo.system.UserInfoVO">
|
|
|
+ <select id="getUserInfo" parameterType="java.lang.String" resultType="api.common.pojo.vo.system.UserVO">
|
|
|
SELECT
|
|
|
- id,username,nickname,
|
|
|
+ id,
|
|
|
+ username,
|
|
|
+ nickname,
|
|
|
+ photo,
|
|
|
phone,
|
|
|
company,
|
|
|
- job,
|
|
|
- cpu_available_number,
|
|
|
- gpu_available_number,
|
|
|
- is_admin,
|
|
|
- is_sub,
|
|
|
- parent_id,
|
|
|
- is_deactivate
|
|
|
+ role_code
|
|
|
FROM system_user WHERE id = #{userId,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
+
|
|
|
+ <!-- 列表查询共用字段-->
|
|
|
+ <sql id="pageColumn">
|
|
|
+ id,
|
|
|
+ username,
|
|
|
+ nickname,
|
|
|
+ photo,
|
|
|
+ phone,
|
|
|
+ company,
|
|
|
+ role_code,
|
|
|
+ visible
|
|
|
+ </sql>
|
|
|
+ <!-- 列表查询共用查询条件-->
|
|
|
+ <sql id="pageWhere">
|
|
|
+ <if test="username != null and username != ''">
|
|
|
+ and username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="nickname != null and nickname != ''">
|
|
|
+ and nickname like CONCAT('%',#{nickname,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="company != null and company != ''">
|
|
|
+ and company like CONCAT('%',#{company,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="roleCode != null and roleCode != ''">
|
|
|
+ and role_code = #{roleCode,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="visible != null and visible != ''">
|
|
|
+ and visible = #{visible,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getUserPageLista" parameterType="api.common.pojo.param.system.UserParam" resultType="api.common.pojo.vo.system.UserVO">
|
|
|
+ SELECT
|
|
|
+ <include refid="pageColumn"></include>
|
|
|
+ FROM system_user
|
|
|
+ WHERE is_deleted = '0' AND role_code <> '0'
|
|
|
+ <include refid="pageWhere"></include>
|
|
|
+ ORDER BY modify_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getUserPageListb" parameterType="api.common.pojo.param.system.UserParam" resultType="api.common.pojo.vo.system.UserVO">
|
|
|
+ SELECT
|
|
|
+ <include refid="pageColumn"></include>
|
|
|
+ FROM system_user
|
|
|
+ WHERE is_deleted = '0' AND role_code <> '0' and role_code <> '1'
|
|
|
+ <include refid="pageWhere"></include>
|
|
|
+ ORDER BY modify_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getUserPageListc" parameterType="api.common.pojo.param.system.UserParam" resultType="api.common.pojo.vo.system.UserVO">
|
|
|
+ SELECT
|
|
|
+ <include refid="pageColumn"></include>
|
|
|
+ FROM system_user
|
|
|
+ WHERE is_deleted = '0' AND role_code = '3'
|
|
|
+ <include refid="pageWhere"></include>
|
|
|
+ and create_user_id = #{createUserId,jdbcType=VARCHAR}
|
|
|
+ ORDER BY modify_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectCount" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
|
from system_user
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="checkUsername" parameterType="api.common.pojo.po.system.UserPO" resultType="api.common.pojo.po.system.UserPO">
|
|
|
+ select
|
|
|
+ id
|
|
|
+ from system_user
|
|
|
+ where is_deleted = '0'
|
|
|
+ and username = #{username,jdbcType=VARCHAR}
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and id <> #{id,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="api.common.pojo.po.system.UserPO">
|
|
|
+ INSERT INTO system_user(
|
|
|
+ id,
|
|
|
+ username,
|
|
|
+ password,
|
|
|
+ nickname,
|
|
|
+ photo,
|
|
|
+ phone,
|
|
|
+ company,
|
|
|
+ role_code,
|
|
|
+ visible,
|
|
|
+ create_time,
|
|
|
+ modify_time,
|
|
|
+ create_user_id,
|
|
|
+ modify_user_id,
|
|
|
+ is_deleted
|
|
|
+ )
|
|
|
+ VALUES(
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
+ #{username,jdbcType=VARCHAR},
|
|
|
+ #{password,jdbcType=VARCHAR},
|
|
|
+ #{nickname,jdbcType=VARCHAR},
|
|
|
+ #{photo,jdbcType=VARCHAR},
|
|
|
+ #{phone,jdbcType=VARCHAR},
|
|
|
+ #{company,jdbcType=VARCHAR},
|
|
|
+ #{roleCode,jdbcType=VARCHAR},
|
|
|
+ #{visible,jdbcType=VARCHAR},
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
+ #{createUserId,jdbcType=VARCHAR},
|
|
|
+ #{modifyUserId,jdbcType=VARCHAR},
|
|
|
+ #{isDeleted,jdbcType=VARCHAR}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="update" parameterType="api.common.pojo.po.system.UserPO">
|
|
|
+ update system_user set
|
|
|
+ username = #{username,jdbcType=VARCHAR},
|
|
|
+ nickname = #{nickname,jdbcType=VARCHAR},
|
|
|
+ photo = #{photo,jdbcType=VARCHAR},
|
|
|
+ phone = #{phone,jdbcType=VARCHAR},
|
|
|
+ company = #{company,jdbcType=VARCHAR},
|
|
|
+ visible = #{visible,jdbcType=VARCHAR},
|
|
|
+
|
|
|
+ modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
+ modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="saveDefaultPassword" parameterType="api.common.pojo.po.system.UserPO">
|
|
|
+ update system_user set
|
|
|
+ password = #{password,jdbcType=VARCHAR},
|
|
|
+ modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
+ modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
</mapper>
|