提交 | 用户 | 时间
|
58d006
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
A |
2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
3 |
<mapper namespace="com.mandi.fendan.mapper.Fd_CompanyMapper"> |
|
4 |
<select id="getList1" parameterType="java.util.Map" resultType="com.mandi.fendan.persist.Fd_Company"> |
|
5 |
select * from ( select row_number() |
|
6 |
<choose> |
|
7 |
<when test="sort!=null and sort!='' "> |
|
8 |
over (order by ${sort} ) |
|
9 |
</when> |
|
10 |
<otherwise> |
|
11 |
over (order by companyNo asc ) |
|
12 |
</otherwise> |
|
13 |
</choose> |
|
14 |
as rownumber,* from fd_company |
|
15 |
<where> |
|
16 |
<if test="name !=null and name !=''"> |
|
17 |
( name like '%'+#{name}+'%' or hdpinyin like '%'+#{name}+'%' or pinyin like '%'+#{name}+'%') |
|
18 |
</if> |
|
19 |
</where> |
|
20 |
) as a |
|
21 |
</select> |
|
22 |
<select id="getList" parameterType="java.util.Map" resultType="com.mandi.fendan.persist.Fd_Company"> |
|
23 |
<choose> |
|
24 |
<when test="pagesize > 0 "> |
|
25 |
select top ${pagesize} * |
|
26 |
</when> |
|
27 |
<otherwise> |
|
28 |
select * |
|
29 |
</otherwise> |
|
30 |
</choose> |
|
31 |
from ( select row_number() |
|
32 |
<choose> |
|
33 |
<when test="sort!=null and sort!='' "> |
|
34 |
over (order by ${sort} ) |
|
35 |
</when> |
|
36 |
<otherwise> |
|
37 |
over (order by companyNo asc ) |
|
38 |
</otherwise> |
|
39 |
</choose> |
|
40 |
as rownumber,* from fd_company |
|
41 |
<where> |
|
42 |
<if test="name !=null and name !=''"> |
|
43 |
( name like '%'+#{name}+'%' or hdpinyin like '%'+#{name}+'%' or pinyin like '%'+#{name}+'%') |
|
44 |
</if> |
|
45 |
</where> |
|
46 |
) as a where rownumber > #{pagesize}*#{page} |
|
47 |
|
|
48 |
</select> |
|
49 |
|
|
50 |
<select id="getPages" parameterType="Map" resultType="int"> |
|
51 |
select count(1) from fd_company |
|
52 |
<where> |
|
53 |
<if test="name!=null and name !=''"> |
|
54 |
( name like '%'+#{name}+'%' or hdpinyin like '%'+#{name}+'%' or pinyin like '%'+#{name}+'%') |
|
55 |
</if> |
|
56 |
</where> |
|
57 |
</select> |
|
58 |
</mapper> |