|
@@ -11,11 +11,47 @@ import java.util.List;
|
|
|
@Repository
|
|
@Repository
|
|
|
public interface UserMapper {
|
|
public interface UserMapper {
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取表记录数
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @Select("SELECT COUNT(*) FROM bi_users")
|
|
|
|
|
+ int getCount();
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询UAS的人员资料表数据
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @Select("SELECT EM_DEFAULTHSNAME as department, EM_TYPE role, EM_DEPART as post, EM_NAME as name, EM_PASSWORD as passWord, "
|
|
|
|
|
+ + "EM_MOBILE as phone, EM_CODE as userName,EM_CLASS AS state FROM EMPLOYEE")
|
|
|
|
|
+ List<User> getUASEmployee();
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 批量插入人员资料
|
|
|
|
|
+ * @param userList
|
|
|
|
|
+ */
|
|
|
|
|
+ @Insert("<script"
|
|
|
|
|
+ + "INSERT INTO BI_USERS(BU_ID, BU_NAME, BU_POST, USER_NAME, PASS_WORD, BU_DEPARTMENT, CREATE_DATE) "
|
|
|
|
|
+ + "SELECT BI_USERS_SEQ.NEXTVAL,M.* FROM ("
|
|
|
|
|
+ + "<foreach collection=\"list\" item=\"item\" index=\"index\" separator=\"UNION ALL\">"
|
|
|
|
|
+ + "SELECT "
|
|
|
|
|
+ + "#{name, jdbcType=VARCHAR},"
|
|
|
|
|
+ + "#{post, jdbcType=VARCHAR},"
|
|
|
|
|
+ + "#{userName, jdbcType=VARCHAR},"
|
|
|
|
|
+ + "#{passWord, jdbcType=VARCHAR},"
|
|
|
|
|
+ + "#{department, jdbcType=VARCHAR},"
|
|
|
|
|
+ + "SYSDATE"
|
|
|
|
|
+ + "FROM DUAL"
|
|
|
|
|
+ + "</foreach>"
|
|
|
|
|
+ + ")M"
|
|
|
|
|
+ + "</script>")
|
|
|
|
|
+ void batchInsert(@Param("list") List<User> userList);
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
新增一条用户数据
|
|
新增一条用户数据
|
|
|
*/
|
|
*/
|
|
|
- @Insert("insert into bi_users(bu_id, bu_name, BU_POST, USER_NAME, PASS_WORD, BU_DEPARTMENT, CREATE_DATE) values" +
|
|
|
|
|
- "(#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{post,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{passWord,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR}, to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'))")
|
|
|
|
|
|
|
+ @Insert("insert into bi_users(bu_id, bu_name, BU_POST, USER_NAME, PASS_WORD, BU_DEPARTMENT, CREATE_DATE,BU_PHONE) values" +
|
|
|
|
|
+ "(#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{post,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{passWord,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR}, to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'), #{phone, jdbcType=VARCHAR})")
|
|
|
@SelectKey(before=true,keyProperty="id",resultType=int.class,statement="SELECT bi_users_sequence.nextval from dual",keyColumn = "bu_id")
|
|
@SelectKey(before=true,keyProperty="id",resultType=int.class,statement="SELECT bi_users_sequence.nextval from dual",keyColumn = "bu_id")
|
|
|
void addUser(User user);
|
|
void addUser(User user);
|
|
|
|
|
|
|
@@ -30,6 +66,7 @@ public interface UserMapper {
|
|
|
" <if test=\"post != null\">BU_POST = #{post,jdbcType=VARCHAR}, </if>" +
|
|
" <if test=\"post != null\">BU_POST = #{post,jdbcType=VARCHAR}, </if>" +
|
|
|
" <if test=\"department != null\">BU_DEPARTMENT = #{department,jdbcType=VARCHAR}, </if>" +
|
|
" <if test=\"department != null\">BU_DEPARTMENT = #{department,jdbcType=VARCHAR}, </if>" +
|
|
|
" <if test=\"role != null\">BU_ROLE = #{role,jdbcType=VARCHAR}, </if>" +
|
|
" <if test=\"role != null\">BU_ROLE = #{role,jdbcType=VARCHAR}, </if>" +
|
|
|
|
|
+ " <if test=\"phone != null\">BU_ROLE = #{BU_PHONE,jdbcType=VARCHAR}, </if>" +
|
|
|
" updata_date = to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss')" +
|
|
" updata_date = to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss')" +
|
|
|
" where bu_id = #{id,jdbcType=INTEGER}" +
|
|
" where bu_id = #{id,jdbcType=INTEGER}" +
|
|
|
" </script>")
|
|
" </script>")
|
|
@@ -50,16 +87,16 @@ public interface UserMapper {
|
|
|
/*
|
|
/*
|
|
|
查询uas用户信息
|
|
查询uas用户信息
|
|
|
*/
|
|
*/
|
|
|
- @Select("select EM_DEFAULTHSNAME as department, EM_DEPART as post, EM_NAME as name, em_password as passWord," +
|
|
|
|
|
- " em_mobile as phone, em_code as userName from EMPLOYEE where ${column} = #{userName}")
|
|
|
|
|
- User getUserMess(@Param("userName") String userName, @Param("column") String column);
|
|
|
|
|
|
|
+ @Select("SELECT EM_DEFAULTHSNAME as department, EM_DEPART as post,EM_TYPE as role, EM_NAME as name, EM_PASSWORD as passWord," +
|
|
|
|
|
+ " EM_MOBILE as phone, EM_CODE as userName,EM_CLASS AS state FROM EMPLOYEE where EM_MOBILE = #{userName} OR EM_CODE = #{userName}")
|
|
|
|
|
+ User getUserMess(@Param("userName") String userName);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
获取用户信息
|
|
获取用户信息
|
|
|
*/
|
|
*/
|
|
|
- @Select("select BU_ID as id, BU_NAME as name, BU_DEPARTMENT as department, BU_POST as post, BU_ROLE as role," +
|
|
|
|
|
- " user_name as userName, pass_word as passWord " +
|
|
|
|
|
- "from bi_users where user_name = #{userName}")
|
|
|
|
|
|
|
+ @Select("SELECT BU_ID as id, BU_NAME as name, BU_DEPARTMENT as department, BU_POST as post, BU_ROLE as role," +
|
|
|
|
|
+ " USER_NAME as userName, PASS_WORD as passWord, BU_PHONE as phone, BU_CLASS as state " +
|
|
|
|
|
+ "FROM BI_USERS WHERE USER_NAME = #{userName} OR BU_PHONE = #{userName}")
|
|
|
User getLogin(String userName);
|
|
User getLogin(String userName);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -91,8 +128,8 @@ public interface UserMapper {
|
|
|
匹配用户20个
|
|
匹配用户20个
|
|
|
*/
|
|
*/
|
|
|
@Select("select BU_ID as id, BU_NAME as name, BU_DEPARTMENT as department, BU_POST as post, BU_ROLE as role " +
|
|
@Select("select BU_ID as id, BU_NAME as name, BU_DEPARTMENT as department, BU_POST as post, BU_ROLE as role " +
|
|
|
- "from bi_users where bu_name ${value} and rownum<21")
|
|
|
|
|
- List<User> getNameList(String value);
|
|
|
|
|
|
|
+ "from bi_users where bu_name ${condition} and rownum < #{count, jdbcType=INTEGER}")
|
|
|
|
|
+ List<User> getNameList(@Param("condition") String condition, @Param("count") Long count);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
更新token
|
|
更新token
|