<select id="queryHotelOrderAllInfoPage" parameterMap="queryAllParamMap" resultType="java.lang.Integer" >
SELECT COUNT(*) FROM (
select pch.*,pc.chn_name,pc.class_code_descr, pc.national_code_descr
from pkg_ctshkhotel_hotelorder pch
left join (select distinct hotel_code,chn_name,class_code,class_code_descr,national_code,national_code_descr from PKG_CTSHKHOTELPRICE ) pc
on pch.hkhotelcd=pc.hotel_code and pch.hkhotelroomkind=pc.class_code and pch.hkhotelpricekind=pc.national_code
<where>
<if test="hotelTxnState != '' and hotelTxnState != null">pch.hoteltxnstate=#{hotelTxnState}</if>
<if test="ordercd != '' and ordercd != null">and pch.ordercd like CONCAT(CONCAT('%', #{ordercd}),'%')</if>
<if test="chnName != '' and chnName != null">and pc.chn_name like CONCAT(CONCAT('%', #{chnName}),'%')</if>
<if test="checkindate != null"><![CDATA[and pch.checkindate >= #{checkindate}]]> </if>
<if test="checkoutdate != null"><![CDATA[and pch.checkoutdate <= #{checkoutdate}]]> </if>
<if test="transactionNo != '' and transactionNo != null">
and pch.id in (select orderid from pkg_ctshkhotel_hoteltrace where transactionno like CONCAT(CONCAT('%', #{transactionNo}),'%')
</if>
</where>
order by pch.id desc) t
</select>
调用方式如下: