Эх сурвалжийг харах

用户在职状态增加nvl判断

chenw 6 жил өмнө
parent
commit
8cf3c1ff27

+ 5 - 5
bi-server/src/main/java/com/usoftchina/bi/server/dao/user/UserMapper.java

@@ -129,7 +129,7 @@ public interface UserMapper {
      */
     @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} AND BU_CLASS <> '离职'")
+            "FROM BI_USERS WHERE USER_NAME = #{userName} AND NVL(BU_CLASS,' ') <> '离职'")
     User getBIUserByName(@Param("userName") String userName);
 
     /**
@@ -139,7 +139,7 @@ public interface UserMapper {
      */
     @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 BU_PHONE = #{mobile} AND BU_CLASS <> '离职'")
+            "FROM BI_USERS WHERE BU_PHONE = #{mobile} AND NVL(BU_CLASS,' ') <> '离职'")
     User getBIUserByMobile(@Param("mobile") String mobile);
 
     /*
@@ -159,7 +159,7 @@ public interface UserMapper {
      */
     @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, create_date as createDate " +
-            "from bi_users WHERE BU_CLASS <> '离职' AND BU_ROLE <> 'superAdmin'")
+            "from bi_users WHERE NVL(BU_CLASS,' ') <> '离职' AND BU_ROLE <> 'superAdmin'")
     List<User> getUserList();
 
     @Select("select BU_ID as id, BU_NAME as name, BU_DEPARTMENT as department, BU_POST as post, BU_ROLE as role," +
@@ -171,7 +171,7 @@ public interface UserMapper {
     匹配用户20个
      */
     @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 ${condition} AND BU_CLASS <> '离职' AND BU_ROLE <> 'superAdmin' and rownum < #{count, jdbcType=INTEGER}")
+            "from bi_users where bu_name ${condition} AND NVL(BU_CLASS,' ') <> '离职' AND BU_ROLE <> 'superAdmin' and rownum < #{count, jdbcType=INTEGER}")
     List<User> getNameList(@Param("condition") String condition, @Param("count") Long count);
 
     /*
@@ -262,7 +262,7 @@ public interface UserMapper {
      */
     @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,bi_user_groups,bi_user_rel_groups where bi_users.bu_id=bi_user_rel_groups.br_user_id and " +
-            " bi_user_rel_groups.br_user_group=bi_user_groups.bg_id and bi_user_groups.bg_id = #{id} AND BU_CLASS <> '离职'")
+            " bi_user_rel_groups.br_user_group=bi_user_groups.bg_id and bi_user_groups.bg_id = #{id} AND NVL(BU_CLASS,' ') <> '离职'")
     List<User> getGroupUserList(int id);
 
     /*