hjg
2024-03-18 8d48c59d5d3bcc4148ef97dc6f98e3a8cf9ca436
提交 | 用户 | 时间
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_GbxstdMapper">
4     <select id="counts" parameterType="Map" resultType="int">
5         select count(1) from gbxstd_view a
6         <where>
7             <if test="companyNo !=null and companyNo !=''">
8                 EXISTS ( SELECT 1 from fd_company_ywdy b where a.td_ywdybh=b.ywdyNo and b.companyNo=#{companyNo} )
9                 <choose>
10                     <when test="ztbz==0">
11                         and EXISTS (SELECT 1 from fd_wlgs_fhdq b  
12                         LEFT JOIN nc_dq c on b.fhdqNo=c.code
13                          where c.code=a.td_shddbh and b.wlgsNo=#{companyNo} AND a.td_ztbz!='自提'
14                         <!-- <if test='cqV &gt;= 0'>    
15                             <choose>
16                                 <when test="cqV==0">
17                                     and b.ywdyNo!='102'
18                                 </when>
19                                 <otherwise>
20                                     and b.ywdyNo='102'
21                                 </otherwise>
22                             </choose>
23                         </if> -->
24                         ) 
25                     </when>
26                     <otherwise>
27                         and a.td_ztbz='自提'
28                     </otherwise>
29                 </choose>
30             </if> 
31             <if test="stime !=null ">
32                 and a.td_gbsj>=#{stime}+' 00:00:00' 
33             </if>
34             <if test="etime !=null ">
35                 and a.td_gbsj &lt;= #{etime}+' 23:59:59'
36             </if>
37             <if test="tdbh !=null and tdbh !='' ">
38                 and a.td_tdbh like '%'+#{tdbh}+'%' 
39             </if>
40             <if test="khmc !=null and khmc !='' ">
41                 and ( a.td_khmc like '%'+#{khmc}+'%')
42             </if>
43             <if test="shdd !=null and shdd !='' ">
44                 and a.td_shdd = #{shdd}
45             </if>
46             <if test="zdbm !=null and zdbm !='' ">
47                 and ( a.td_bmmc like '%'+#{zdbm}+'%')
48             </if>
49             <if test="fpbh !=null and fpbh !='' ">
50                 and ( a.td_fpbh like '%'+#{fpbh}+'%')
51             </if>
52             <if test="zdr !=null and zdr !='' ">
53                 and ( a.td_zdr like '%'+#{zdr}+'%')
54             </if>
55         </where>
56     </select>
57     
58     <select id="getList" parameterType="java.util.Map" resultType="java.util.Map">
59             <choose>
60             <when test="pagesize &gt; 0 ">
61                 select top ${pagesize} *
62             </when>
63             <otherwise>
64                 select *
65             </otherwise>
66         </choose>
67         from ( select row_number()
68         <choose>
69             <when test="sort!=null and sort!='' ">
70                 over (order by ${sort} )
71             </when>
72             <otherwise>
73                 over (order by a.td_gbsj desc )
74             </otherwise>
75         </choose>
76         as rownumber,a.* from gbxstd_view a 
77         <where>
78             <if test="companyNo !=null and companyNo !=''">
79                 EXISTS ( SELECT 1 from fd_company_ywdy b where a.td_ywdybh=b.ywdyNo and b.companyNo=#{companyNo} )
80                 <choose>
81                     <when test="ztbz==0">
82                         and EXISTS (SELECT 1 from fd_wlgs_fhdq b  LEFT JOIN nc_dq c on b.fhdqNo=c.code where c.code=a.td_shddbh and b.wlgsNo=#{companyNo} AND a.td_ztbz!='自提'
83                         <!-- <if test='cqV &gt;= 0'>    
84                             <choose>
85                                 <when test="cqV==0">
86                                     and b.ywdyNo!='102'
87                                 </when>
88                                 <otherwise>
89                                     and b.ywdyNo='102'
90                                 </otherwise>
91                             </choose>
92                         </if> -->
93                         ) 
94                     </when>
95                     <otherwise>
96                         and a.td_ztbz='自提'
97                     </otherwise>
98                 </choose>
99             </if> 
100             <if test="stime !=null ">
101                 and a.td_gbsj>=#{stime}+' 00:00:00' 
102             </if>
103             <if test="etime !=null ">
104                 and a.td_gbsj &lt;= #{etime}+' 23:59:59'
105             </if>
106             <if test="tdbh !=null and tdbh !='' ">
107                 and a.td_tdbh like '%'+#{tdbh}+'%' 
108             </if>
109             <if test="khmc !=null and khmc !='' ">
110                 and ( a.td_khmc like '%'+#{khmc}+'%')
111             </if>
112             <if test="shdd !=null and shdd !='' ">
113                 and a.td_shdd = #{shdd}
114             </if>
115             <if test="zdbm !=null and zdbm !='' ">
116                 and ( a.td_bmmc like '%'+#{zdbm}+'%')
117             </if>
118             <if test="fpbh !=null and fpbh !='' ">
119                 and ( a.td_fpbh like '%'+#{fpbh}+'%')
120             </if>
121             <if test="zdr !=null and zdr !='' ">
122                 and ( a.td_zdr like '%'+#{zdr}+'%')
123             </if>
124         </where>
125         ) as a where rownumber > #{pagesize}*#{page} order by a.rownumber asc 
126     </select>
127 </mapper>