CNGStationNew.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. Copyright 2009-2012 the original author or authors.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. -->
  14. <!DOCTYPE mapper
  15. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  16. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  17. <mapper namespace="com.runzhixing.dao.interf.CNGStationInterface">
  18. <!-- 结果集 -->
  19. <!-- 查询指定加气站时,需要级联查询该加气站的所有信息(加气机列表、工作人员列表和加气站传输信息) -->
  20. <resultMap id="stationALL" type="com.runzhixing.bean.CNGStation">
  21. <result property="id" column="STATIONNO"/>
  22. <result property="name" column="STATIONNAME"/>
  23. <result property="placeAB" column="STATIONAB"/>
  24. <result property="licence" column="LICENCE"/>
  25. <result property="licenceOrg" column="LICENCEORG"/>
  26. <result property="licenceDate" column="LICENCEDATE"/>
  27. <result property="validity" column="VALIDITY"/>
  28. <result property="stationAddr" column="STATIONADDR"/>
  29. <result property="manager" column="MANAGER"/>
  30. <result property="techManager" column="TECHMANA"/>
  31. <result property="phone" column="PHONE"/>
  32. <result property="mobile" column="MOBILE"/>
  33. <result property="fax" column="FAX"/>
  34. <result property="addr" column="ADDR"/>
  35. <result property="post" column="POST"/>
  36. <result property="remark" column="REMARK"/>
  37. </resultMap>
  38. <resultMap id="selectALL" type="com.runzhixing.bean.SelectALL">
  39. <result property="id" column="id"/>
  40. <result property="name" column="name"/>
  41. </resultMap>
  42. <!-- sql配置文件 -->
  43. <!-- 查询指定加气站-->
  44. <select id="getCNGStation" parameterType="com.runzhixing.util.bean.ConditionParameter" resultMap="stationALL">
  45. select
  46. STATIONNO,
  47. STATIONNAME,
  48. STATIONAB,
  49. LICENCE,
  50. LICENCEORG,
  51. LICENCEDATE,
  52. VALIDITY,
  53. STATIONADDR,
  54. MANAGER,
  55. TECHMANA,
  56. PHONE,
  57. MOBILE,
  58. FAX,
  59. ADDR,
  60. POST,
  61. REMARK
  62. from tb_cngstation t
  63. <where>
  64. <if test="cpstring1 != null and !&quot;&quot;.equals(cpstring1.trim())">
  65. and t.stationno like '' || #{cpstring1} || '%'
  66. </if>
  67. </where>
  68. </select>
  69. <select id="selectALL" parameterType="com.runzhixing.util.bean.ConditionParameter" resultMap="selectALL">
  70. (select
  71. STATIONNO as id,
  72. STATIONNAME as name
  73. from tb_cngstation t
  74. <where>
  75. <if test="cpstring1 != null and !&quot;&quot;.equals(cpstring1.trim())">
  76. and t.stationno like '' || #{cpstring1} || '%'
  77. </if>
  78. </where>
  79. )
  80. UNION ALL
  81. (
  82. select
  83. STATIONNO as id,
  84. STATIONNAME as name
  85. from tb_checkstation t1
  86. <where>
  87. <if test="cpstring1 != null and !&quot;&quot;.equals(cpstring1.trim())">
  88. and t1.stationno like '%' || #{cpstring1} || '%'
  89. </if>
  90. </where>
  91. )
  92. UNION ALL
  93. (
  94. select
  95. STATIONNO as id,
  96. STATIONNAME as name
  97. from tb_installstation t2
  98. <where>
  99. <if test="cpstring1 != null and !&quot;&quot;.equals(cpstring1.trim())">
  100. and t2.stationno like '%' || #{cpstring1} || '%'
  101. </if>
  102. </where>
  103. )
  104. </select>
  105. <select id="getStationListByType" resultType="com.runzhixing.bean.HiddenCoutry">
  106. select
  107. STATIONNO as id,
  108. STATIONNAME as name
  109. from tb_cngstation
  110. <where>
  111. <if test="regionNo != null and !&quot;&quot;.equals(regionNo.trim())">
  112. and STATIONNO like '' || #{regionNo} || '%'
  113. </if>
  114. <if test="type != null">
  115. and MEDIA = #{type}
  116. </if>
  117. </where>
  118. </select>
  119. </mapper>