Bläddra i källkod

chaxun补货员

wangzhinan 3 år sedan
förälder
incheckning
4beb978257

+ 11 - 9
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineUserService.java

@ -104,20 +104,22 @@ public class MedicineUserService extends BaseJpaService<Mediicineuser, Mediicine
                        "t.user_id = '" + userId + "'\n" +
                        "AND t.del = 1";
            }
            List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql);
            for (Map<String, Object> stringObjectMap : list) {
                if (stringObjectMap.get("community") != null && !StringUtils.isEmpty(stringObjectMap.get("community").toString())) {
                    if (StringUtils.isEmpty(belongCommunitys)) {
                        belongCommunitys += stringObjectMap.get("community").toString();
                    } else {
                        belongCommunitys += "," +  stringObjectMap.get("community").toString();
            if (!StringUtils.isEmpty(sql)) {
                List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql);
                for (Map<String, Object> stringObjectMap : list) {
                    if (stringObjectMap.get("community") != null && !StringUtils.isEmpty(stringObjectMap.get("community").toString())) {
                        if (StringUtils.isEmpty(belongCommunitys)) {
                            belongCommunitys += stringObjectMap.get("community").toString();
                        } else {
                            belongCommunitys += "," +  stringObjectMap.get("community").toString();
                        }
                    }
                }
            }
        }
        if (!StringUtils.isEmpty(belongCommunitys)) {
            conditionSql += "\tAND ',"+ belongCommunitys +",' LIKE CONCAT('%,',wua.hospital,',%')\n";
            conditionSql += "\tAND  b.id IN ( SELECT wua.user_id FROM wlyy_user_area wua WHERE wua.del = 1 AND ',"+ belongCommunitys +",' LIKE CONCAT('%,',wua.hospital,',%'))\n";
        }
        sql = "SELECT\n" +
                "\tb.id AS id,\n" +
@ -145,7 +147,7 @@ public class MedicineUserService extends BaseJpaService<Mediicineuser, Mediicine
                "\tb.last_login_failure_time AS lastLoginFailureTime,\n" +
                "\tb.role_id AS roleId\n" +
                "FROM\n" +
                "\tbase_user b LEFT JOIN wlyy_user_area wua on b.id = wua.user_id\n" +
                "\tbase_user b \n" +
                "WHERE\n" +
                "\tb.role_id IN (\n" +
                "\t\tSELECT\n" +