TAddressMapper.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.shipping.mapper.TAddressMapper">
  6. <resultMap type="TAddress" id="TAddressResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fTypes" column="f_types"/>
  9. <result property="fNo" column="f_no"/>
  10. <result property="fName" column="f_name"/>
  11. <result property="fEname" column="f_ename"/>
  12. <result property="fLaneid" column="f_laneid"/>
  13. <result property="fPortid" column="f_portid"/>
  14. <result property="fCountry" column="f_country"/>
  15. <result property="fProvince" column="f_province"/>
  16. <result property="fCity" column="f_city"/>
  17. <result property="fTel" column="f_tel"/>
  18. <result property="fEmail" column="f_email"/>
  19. <result property="fManagerid" column="f_managerid"/>
  20. <result property="fUncode" column="f_uncode"/>
  21. <result property="fPort" column="f_port"/>
  22. <result property="fStatus" column="f_status"/>
  23. <result property="createBy" column="create_by"/>
  24. <result property="createTime" column="create_time"/>
  25. <result property="updateBy" column="update_by"/>
  26. <result property="updateTime" column="update_time"/>
  27. <result property="remark" column="remark"/>
  28. </resultMap>
  29. <sql id="selectTAddressVo">
  30. select f_id, f_types, f_no, f_name, f_ename, f_laneid, f_portid, f_country, f_province, f_city, f_tel, f_email, f_managerid, f_uncode, f_port, case when f_status = 'T' then '正常' else '停用' end as f_status, create_by, create_time, update_by, update_time, remark from t_address
  31. </sql>
  32. <select id="selectTAddressList" parameterType="TAddress" resultMap="TAddressResult">
  33. SELECT
  34. t.f_id,
  35. t.f_types,
  36. t.f_no,
  37. t.f_name,
  38. t.f_ename,
  39. t.f_laneid,
  40. t.f_portid,
  41. t.f_country,
  42. t.f_province,
  43. t.f_city,
  44. t.f_tel,
  45. t.f_email,
  46. t.f_managerid,
  47. su.user_name managerName,
  48. t.f_uncode,
  49. t.f_port,
  50. CASE
  51. WHEN t.f_status = 'T' THEN
  52. '正常' ELSE '停用'
  53. END AS f_status,
  54. t.create_by,
  55. t.create_time,
  56. t.update_by,
  57. t.update_time,
  58. t.remark
  59. FROM
  60. t_address t
  61. LEFT JOIN ( SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'f_types' ) s ON t.f_types =
  62. s.dict_value
  63. LEFT JOIN sys_user su ON su.user_id = t.f_managerid
  64. WHERE
  65. t.f_status = 'T'
  66. AND s.dict_label = '航线'
  67. <if test="fTypes != null and fTypes != ''">and t.f_types = #{fTypes}</if>
  68. <if test="fNo != null and fNo != ''">and t.f_no = #{fNo}</if>
  69. <if test="fName != null and fName != ''">and t.f_name like concat('%', #{fName}, '%')</if>
  70. <if test="fEname != null and fEname != ''">and t.f_ename like concat('%', #{fEname}, '%')</if>
  71. <if test="fLaneid != null ">and t.f_laneid = #{fLaneid}</if>
  72. <if test="fPortid != null ">and t.f_portid = #{fPortid}</if>
  73. <if test="fCountry != null and fCountry != ''">and t.f_country = #{fCountry}</if>
  74. <if test="fProvince != null and fProvince != ''">and t.f_province = #{fProvince}</if>
  75. <if test="fCity != null and fCity != ''">and t.f_city = #{fCity}</if>
  76. <if test="fTel != null and fTel != ''">and t.f_tel = #{fTel}</if>
  77. <if test="fEmail != null and fEmail != ''">and t.f_email = #{fEmail}</if>
  78. <if test="fManagerid != null ">and t.f_managerid = #{fManagerid}</if>
  79. <if test="fUncode != null and fUncode != ''">and t.f_uncode = #{fUncode}</if>
  80. <if test="fPort != null and fPort != ''">and t.f_port = #{fPort}</if>
  81. <if test="fStatus != null and fStatus != ''">and t.f_status = #{fStatus}</if>
  82. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  83. and t.create_time &gt;= #{cLoadDate[0]}
  84. </if>
  85. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  86. and t.create_time &lt;= #{cLoadDate[1]}
  87. </if>
  88. ORDER BY CONVERT(t.f_name USING gbk) asc
  89. </select>
  90. <select id="selectCarriageList" parameterType="TAddress" resultMap="TAddressResult">
  91. SELECT
  92. t.f_id,
  93. t.f_types,
  94. t.f_no,
  95. t.f_name,
  96. t.f_ename,
  97. t.f_laneid,
  98. t.f_portid,
  99. t.f_country,
  100. t.f_province,
  101. t.f_city,
  102. t.f_tel,
  103. t.f_email,
  104. t.f_managerid,
  105. su.user_name managerName,
  106. t.f_uncode,
  107. t.f_port,
  108. CASE
  109. WHEN t.f_status = 'T' THEN
  110. '正常' ELSE '停用'
  111. END AS f_status,
  112. t.create_by,
  113. t.create_time,
  114. t.update_by,
  115. t.update_time,
  116. t.remark
  117. FROM
  118. t_address t
  119. LEFT JOIN ( SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'f_types' ) s ON t.f_types =
  120. s.dict_value
  121. LEFT JOIN sys_user su ON su.user_id = t.f_managerid
  122. WHERE
  123. t.f_status = 'T'
  124. AND s.dict_label = '运输'
  125. <if test="fTypes != null and fTypes != ''">and t.f_types = #{fTypes}</if>
  126. <if test="fNo != null and fNo != ''">and t.f_no = #{fNo}</if>
  127. <if test="fName != null and fName != ''">and t.f_name like concat('%', #{fName}, '%')</if>
  128. <if test="fEname != null and fEname != ''">and t.f_ename like concat('%', #{fEname}, '%')</if>
  129. <if test="fLaneid != null ">and t.f_laneid = #{fLaneid}</if>
  130. <if test="fPortid != null ">and t.f_portid = #{fPortid}</if>
  131. <if test="fCountry != null and fCountry != ''">and t.f_country = #{fCountry}</if>
  132. <if test="fProvince != null and fProvince != ''">and t.f_province = #{fProvince}</if>
  133. <if test="fCity != null and fCity != ''">and t.f_city = #{fCity}</if>
  134. <if test="fTel != null and fTel != ''">and t.f_tel = #{fTel}</if>
  135. <if test="fEmail != null and fEmail != ''">and t.f_email = #{fEmail}</if>
  136. <if test="fManagerid != null ">and t.f_managerid = #{fManagerid}</if>
  137. <if test="fUncode != null and fUncode != ''">and t.f_uncode = #{fUncode}</if>
  138. <if test="fPort != null and fPort != ''">and t.f_port = #{fPort}</if>
  139. <if test="fStatus != null and fStatus != ''">and t.f_status = #{fStatus}</if>
  140. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  141. and t.create_time &gt;= #{cLoadDate[0]}
  142. </if>
  143. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  144. and t.create_time &lt;= #{cLoadDate[1]}
  145. </if>
  146. ORDER BY CONVERT(t.f_name USING gbk) asc
  147. </select>
  148. <select id="selectTAddressBasicList" parameterType="TAddress" resultMap="TAddressResult">
  149. select f_id, f_types, f_no, f_name from t_address
  150. <where>
  151. <if test="fTypes != null and fTypes != ''"> and f_types = #{fTypes}</if>
  152. <if test="fNo != null and fNo != ''"> and f_no = #{fNo}</if>
  153. <if test="fName != null and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
  154. <if test="fEname != null and fEname != ''"> and f_ename like concat('%', #{fEname}, '%')</if>
  155. <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
  156. <if test="fPortid != null "> and f_portid = #{fPortid}</if>
  157. <if test="fCountry != null and fCountry != ''"> and f_country = #{fCountry}</if>
  158. <if test="fProvince != null and fProvince != ''"> and f_province = #{fProvince}</if>
  159. <if test="fCity != null and fCity != ''"> and f_city = #{fCity}</if>
  160. <if test="fTel != null and fTel != ''"> and f_tel = #{fTel}</if>
  161. <if test="fEmail != null and fEmail != ''"> and f_email = #{fEmail}</if>
  162. <if test="fManagerid != null "> and f_managerid = #{fManagerid}</if>
  163. <if test="fUncode != null and fUncode != ''"> and f_uncode = #{fUncode}</if>
  164. <if test="fPort != null and fPort != ''"> and f_port = #{fPort}</if>
  165. <if test="fStatus != null and fStatus != ''"> and f_status = #{fStatus}</if>
  166. </where>
  167. </select>
  168. <select id="selectTAddressById" parameterType="Long" resultMap="TAddressResult">
  169. <include refid="selectTAddressVo"/>
  170. where f_id = #{fId}
  171. </select>
  172. <select id="selectTAddressByfName" parameterType="object" resultType="long">
  173. SELECT
  174. f_id
  175. FROM
  176. t_address
  177. WHERE f_name = #{fNam}
  178. </select>
  179. <select id="selectTAddressListMap" resultType="java.util.Map">
  180. <where>
  181. <if test="fTypes != null and fTypes != ''">and f_types = #{fTypes}</if>
  182. <if test="fNo != null and fNo != ''">and f_no = #{fNo}</if>
  183. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  184. <if test="fEname != null and fEname != ''">and f_ename like concat('%', #{fEname}, '%')</if>
  185. <if test="fLaneid != null ">and f_laneid = #{fLaneid}</if>
  186. <if test="fPortid != null ">and f_portid = #{fPortid}</if>
  187. <if test="fCountry != null and fCountry != ''">and f_country = #{fCountry}</if>
  188. <if test="fProvince != null and fProvince != ''">and f_province = #{fProvince}</if>
  189. <if test="fCity != null and fCity != ''">and f_city = #{fCity}</if>
  190. <if test="fTel != null and fTel != ''">and f_tel = #{fTel}</if>
  191. <if test="fEmail != null and fEmail != ''">and f_email = #{fEmail}</if>
  192. <if test="fManagerid != null ">and f_managerid = #{fManagerid}</if>
  193. <if test="fUncode != null and fUncode != ''">and f_uncode = #{fUncode}</if>
  194. <if test="fPort != null and fPort != ''">and f_port = #{fPort}</if>
  195. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  196. </where>
  197. </select>
  198. <insert id="insertTAddress" parameterType="TAddress">
  199. insert into t_address
  200. <trim prefix="(" suffix=")" suffixOverrides=",">
  201. <if test="fId != null">f_id,</if>
  202. <if test="fTypes != null and fTypes != ''">f_types,</if>
  203. <if test="fNo != null and fNo != ''">f_no,</if>
  204. <if test="fName != null">f_name,</if>
  205. <if test="fEname != null">f_ename,</if>
  206. <if test="fLaneid != null">f_laneid,</if>
  207. <if test="fPortid != null">f_portid,</if>
  208. <if test="fCountry != null">f_country,</if>
  209. <if test="fProvince != null">f_province,</if>
  210. <if test="fCity != null">f_city,</if>
  211. <if test="fTel != null">f_tel,</if>
  212. <if test="fEmail != null">f_email,</if>
  213. <if test="fManagerid != null">f_managerid,</if>
  214. <if test="fUncode != null">f_uncode,</if>
  215. <if test="fPort != null">f_port,</if>
  216. <if test="fStatus != null">f_status,</if>
  217. <if test="createBy != null">create_by,</if>
  218. <if test="createTime != null">create_time,</if>
  219. <if test="updateBy != null">update_by,</if>
  220. <if test="updateTime != null">update_time,</if>
  221. <if test="remark != null">remark,</if>
  222. </trim>
  223. <trim prefix="values (" suffix=")" suffixOverrides=",">
  224. <if test="fId != null">#{fId},</if>
  225. <if test="fTypes != null and fTypes != ''">#{fTypes},</if>
  226. <if test="fNo != null and fNo != ''">#{fNo},</if>
  227. <if test="fName != null">#{fName},</if>
  228. <if test="fEname != null">#{fEname},</if>
  229. <if test="fLaneid != null">#{fLaneid},</if>
  230. <if test="fPortid != null">#{fPortid},</if>
  231. <if test="fCountry != null">#{fCountry},</if>
  232. <if test="fProvince != null">#{fProvince},</if>
  233. <if test="fCity != null">#{fCity},</if>
  234. <if test="fTel != null">#{fTel},</if>
  235. <if test="fEmail != null">#{fEmail},</if>
  236. <if test="fManagerid != null">#{fManagerid},</if>
  237. <if test="fUncode != null">#{fUncode},</if>
  238. <if test="fPort != null">#{fPort},</if>
  239. <if test="fStatus != null">#{fStatus},</if>
  240. <if test="createBy != null">#{createBy},</if>
  241. <if test="createTime != null">#{createTime},</if>
  242. <if test="updateBy != null">#{updateBy},</if>
  243. <if test="updateTime != null">#{updateTime},</if>
  244. <if test="remark != null">#{remark},</if>
  245. </trim>
  246. </insert>
  247. <update id="updateTAddress" parameterType="TAddress">
  248. update t_address
  249. <trim prefix="SET" suffixOverrides=",">
  250. <if test="fTypes != null and fTypes != ''">f_types = #{fTypes},</if>
  251. <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
  252. <if test="fName != null">f_name = #{fName},</if>
  253. <if test="fEname != null">f_ename = #{fEname},</if>
  254. <if test="fLaneid != null">f_laneid = #{fLaneid},</if>
  255. <if test="fPortid != null">f_portid = #{fPortid},</if>
  256. <if test="fCountry != null">f_country = #{fCountry},</if>
  257. <if test="fProvince != null">f_province = #{fProvince},</if>
  258. <if test="fCity != null">f_city = #{fCity},</if>
  259. <if test="fTel != null">f_tel = #{fTel},</if>
  260. <if test="fEmail != null">f_email = #{fEmail},</if>
  261. <if test="fManagerid != null">f_managerid = #{fManagerid},</if>
  262. <if test="fUncode != null">f_uncode = #{fUncode},</if>
  263. <if test="fPort != null">f_port = #{fPort},</if>
  264. <if test="fStatus != null">f_status = #{fStatus},</if>
  265. <if test="createBy != null">create_by = #{createBy},</if>
  266. <if test="createTime != null">create_time = #{createTime},</if>
  267. <if test="updateBy != null">update_by = #{updateBy},</if>
  268. <if test="updateTime != null">update_time = #{updateTime},</if>
  269. <if test="remark != null">remark = #{remark},</if>
  270. </trim>
  271. where f_id = #{fId}
  272. </update>
  273. <delete id="deleteTAddressById" parameterType="Long">
  274. delete from t_address where f_id = #{fId}
  275. </delete>
  276. <delete id="deleteTAddressByIds" parameterType="String">
  277. delete from t_address where f_id in
  278. <foreach item="fId" collection="array" open="(" separator="," close=")">
  279. #{fId}
  280. </foreach>
  281. </delete>
  282. <!--批量更新数据状态-->
  283. <update id="updateTAddressStatus" parameterType="string">
  284. update t_address
  285. set f_status = 'F'
  286. where f_id in
  287. <foreach item="fId" collection="array" open="(" separator="," close=")">
  288. #{fId}
  289. </foreach>
  290. </update>
  291. <!--查询堆场信息-->
  292. <select id="selectStockDump" parameterType="TAddress" resultMap="TAddressResult">
  293. SELECT
  294. t.f_id,
  295. t.f_types,
  296. pro.dict_label a,
  297. t.f_no,
  298. t.f_name,
  299. t.f_ename,
  300. t.f_laneid,
  301. t.f_portid,
  302. t.f_country,
  303. t.f_province,
  304. t.f_city,
  305. t.f_tel,
  306. t.f_email,
  307. t.f_managerid,
  308. t.f_uncode,
  309. t.f_port,
  310. pros.dict_label b,
  311. CASE
  312. WHEN t.f_status = 'T' THEN
  313. '正常使用' ELSE '停用'
  314. END AS f_status,
  315. t.create_by,
  316. t.create_time,
  317. t.update_by,
  318. t.update_time,
  319. t.remark,
  320. d.f_name portName,
  321. d.f_ename portEnglish
  322. FROM
  323. t_address t
  324. LEFT JOIN t_address d ON t.f_portid = d.f_id
  325. LEFT JOIN sys_dict_data pro ON pro.dict_value = t.f_types and pro.dict_type = 'f_types'
  326. LEFT JOIN sys_dict_data pros ON pros.dict_value = t.f_port and pros.dict_type = 'f_port'
  327. <where>
  328. t.f_status = 'T'
  329. and pro.dict_label = '堆场'
  330. <if test="fTypes != null and fTypes != ''">and t.f_types = #{fTypes}</if>
  331. <if test="portName != null and portName != ''">and d.f_name like concat('%', #{portName}, '%')</if>
  332. <if test="fNo != null and fNo != ''">and t.f_no = #{fNo}</if>
  333. <if test="fName != null and fName != ''">and t.f_name like concat('%', #{fName}, '%')</if>
  334. <if test="fEname != null and fEname != ''">and t.f_ename like concat('%', #{fEname}, '%')</if>
  335. <if test="fLaneid != null ">and t.f_laneid = #{fLaneid}</if>
  336. <if test="fPortid != null ">and t.f_portid = #{fPortid}</if>
  337. <if test="fCountry != null and fCountry != ''">and t.f_country = #{fCountry}</if>
  338. <if test="fProvince != null and fProvince != ''">and t.f_province = #{fProvince}</if>
  339. <if test="fCity != null and fCity != ''">and t.f_city = #{fCity}</if>
  340. <if test="fTel != null and fTel != ''">and t.f_tel = #{fTel}</if>
  341. <if test="fEmail != null and fEmail != ''">and t.f_email = #{fEmail}</if>
  342. <if test="fManagerid != null ">and t.f_managerid = #{fManagerid}</if>
  343. <if test="fUncode != null and fUncode != ''">and t.f_uncode = #{fUncode}</if>
  344. <if test="fPort != null and fPort != ''">and t.f_port = #{fPort}</if>
  345. <if test="fStatus != null and fStatus != ''">and t.f_status = #{fStatus}</if>
  346. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  347. and t.create_time &gt;= #{cLoadDate[0]}
  348. </if>
  349. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  350. and t.create_time &lt;= #{cLoadDate[1]}
  351. </if>
  352. </where>
  353. ORDER BY CONVERT(t.f_name USING gbk) asc
  354. </select>
  355. <!--查询码头信息-->
  356. <select id="selectWarfDump" parameterType="TAddress" resultMap="TAddressResult">
  357. SELECT
  358. t.f_id,
  359. t.f_types,
  360. pro.dict_label a,
  361. t.f_no,
  362. t.f_name,
  363. t.f_ename,
  364. t.f_laneid,
  365. t.f_portid,
  366. t.f_country,
  367. t.f_province,
  368. t.f_city,
  369. t.f_tel,
  370. t.f_email,
  371. t.f_managerid,
  372. t.f_uncode,
  373. t.f_port,
  374. pros.dict_label b,
  375. CASE
  376. WHEN t.f_status = 'T' THEN
  377. '正常使用' ELSE '停用'
  378. END AS f_status,
  379. t.create_by,
  380. t.create_time,
  381. t.update_by,
  382. t.update_time,
  383. t.remark,
  384. d.f_name portName,
  385. d.f_ename portEnglish
  386. FROM
  387. t_address t
  388. LEFT JOIN t_address d ON t.f_portid = d.f_id
  389. LEFT JOIN sys_dict_data pro ON pro.dict_value = t.f_types and pro.dict_type = 'f_types'
  390. LEFT JOIN sys_dict_data pros ON pros.dict_value = t.f_port and pros.dict_type = 'f_port'
  391. <where>
  392. t.f_status = 'T'
  393. and pro.dict_label = '码头'
  394. <if test="fTypes != null and fTypes != ''">and t.f_types = #{fTypes}</if>
  395. <if test="portName != null and portName != ''">and d.f_name like concat('%', #{portName}, '%')</if>
  396. <if test="fNo != null and fNo != ''">and t.f_no = #{fNo}</if>
  397. <if test="fName != null and fName != ''">and t.f_name like concat('%', #{fName}, '%')</if>
  398. <if test="fEname != null and fEname != ''">and t.f_ename like concat('%', #{fEname}, '%')</if>
  399. <if test="fLaneid != null ">and t.f_laneid = #{fLaneid}</if>
  400. <if test="fPortid != null ">and t.f_portid = #{fPortid}</if>
  401. <if test="fCountry != null and fCountry != ''">and t.f_country = #{fCountry}</if>
  402. <if test="fProvince != null and fProvince != ''">and t.f_province = #{fProvince}</if>
  403. <if test="fCity != null and fCity != ''">and t.f_city = #{fCity}</if>
  404. <if test="fTel != null and fTel != ''">and t.f_tel = #{fTel}</if>
  405. <if test="fEmail != null and fEmail != ''">and t.f_email = #{fEmail}</if>
  406. <if test="fManagerid != null ">and t.f_managerid = #{fManagerid}</if>
  407. <if test="fUncode != null and fUncode != ''">and t.f_uncode = #{fUncode}</if>
  408. <if test="fPort != null and fPort != ''">and t.f_port = #{fPort}</if>
  409. <if test="fStatus != null and fStatus != ''">and t.f_status = #{fStatus}</if>
  410. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  411. and t.create_time &gt;= #{cLoadDate[0]}
  412. </if>
  413. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  414. and t.create_time &lt;= #{cLoadDate[1]}
  415. </if>
  416. </where>
  417. ORDER BY CONVERT(t.f_name USING gbk) asc
  418. </select>
  419. <!--查看港口名称-->
  420. <select id="selectPortName" parameterType="TAddress" resultType="map">
  421. SELECT
  422. f_id as fId,
  423. f_name as fName
  424. FROM
  425. t_address t
  426. LEFT JOIN
  427. (SELECT dict_label,dict_value FROM sys_dict_data WHERE dict_type = 'f_types') s
  428. ON t.f_types = s.dict_value
  429. WHERE t.f_status = 'T'
  430. AND s.dict_label = '港口'
  431. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  432. ORDER BY CONVERT(t.f_name USING gbk) asc
  433. </select>
  434. <!--查看航线名称-->
  435. <select id="selectAirLineName" parameterType="TAddress" resultType="map">
  436. SELECT
  437. f_id as fId,
  438. f_name as fName
  439. FROM
  440. t_address t
  441. LEFT JOIN
  442. (SELECT dict_label,dict_value FROM sys_dict_data WHERE dict_type = 'f_types') s
  443. ON t.f_types = s.dict_value
  444. WHERE t.f_status = 'T'
  445. AND s.dict_label = '航线'
  446. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  447. ORDER BY CONVERT(t.f_name USING gbk) asc
  448. </select>
  449. <!--查看堆场名称-->
  450. <select id="selectStorageName" parameterType="TAddress" resultType="map">
  451. SELECT
  452. f_id as fId,
  453. f_name as fName
  454. FROM
  455. t_address t
  456. LEFT JOIN
  457. (SELECT dict_label,dict_value FROM sys_dict_data WHERE dict_type = 'f_types') s
  458. ON t.f_types = s.dict_value
  459. WHERE t.f_status = 'T'
  460. AND s.dict_label = '堆场'
  461. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  462. ORDER BY CONVERT(t.f_name USING gbk) asc
  463. </select>
  464. <!--查看码头名称-->
  465. <select id="selectWharfName" parameterType="TAddress" resultType="map">
  466. SELECT
  467. f_id as fId,
  468. f_name as fName
  469. FROM
  470. t_address t
  471. LEFT JOIN
  472. (SELECT dict_label,dict_value FROM sys_dict_data WHERE dict_type = 'f_types') s
  473. ON t.f_types = s.dict_value
  474. WHERE t.f_status = 'T'
  475. AND s.dict_label = '码头'
  476. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  477. ORDER BY CONVERT(t.f_name USING gbk) asc
  478. </select>
  479. <!--查询港口信息-->
  480. <select id="selectPortDump" parameterType="TAddress" resultMap="TAddressResult">
  481. SELECT
  482. t.f_id,
  483. t.f_types,
  484. pro.dict_label typesName,
  485. t.f_no ,
  486. t.f_name ,
  487. t.f_ename ,
  488. t.f_laneid,
  489. t.f_portid ,
  490. t.f_country ,
  491. t.f_province ,
  492. t.f_city ,
  493. t.f_tel ,
  494. t.f_email ,
  495. t.f_managerid ,
  496. t.f_uncode ,
  497. t.f_port ,
  498. pros.dict_label havenName,
  499. t.create_by,
  500. t.create_time,
  501. t.update_by,
  502. t.update_time,
  503. t.remark,
  504. CASE
  505. WHEN t.f_status = 'T' THEN
  506. '正常使用' ELSE '停用'
  507. END AS f_status,
  508. d.f_name portName,
  509. d.f_ename portEnglish
  510. FROM
  511. t_address t
  512. LEFT JOIN t_address d ON t.f_laneid = d.f_id
  513. LEFT JOIN sys_dict_data pro ON pro.dict_value = t.f_types and pro.dict_type = 'f_types'
  514. LEFT JOIN sys_dict_data pros ON pros.dict_value = t.f_port and pros.dict_type = 'f_port'
  515. <where>
  516. t.f_status = 'T'
  517. and pro.dict_label = '港口'
  518. <if test="fTypes != null and fTypes != ''">and t.f_types = #{fTypes}</if>
  519. <if test="portName != null and portName != ''">and d.f_name like concat('%', #{portName}, '%')</if>
  520. <if test="fNo != null and fNo != ''">and t.f_no = #{fNo}</if>
  521. <if test="fName != null and fName != ''">and t.f_name like concat('%', #{fName}, '%')</if>
  522. <if test="fEname != null and fEname != ''">and t.f_ename like concat('%', #{fEname}, '%')</if>
  523. <if test="fLaneid != null ">and t.f_laneid = #{fLaneid}</if>
  524. <if test="fPortid != null ">and t.f_portid = #{fPortid}</if>
  525. <if test="fCountry != null and fCountry != ''">and t.f_country = #{fCountry}</if>
  526. <if test="fProvince != null and fProvince != ''">and t.f_province = #{fProvince}</if>
  527. <if test="fCity != null and fCity != ''">and t.f_city = #{fCity}</if>
  528. <if test="fTel != null and fTel != ''">and t.f_tel = #{fTel}</if>
  529. <if test="fEmail != null and fEmail != ''">and t.f_email = #{fEmail}</if>
  530. <if test="fManagerid != null ">and t.f_managerid = #{fManagerid}</if>
  531. <if test="fUncode != null and fUncode != ''">and t.f_uncode = #{fUncode}</if>
  532. <if test="fPort != null and fPort != ''">and t.f_port = #{fPort}</if>
  533. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  534. and t.create_time &gt;= #{cLoadDate[0]}
  535. </if>
  536. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  537. and t.create_time &lt;= #{cLoadDate[1]}
  538. </if>
  539. </where>
  540. ORDER BY CONVERT(t.f_name USING gbk) asc
  541. </select>
  542. <select id="selectAddressFno" parameterType="TAddress" resultMap="TAddressResult">
  543. SELECT
  544. f_id,
  545. f_no
  546. FROM
  547. t_address
  548. WHERE
  549. f_types = #{fTypes}
  550. and f_no = #{fNo}
  551. ORDER BY CONVERT(f_name USING gbk) asc
  552. </select>
  553. <select id="selectAddressFName" parameterType="TAddress" resultMap="TAddressResult">
  554. SELECT
  555. f_id,
  556. f_name
  557. FROM
  558. t_address
  559. WHERE
  560. f_types = #{fTypes}
  561. and f_name = #{fName}
  562. ORDER BY CONVERT(f_name USING gbk) asc
  563. </select>
  564. <select id="selectadress" parameterType="TAddress" resultMap="TAddressResult">
  565. SELECT
  566. t.f_id,
  567. t.f_name ,
  568. pro.dict_label typesName
  569. FROM
  570. t_address t
  571. LEFT JOIN
  572. sys_dict_data pro ON pro.dict_value = t.f_types and pro.dict_type = 'f_types'
  573. where t.f_status = 'T' AND pro.dict_label &lt;&gt; '航线'
  574. ORDER BY CONVERT(t.f_name USING gbk) asc
  575. </select>
  576. </mapper>