Commit 33bab768 authored by Quxl's avatar Quxl

Merge branch 'master' of http://key@gitlab.egolm.com/key/shop.git

parents b8265ac0 87647a66
package com.egolm.shop.service;
import java.util.List;
import java.util.Map;
import com.egolm.common.jdbc.Page;
public interface PageService {
public List<Map<String, Object>> query(Map<String, Object> params);
public List<Map<String, Object>> queryIcon(Map<String, Object> params,Page page);
}
package com.egolm.shop.service;
import java.util.List;
import java.util.Map;
import com.egolm.common.jdbc.Page;
public interface PageService {
public List<Map<String, Object>> query(Map<String, Object> params);
public List<Map<String, Object>> queryIcon(Map<String, Object> params,Page page);
public List<Map<String, Object>> queryBanner(Map<String, Object> params,Page page);
public List<Map<String, Object>> queryNews(Map<String, Object> params,Page page);
}
package com.egolm.shop.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.common.jdbc.dialect.SqlServerDialect;
import com.egolm.shop.service.PageService;
@Service
public class PageServiceImpl implements PageService {
@Autowired
private JdbcTemplate jdbcTemplate;
/**
* 查询首页配置
* <p>Title: query</p>
* <p>Description: </p>
* @param params
* @return
* @see com.egolm.shop.service.PageService#query(java.util.Map)
*/
@Override
public List<Map<String, Object>> query(Map<String, Object> params) {
String sql = "SELECT sPlatformNO platformNO,sPlatformName platformName,sLogoPath1 logoPath1 ,sLogoPath2 logoPath2,sLogoPath3 logoPath3,sThemeNO themeNO,sThemeJson themeJson,sMemo memo,dLastUpdateTime lastUpdateTime "
+ " FROM tPlatformLayout " + "WHERE nTag &1=0 ORDER BY dLastUpdateTime DESC ";
jdbcTemplate.setDialect(new SqlServerDialect());
return jdbcTemplate.queryForList(sql);
}
/**
* 查询图标
* <p>Title: queryIcon</p>
* <p>Description: </p>
* @param params
* @param page
* @return
* @see com.egolm.shop.service.PageService#queryIcon(java.util.Map, com.egolm.common.jdbc.Page)
*/
@Override
public List<Map<String, Object>> queryIcon(Map<String, Object> params, Page page) {
String iconGroupNO = params.get("iconGroupNO")+"";
jdbcTemplate.setDialect(new SqlServerDialect());
String sql = " SELECT IconNO = i.sIconNO ,IconPath=i.sIconPath,DefaultTxt=i.sDefaultTxt,DefaultLinkType=i.sDefaultLinkType,DefaultLink=i.sDefaultLink "
+ " FROM tIcon i ,tIconGroup ig"
+ " WHERE i.sGroupNO = ig.sGroupNO AND ig.nTag&1=0 and ig.sGroupNO = ? ";
return jdbcTemplate.limit(sql, page, iconGroupNO);
}
}
package com.egolm.shop.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.common.jdbc.dialect.SqlServerDialect;
import com.egolm.shop.service.PageService;
@Service
public class PageServiceImpl implements PageService {
@Autowired
private JdbcTemplate jdbcTemplate;
/**
* 查询首页配置
* <p>Title: query</p>
* <p>Description: </p>
* @param params
* @return
* @see com.egolm.shop.service.PageService#query(java.util.Map)
*/
@Override
public List<Map<String, Object>> query(Map<String, Object> params) {
String sql = "SELECT sPlatformNO platformNO,sPlatformName platformName,sLogoPath1 logoPath1 ,sLogoPath2 logoPath2,sLogoPath3 logoPath3,sThemeNO themeNO,sThemeJson themeJson,sMemo memo,dLastUpdateTime lastUpdateTime "
+ " FROM tPlatformLayout " + "WHERE nTag &1=0 ORDER BY dLastUpdateTime DESC ";
jdbcTemplate.setDialect(new SqlServerDialect());
return jdbcTemplate.queryForList(sql);
}
/**
* 查询图标
* <p>Title: queryIcon</p>
* <p>Description: </p>
* @param params
* @param page
* @return
* @see com.egolm.shop.service.PageService#queryIcon(java.util.Map, com.egolm.common.jdbc.Page)
*/
@Override
public List<Map<String, Object>> queryIcon(Map<String, Object> params, Page page) {
String iconGroupNO = params.get("iconGroupNO")+"";
jdbcTemplate.setDialect(new SqlServerDialect());
String sql = " SELECT IconNO = i.sIconNO ,IconPath=i.sIconPath,DefaultTxt=i.sDefaultTxt,DefaultLinkType=i.sDefaultLinkType,DefaultLink=i.sDefaultLink "
+ " FROM tIcon i ,tIconGroup ig"
+ " WHERE i.sGroupNO = ig.sGroupNO AND ig.nTag&1=0 and ig.sGroupNO = ? ";
return jdbcTemplate.limit(sql, page, iconGroupNO);
}
/**
* 查询banner
* @Title: queryBanner
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param params
* @param @param page
* @param @return 设定文件
* @return 返回类型
* @throws
*/
public List<Map<String, Object>> queryBanner(Map<String, Object> params, Page page) {
String orgNO = params.get("orgNO")+"";
String typeID = params.get("typeID")+"";
jdbcTemplate.setDialect(new SqlServerDialect());
String sql = "SELECT BannerAdNO = b.sBannerAdNO, BannerAdTitle = b.sBannerAdTitle,OrgNO = b.sOrgNO,AdPostionTypeID = b.sAdPositionTypeID,AdPostionType = b.sAdPositionType,"
+ " LayoutTypeID = b.sLayoutTypeID,LayoutType = b.sLayoutType,JumpTypeID = b.sJumpTypeID,JumpType = b.sJumpType,JumpList = b.sJumpList,Idx = b.nIdx,ImagePath = b.sImagePath,"
+ " LinkPath = b.sLinkPath "
+ " from tBannerAd b "
+ " WHERE sOrgNO = ? AND sAdPositionTypeID =? AND b.dStartTime <=getdate() AND b.dEndTime >= getdate() AND b.nTag&2 = 2 ";
return jdbcTemplate.limit(sql, page, orgNO,typeID);
}
/**
* 查快报
* @Title: queryNews
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param params
* @param @param page
* @param @return 设定文件
* @return 返回类型
* @throws
*/
public List<Map<String, Object>> queryNews(Map<String, Object> params, Page page) {
String orgNO = params.get("orgNO")+"";
String msgTypeID = params.get("msgTypeID")+"";
jdbcTemplate.setDialect(new SqlServerDialect());
String sql = "SELECT BillBoardID = b.nBillboardID, MsgTypeID = b.sMsgTypeID,MsgType = b.sMsgType,Title = b.sTitle,Content = b.sText,Sort = b.nSort,TradeDate = b.dTradeDate"
+ " FROM tBillboard b "
+ " WHERE b.nTag&2=2 AND b.sMsgTypeID = ? ";
return jdbcTemplate.limit(sql, page, msgTypeID);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment