提交 | 用户 | 时间
|
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_fhdqMapper"> |
|
4 |
|
|
5 |
|
|
6 |
<select id="getlist" parameterType="java.util.Map" |
|
7 |
resultType="java.util.Map"> |
|
8 |
<choose> |
|
9 |
<!-- <when test="pagesize > 0 "> |
|
10 |
select top ${pagesize} * |
|
11 |
</when> --> |
|
12 |
<otherwise> |
|
13 |
select * |
|
14 |
</otherwise> |
|
15 |
</choose> |
|
16 |
from ( select row_number() |
|
17 |
<choose> |
|
18 |
<when test="sort!=null and sort!='' "> |
|
19 |
over (order by ${sort} ) |
|
20 |
</when> |
|
21 |
<otherwise> |
|
22 |
over (order by code asc ) |
|
23 |
</otherwise> |
|
24 |
</choose> |
|
25 |
as rownumber,* from nc_dq |
|
26 |
<where> |
|
27 |
<if test="name !=null and name !=''"> |
|
28 |
and ( name like '%'+#{name}+'%' or code like '%'+#{name}+'%' ) |
|
29 |
</if> |
|
30 |
<if test="state !=null and state !='' "> |
|
31 |
and state=#{state} |
|
32 |
</if> |
|
33 |
</where> |
|
34 |
) as a |
|
35 |
<!-- where rownumber > #{pagesize}*#{page} --> |
|
36 |
|
|
37 |
</select> |
|
38 |
|
|
39 |
<select id="count" parameterType="Map" resultType="int"> |
|
40 |
select count(1) from nc_dq |
|
41 |
<where> |
|
42 |
<if test="name !=null and name !=''"> |
|
43 |
( name like '%'+#{name}+'%' or code like '%'+#{name}+'%' ) |
|
44 |
</if> |
|
45 |
<if test="state !=null and state !='' "> |
|
46 |
and state=#{state} |
|
47 |
</if> |
|
48 |
</where> |
|
49 |
</select> |
|
50 |
</mapper> |