LiveDaoImpl.java
1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.bjivt.dao.showtime.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.bjivt.base.dao.impl.BaseDaoImpl;
import com.bjivt.dao.showtime.LiveDao;
import com.bjivt.entity.showtime.Live;
import com.bjivt.util.Pager;
@Component
public class LiveDaoImpl extends BaseDaoImpl<Live, Integer> implements LiveDao{
@Autowired(required = true)
protected SqlSession sqlSessionTemplate;
@Override
public List<Live> findStarLiveListByPage(Map<String, Object> map) {
return this.getSqlSession().selectList(getSqlName("findStarLiveListByPage"), map);
}
@Override
public int getStarLiveCountBy(Live live) {
return this.getSqlSession().selectOne(getSqlName("getStarLiveCountBy"), live);
}
public String getExecuteSql(String execName, Object obj){
BoundSql boundSql = sqlSessionTemplate.getConfiguration()
.getMappedStatement(execName).getBoundSql(obj);
// String[] sqls = boundSql.getSql().split(";");
String sqls = boundSql.getSql();
System.out.println(sqls);
return sqls;
}
@Override
public List<Live> findLiveListByPage(Map<String, Object> map) {
return this.getSqlSession().selectList(getSqlName("findLiveListByPage"), map);
}
}