Browse Source

Merge branch 'medicare' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into medicare

LAPTOP-KB9HII50\70708 2 months ago
parent
commit
146bed4d44

+ 36 - 12
svr/svr-base/src/main/java/com/yihu/jw/base/service/advrtisement/AdvrtisementService.java

@ -190,6 +190,18 @@ public class AdvrtisementService extends BaseJpaService<AdvertisementPuttingAdmi
        jsonObject.put("createUser",adminDO.getCreateUser());
        jsonObject.put("updateTime",adminDO.getUpdateTime());
        jsonObject.put("updateUser",adminDO.getUpdateUser());
        jsonObject.put("publishLocation",adminDO.getPublishLocation());
        if (adminDO.getPublishLocation() != null) {
            if ("0".equals(adminDO.getPublishLocation())) {
                jsonObject.put("publishLocationName","广告位");
            } else if ("1".equals(adminDO.getPublishLocation())) {
                jsonObject.put("publishLocationName","banner位");
            } else if ("2".equals(adminDO.getPublishLocation())) {
                jsonObject.put("publishLocationName","动态列表");
            }
        }
        jsonObject.put("launchDevice",adminDO.getLaunchDevice());
        jsonObject.put("sort",adminDO.getSort());
        result.put("response", ConstantUtils.SUCCESS);
        result.put("msg","查询单条明细成功");
        result.put("obj",jsonObject);
@ -244,24 +256,24 @@ public class AdvrtisementService extends BaseJpaService<AdvertisementPuttingAdmi
        String sql = "SELECT " +
                "a.id, " +
                "a.title, " +
                "a.publish_location, " +
                "a.category_code, " +
                "a.launch_device, " +
                "a.category_name, " +
                "a.publish_location as publishLocation, " +
                "a.category_code as categoryCode, " +
                "a.launch_device as launchDevice, " +
                "a.category_name as categoryName, " +
                "a.url, " +
                "a.del, " +
                "a.launch, " +
                "a.forbidden, " +
                "a.content, " +
                "a.link_url, " +
                "a.link_url as linkUrl, " +
                "a.sort, " +
                "a.create_time, " +
                "a.create_user, " +
                "a.create_user_name, " +
                "a.update_time, " +
                "a.update_user, " +
                "a.update_user_name, " +
                "a.play_id ";
                "a.create_time as createTime, " +
                "a.create_user createUser, " +
                "a.create_user_name createUserName, " +
                "a.update_time as updateTime, " +
                "a.update_user as updateUser, " +
                "a.update_user_name as updateUserName, " +
                "a.play_id as playId ";
        String from  = "FROM " +
                "advertisement_putting_admin AS a " +
                "WHERE 1=1 ";
@ -279,6 +291,18 @@ public class AdvrtisementService extends BaseJpaService<AdvertisementPuttingAdmi
        }
        String orderBy = " ORDER BY a.sort,a.create_time limit "+(page-1)*size+","+size;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql+from+orderBy);
        for (Map<String, Object> stringObjectMap : list) {
            String publishLocationCode = stringObjectMap.get("publishLocation").toString();
            if (publishLocationCode != null) {
                if ("0".equals(publishLocationCode)) {
                    stringObjectMap.put("publishLocationName","广告位");
                } else if ("1".equals(publishLocationCode)) {
                    stringObjectMap.put("publishLocationName","banner位");
                } else if ("2".equals(publishLocationCode)) {
                    stringObjectMap.put("publishLocationName","动态列表");
                }
            }
        }
        Long count = jdbcTemplate.queryForObject(countSql+from,Long.class);
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,size,count);
    }