|
@@ -86,6 +86,18 @@ public class AdvertiseImplDao implements AdvertiseDao {
|
|
|
return num;
|
|
return num;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 查询已开启的广告
|
|
|
|
|
+ public List<Advertise> queryOpenAdvertise(){
|
|
|
|
|
+ String sql = "select * from `advertise` where jump_way='小程序' and `state`=1 ";
|
|
|
|
|
+ MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
|
|
+ List<Advertise> list = namedParameterJdbcTemplate.query(sql, sps,
|
|
|
|
|
+ new BeanPropertyRowMapper<>(Advertise.class));
|
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
|
+ return list;
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public Advertise queryById(int id){
|
|
public Advertise queryById(int id){
|
|
|
String sql = "select * from `advertise` where id=:id ";
|
|
String sql = "select * from `advertise` where id=:id ";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|