01 | package com.dao; |
02 |
03 | import java.util.List; |
04 | import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport; |
05 |
06 | import com.pojo.UserInfos; |
07 | @SuppressWarnings ( "unchecked" ) |
08 | public class UserDao extends SqlMapClientDaoSupport implements IUserDao { |
09 |
10 | |
11 | public List<UserInfos> findAll() { |
12 | // TODO Auto-generated method stub |
13 | |
14 | return this .getSqlMapClientTemplate().queryForList( "find_all" ); |
15 | } |
16 |
17 | public int delete( int id) { |
18 | // TODO Auto-generated method stub |
19 | |
20 | return this .getSqlMapClientTemplate().delete( "delete_userbyId" , id); |
21 | } |
22 |
23 | public int insert(UserInfos user) { |
24 | // TODO Auto-generated method stub |
25 | int a= 0 ; |
26 | this .getSqlMapClientTemplate().insert( "insert" , user); |
27 | a= 1 ; |
28 | return a; |
29 | } |
30 |
31 | public int update(UserInfos user) { |
32 | // TODO Auto-generated method stub |
33 | return this .getSqlMapClientTemplate().update( "update" , user); |
34 | } |
35 |
36 | public UserInfos query( int id) { |
37 | // TODO Auto-generated method stub |
38 | UserInfos user= null ; |
39 | user=(UserInfos) this .getSqlMapClientTemplate().queryForObject( "query" , id); |
40 | return user; |
41 | } |
42 |
43 | public List<UserInfos> findAll( int current, int maxResult) { |
44 | // TODO Auto-generated method stub |
45 | return this .getSqlMapClientTemplate().queryForList( "find_all" , (current- 1 )*maxResult, maxResult); |
46 | } |
47 | } |

HTMLProject LV1
2022年7月6日
laoKlaok LV1
2021年7月16日
艾伯特 LV2
2021年3月11日
lovemyhome LV5
2021年1月2日
freedom2017 LV14
2020年4月14日
青蛙煮水 LV1
2019年4月11日
zhai040827 LV1
2019年3月5日
爱的光荣是 LV2
2019年1月25日
msl1134 LV3
2018年11月23日
kynasln LV5
2018年11月19日