TCntrnoMapper.xml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  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.TCntrnoMapper">
  6. <resultMap type="TCntrno" id="TCntrnoResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fNo" column="f_no"/>
  9. <result property="fTypeid" column="f_typeid"/>
  10. <result property="fOwner" column="f_owner"/>
  11. <result property="fSource" column="f_source"/>
  12. <result property="fRent" column="f_rent"/>
  13. <result property="fUpdatetime" column="f_updatetime"/>
  14. <result property="fUpdateaddress" column="f_updateaddress"/>
  15. <result property="fUpdateef" column="f_updateEF"/>
  16. <result property="fCntrstatus" column="f_cntrstatus"/>
  17. <result property="fStatus" column="f_status"/>
  18. <result property="createBy" column="create_by"/>
  19. <result property="createTime" column="create_time"/>
  20. <result property="updateBy" column="update_by"/>
  21. <result property="updateTime" column="update_time"/>
  22. <result property="remark" column="remark"/>
  23. <result property="fOpctnstatus" column="f_opctnstatus"/>
  24. <result property="fSealno" column="f_sealno"/>
  25. <result property="fBuildBoxTime" column="f_build_box_time" />
  26. <result property="fBoxTurtleYear" column="f_box_turtle_year" />
  27. <result property="fBoxTurtleMonth" column="f_box_turtle_month" />
  28. <result property="fBoxLord" column="f_box_lord" />
  29. <result property="fPactDealHorn" column="f_pact_deal_horn" />
  30. <result property="fMblno" column="f_mblno" />
  31. <result property="fBoxWeight" column="f_box_weight" />
  32. <result property="onHireStart" column="on_hire_start" />
  33. <result property="onHireEnd" column="on_hire_end" />
  34. </resultMap>
  35. <sql id="selectTCntrnoVo">
  36. select f_id, f_no, f_typeid, f_owner, f_source, f_rent, f_updatetime, f_updateaddress, f_updateEF, f_cntrstatus, case when f_status = 'T' then '正常' else '停用' end as f_status,f_opctnstatus,f_sealno,create_by, create_time, update_by, update_time, remark,
  37. f_build_box_time,f_box_turtle_year,f_box_turtle_month,f_box_lord,f_pact_deal_horn,f_mblno,f_box_weight,on_hire_start,on_hire_end from t_cntrno
  38. </sql>
  39. <select id="selectTCntrnoList" parameterType="TCntrno" resultMap="TCntrnoResult">
  40. <include refid="selectTCntrnoVo"/>
  41. <where>
  42. <if test="fNo != null and fNo != ''">and f_no = #{fNo}</if>
  43. <if test="fTypeid != null ">and f_typeid = #{fTypeid}</if>
  44. <if test="fOwner != null and fOwner != ''">and f_owner = #{fOwner}</if>
  45. <if test="fSource != null and fSource != ''">and f_source = #{fSource}</if>
  46. <if test="fRent != null and fRent != ''">and f_rent = #{fRent}</if>
  47. <if test="fUpdatetime != null ">and f_updatetime = #{fUpdatetime}</if>
  48. <if test="fUpdateaddress != null and fUpdateaddress != ''">and f_updateaddress = #{fUpdateaddress}</if>
  49. <if test="fUpdateef != null and fUpdateef != ''">and f_updateEF = #{fUpdateef}</if>
  50. <if test="fCntrstatus != null and fCntrstatus != ''">and f_cntrstatus = #{fCntrstatus}</if>
  51. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  52. <if test="fOpctnstatus != null and fOpctnstatus != ''">and f_opctnstatus = #{fOpctnstatus}</if>
  53. <if test="fSealno != null and fSealno != ''">and f_sealno = #{fSealno}</if>
  54. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  55. and create_time &gt;= #{cLoadDate[0]}
  56. </if>
  57. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  58. and create_time &lt;= #{cLoadDate[1]}
  59. </if>
  60. <if test="fBuildBoxTime != null "> and f_build_box_time = #{fBuildBoxTime}</if>
  61. <if test="fBoxTurtleYear != null and fBoxTurtleYear != ''"> and f_box_turtle_year = #{fBoxTurtleYear}</if>
  62. <if test="fBoxTurtleMonth != null and fBoxTurtleMonth != ''"> and f_box_turtle_month = #{fBoxTurtleMonth}</if>
  63. <if test="fBoxLord != null and fBoxLord != ''"> and f_box_lord = #{fBoxLord}</if>
  64. <if test="fPactDealHorn != null and fPactDealHorn != ''"> and f_pact_deal_horn = #{fPactDealHorn}</if>
  65. <if test="fMblno != null and fMblno != ''"> and f_mblno = #{fMblno}</if>
  66. <if test="fBoxWeight != null "> and f_box_weight = #{fBoxWeight}</if>
  67. <if test="onHireStart != null "> and on_hire_start = #{onHireStart}</if>
  68. <if test="onHireEnd != null "> and on_hire_end = #{onHireEnd}</if>
  69. </where>
  70. </select>
  71. <select id="selectTcntrnoMessage" parameterType="TCntrno" resultMap="TCntrnoResult">
  72. SELECT
  73. tc.f_id,
  74. tc.f_no,
  75. tc.f_typeid,
  76. t.f_no typeidName,
  77. t.f_cntrsize cntrsize,
  78. prs.dict_label cntrsizeName,
  79. tc.f_owner,
  80. pro.dict_label ownerName,
  81. tc.f_source,
  82. sd.dict_label sourceName,
  83. tc.f_rent,
  84. sdd.dict_label rentName,
  85. tc.f_updatetime,
  86. tc.f_updateaddress,
  87. address.f_name addressName,
  88. tc.f_updateEF,
  89. sdda.dict_label updateEFName,
  90. tc.f_cntrstatus,
  91. pr.dict_label cntrstatusName,
  92. tc.f_status,
  93. case when tc.f_status = 'T' then '启用' else '停用' end as fStatusName,
  94. prd.dict_label opctnstatusName,
  95. tc.create_by,
  96. tc.create_time,
  97. tc.update_by,
  98. tc.update_time,
  99. tc.remark,
  100. tc.f_build_box_time,
  101. tc.f_box_turtle_year,
  102. tc.f_box_turtle_month,
  103. tc.f_box_lord,
  104. tc.f_pact_deal_horn,
  105. tc.on_hire_start,
  106. tc.on_hire_end,
  107. tc.f_mblno
  108. FROM
  109. t_cntrno tc
  110. LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
  111. AND pro.dict_type = 'f_owner'
  112. LEFT JOIN sys_dict_data sd ON sd.dict_value = tc.f_source
  113. AND sd.dict_type = 'f_source'
  114. LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tc.f_rent
  115. AND sdd.dict_type = 'f_rent'
  116. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  117. AND sdda.dict_type = 'f_updateEF'
  118. LEFT JOIN sys_dict_data pr ON pr.dict_value = tc.f_cntrstatus
  119. AND pr.dict_type = 'f_cntrstatus'
  120. LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
  121. LEFT JOIN sys_dict_data prs ON prs.dict_value = t.f_cntrsize
  122. AND prs.dict_type = 'f_cntrsize'
  123. LEFT JOIN sys_dict_data prd ON prd.dict_value = tc.f_opctnstatus
  124. AND prd.dict_type = 'f_opctnstatus'
  125. LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
  126. <where>
  127. <if test="tc.fNo != null and tc.fNo != ''">and tc.f_no like concat('%', #{tc.fNo}, '%') </if>
  128. <if test="tc.fTypeid != null ">and tc.f_typeid = #{tc.fTypeid}</if>
  129. <if test="tc.fOwner != null and tc.fOwner != ''">and tc.f_owner = #{tc.fOwner}</if>
  130. <if test="tc.fSource != null and tc.fSource != ''">and tc.f_source = #{tc.fSource}</if>
  131. <if test="tc.fRent != null and tc.fRent != ''">and tc.f_rent = #{tc.fRent}</if>
  132. <if test="tc.fUpdatetime != null ">and tc.f_updatetime = #{tc.fUpdatetime}</if>
  133. <if test='tc.fUpdateaddress != null and tc.fUpdateaddress != "" and tc.fUpdateaddress != "0"'>and tc.f_updateaddress = #{tc.fUpdateaddress}</if>
  134. <if test='tc.fUpdateaddress != null and tc.fUpdateaddress != "" and tc.fUpdateaddress == "0"'>and tc.f_updateaddress = ''</if>
  135. <if test="tc.fUpdateef != null and tc.fUpdateef != ''">and tc.f_updateEF = #{tc.fUpdateef}</if>
  136. <if test="tc.fCntrstatus != null and tc.fCntrstatus != ''">and tc.f_cntrstatus = #{tc.fCntrstatus}</if>
  137. <if test="tc.fStatus != null and tc.fStatus != ''">and tc.f_status = #{tc.fStatus}</if>
  138. <if test="tc.fOpctnstatus != null and tc.fOpctnstatus != ''">and tc.f_opctnstatus = #{tc.fOpctnstatus}</if>
  139. <if test="tc.fSealno != null and tc.fSealno != ''">and tc.f_sealno = #{tc.fSealno}</if>
  140. <if test='tc.cLoadDate != null and tc.cLoadDate[0] != null and tc.cLoadDate[0]!= ""'>
  141. and tc.create_time &gt;= #{tc.cLoadDate[0]}
  142. </if>
  143. <if test='tc.cLoadDate != null and tc.cLoadDate[1] != null and tc.cLoadDate[1]!= ""'>
  144. and tc.create_time &lt;= #{tc.cLoadDate[1]}
  145. </if>
  146. <if test="address != null and address != ''">and address.f_name = #{address}</if>
  147. <if test="typeidName != null and typeidName != ''">and t.f_no = #{typeidName}</if>
  148. <if test="cntrstatusName != null and cntrstatusName != ''">and pr.dict_label = #{cntrstatusName}</if>
  149. <if test="updateEFName != null and updateEFName != ''">and sdda.dict_label = #{updateEFName}</if>
  150. <if test="cntrsize != null ">and t.f_cntrsize = #{cntrsize}</if>
  151. <if test="tc.fBuildBoxTime != null "> and tc.f_build_box_time = #{fBuildBoxTime}</if>
  152. <if test="tc.fBoxTurtleYear != null and tc.fBoxTurtleYear != ''"> and tc.f_box_turtle_year = #{fBoxTurtleYear}</if>
  153. <if test="tc.fBoxTurtleMonth != null and tc.fBoxTurtleMonth != ''"> and tc.f_box_turtle_month = #{fBoxTurtleMonth}</if>
  154. <if test="tc.fBoxLord != null and tc.fBoxLord != ''"> and tc.f_box_lord = #{tc.fBoxLord}</if>
  155. <if test="tc.fPactDealHorn != null and tc.fPactDealHorn != ''"> and tc.f_pact_deal_horn = #{tc.fPactDealHorn}</if>
  156. <if test="tc.fMblno != null and tc.fMblno != ''"> and tc.f_mblno = #{tc.fMblno}</if>
  157. <if test="tc.fBoxWeight != null "> and tc.f_box_weight = #{tc.fBoxWeight}</if>
  158. <if test='tc.onHireStartList != null and tc.onHireStartList[0] != null and tc.onHireStartList[0]!= ""'>
  159. and tc.on_hire_start &gt;= #{tc.onHireStartList[0]}
  160. </if>
  161. <if test='tc.onHireStartList != null and tc.onHireStartList[1] != null and tc.onHireStartList[1]!= ""'>
  162. and tc.on_hire_start &lt;= #{tc.onHireStartList[1]}
  163. </if>
  164. <if test='tc.onHireEnfList != null and tc.onHireEnfList[0] != null and tc.onHireEnfList[0]!= ""'>
  165. and tc.on_hire_end &gt;= #{tc.onHireEnfList[0]}
  166. </if>
  167. <if test='tc.onHireEnfList != null and tc.onHireEnfList[1] != null and tc.onHireEnfList[1]!= ""'>
  168. and tc.on_hire_end &lt;= #{tc.onHireEnfList[1]}
  169. </if>
  170. </where>
  171. ORDER BY tc.f_no,CONVERT(tc.f_updateaddress USING gbk),CONVERT(t.f_no USING gbk),
  172. tc.f_updateEF,tc.f_cntrstatus,tc.f_owner
  173. </select>
  174. <select id="selectTCntrnoById" parameterType="Long" resultMap="TCntrnoResult">
  175. SELECT
  176. tc.f_id,
  177. tc.f_no,
  178. tc.f_typeid,
  179. tc.f_sealno,
  180. t.f_name typeidName,
  181. t.f_cntrsize cntrsize,
  182. prs.dict_label cntrsizeName,
  183. tc.f_owner,
  184. pro.dict_label ownerName,
  185. tc.f_source,
  186. sd.dict_label sourceName,
  187. tc.f_rent,
  188. sdd.dict_label rentName,
  189. tc.f_updatetime,
  190. tc.f_updateaddress,
  191. address.f_name addressName,
  192. tc.f_updateEF,
  193. sdda.dict_label updateEFName,
  194. tc.f_cntrstatus,
  195. pr.dict_label cntrstatusName,
  196. tc.f_status,
  197. case when tc.f_status = 'T' then '启用' else '停用' end as fStatusName,
  198. tc.f_opctnstatus,
  199. tc.create_by,
  200. tc.create_time,
  201. tc.update_by,
  202. tc.update_time,
  203. tc.remark,
  204. tc.f_build_box_time,
  205. tc.f_box_turtle_year,
  206. tc.f_box_turtle_month,
  207. tc.f_box_lord,
  208. tc.f_pact_deal_horn,
  209. tc.on_hire_start,
  210. tc.on_hire_end
  211. FROM
  212. t_cntrno tc
  213. LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
  214. AND pro.dict_type = 'f_owner'
  215. LEFT JOIN sys_dict_data sd ON sd.dict_value = tc.f_source
  216. AND sd.dict_type = 'f_source'
  217. LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tc.f_rent
  218. AND sdd.dict_type = 'f_rent'
  219. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  220. AND sdda.dict_type = 'f_updateEF'
  221. LEFT JOIN sys_dict_data pr ON pr.dict_value = tc.f_cntrstatus
  222. AND pr.dict_type = 'f_cntrstatus'
  223. LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
  224. LEFT JOIN sys_dict_data prs ON prs.dict_value = t.f_cntrsize
  225. AND prs.dict_type = 'f_cntrsize'
  226. LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
  227. where tc.f_id = #{fId}
  228. </select>
  229. <select id="selectTCnTrNoByfNo" parameterType="string" resultMap="TCntrnoResult">
  230. SELECT
  231. tc.f_id,
  232. tc.f_no,
  233. tc.f_typeid,
  234. tc.f_sealno,
  235. t.f_no typeidName,
  236. t.f_cntrsize cntrsize,
  237. prs.dict_label cntrsizeName,
  238. tc.f_owner,
  239. pro.dict_label ownerName,
  240. tc.f_source,
  241. sd.dict_label sourceName,
  242. tc.f_rent,
  243. sdd.dict_label rentName,
  244. tc.f_updatetime,
  245. tc.f_updateaddress,
  246. address.f_name addressName,
  247. tc.f_updateEF,
  248. sdda.dict_label updateEFName,
  249. tc.f_cntrstatus,
  250. pr.dict_label cntrstatusName,
  251. tc.f_status,
  252. case when tc.f_status = 'T' then '启用' else '停用' end as fStatusName,
  253. tc.f_opctnstatus,
  254. tc.create_by,
  255. tc.create_time,
  256. tc.update_by,
  257. tc.update_time,
  258. tc.remark,
  259. tc.f_build_box_time,
  260. tc.f_box_turtle_year,
  261. tc.f_box_turtle_month,
  262. tc.f_box_lord,
  263. tc.f_pact_deal_horn
  264. FROM
  265. t_cntrno tc
  266. LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
  267. AND pro.dict_type = 'f_owner'
  268. LEFT JOIN sys_dict_data sd ON sd.dict_value = tc.f_source
  269. AND sd.dict_type = 'f_source'
  270. LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tc.f_rent
  271. AND sdd.dict_type = 'f_rent'
  272. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  273. AND sdda.dict_type = 'f_updateEF'
  274. LEFT JOIN sys_dict_data pr ON pr.dict_value = tc.f_cntrstatus
  275. AND pr.dict_type = 'f_cntrstatus'
  276. LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
  277. LEFT JOIN sys_dict_data prs ON prs.dict_value = t.f_cntrsize
  278. AND prs.dict_type = 'f_cntrsize'
  279. LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
  280. where tc.f_no = #{fNo} and tc.f_status = 'T'
  281. </select>
  282. <insert id="insertTCntrno" parameterType="TCntrno">
  283. insert into t_cntrno
  284. <trim prefix="(" suffix=")" suffixOverrides=",">
  285. <if test="fId != null">f_id,</if>
  286. <if test="fNo != null and fNo != ''">f_no,</if>
  287. <if test="fTypeid != null">f_typeid,</if>
  288. <if test="fOwner != null and fOwner != ''">f_owner,</if>
  289. <if test="fSource != null">f_source,</if>
  290. <if test="fRent != null">f_rent,</if>
  291. <if test="fUpdatetime != null">f_updatetime,</if>
  292. <if test="fUpdateaddress != null and fUpdateaddress != ''">f_updateaddress,</if>
  293. <if test="fUpdateef != null and fUpdateef != ''">f_updateEF,</if>
  294. <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus,</if>
  295. <if test="fStatus != null">f_status,</if>
  296. <if test="fOpctnstatus != null and fOpctnstatus != ''">f_opctnstatus,</if>
  297. <if test="fSealno != null and fSealno != ''">f_sealno,</if>
  298. <if test="createBy != null">create_by,</if>
  299. <if test="createTime != null">create_time,</if>
  300. <if test="updateBy != null">update_by,</if>
  301. <if test="updateTime != null">update_time,</if>
  302. <if test="remark != null">remark,</if>
  303. <if test="fBuildBoxTime != null">f_build_box_time,</if>
  304. <if test="fBoxTurtleYear != null">f_box_turtle_year,</if>
  305. <if test="fBoxTurtleMonth != null">f_box_turtle_month,</if>
  306. <if test="fBoxLord != null">f_box_lord,</if>
  307. <if test="fPactDealHorn != null">f_pact_deal_horn,</if>
  308. <if test="fMblno != null">f_mblno,</if>
  309. <if test="fBoxWeight != null">f_box_weight,</if>
  310. <if test="onHireStart != null">on_hire_start,</if>
  311. <if test="onHireEnd != null">on_hire_end,</if>
  312. </trim>
  313. <trim prefix="values (" suffix=")" suffixOverrides=",">
  314. <if test="fId != null">#{fId},</if>
  315. <if test="fNo != null and fNo != ''">#{fNo},</if>
  316. <if test="fTypeid != null">#{fTypeid},</if>
  317. <if test="fOwner != null and fOwner != ''">#{fOwner},</if>
  318. <if test="fSource != null">#{fSource},</if>
  319. <if test="fRent != null">#{fRent},</if>
  320. <if test="fUpdatetime != null">#{fUpdatetime},</if>
  321. <if test="fUpdateaddress != null and fUpdateaddress != ''">#{fUpdateaddress},</if>
  322. <if test="fUpdateef != null and fUpdateef != ''">#{fUpdateef},</if>
  323. <if test="fCntrstatus != null and fCntrstatus != ''">#{fCntrstatus},</if>
  324. <if test="fStatus != null">#{fStatus},</if>
  325. <if test="fOpctnstatus != null and fOpctnstatus != ''">#{fOpctnstatus},</if>
  326. <if test="fSealno != null and fSealno != ''">#{fSealno},</if>
  327. <if test="createBy != null">#{createBy},</if>
  328. <if test="createTime != null">#{createTime},</if>
  329. <if test="updateBy != null">#{updateBy},</if>
  330. <if test="updateTime != null">#{updateTime},</if>
  331. <if test="remark != null">#{remark},</if>
  332. <if test="fBuildBoxTime != null">#{fBuildBoxTime},</if>
  333. <if test="fBoxTurtleYear != null">#{fBoxTurtleYear},</if>
  334. <if test="fBoxTurtleMonth != null">#{fBoxTurtleMonth},</if>
  335. <if test="fBoxLord != null">#{fBoxLord},</if>
  336. <if test="fPactDealHorn != null">#{fPactDealHorn},</if>
  337. <if test="fMblno != null">#{fMblno},</if>
  338. <if test="fBoxWeight != null">#{fBoxWeight},</if>
  339. <if test="onHireStart != null">#{onHireStart},</if>
  340. <if test="onHireEnd != null">#{onHireEnd},</if>
  341. </trim>
  342. </insert>
  343. <update id="updateTCntrno" parameterType="TCntrno">
  344. update t_cntrno
  345. <trim prefix="SET" suffixOverrides=",">
  346. <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
  347. <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
  348. <if test="fOwner != null and fOwner != ''">f_owner = #{fOwner},</if>
  349. <if test="fSource != null">f_source = #{fSource},</if>
  350. <if test="fRent != null">f_rent = #{fRent},</if>
  351. <if test="fUpdatetime != null">f_updatetime = #{fUpdatetime},</if>
  352. <if test="fUpdateaddress != null and fUpdateaddress != ''">f_updateaddress = #{fUpdateaddress},</if>
  353. <if test="fUpdateef != null and fUpdateef != ''">f_updateEF = #{fUpdateef},</if>
  354. <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus = #{fCntrstatus},</if>
  355. <if test="fStatus != null">f_status = #{fStatus},</if>
  356. <if test="fOpctnstatus != null and fOpctnstatus != ''">f_opctnstatus = #{fOpctnstatus},</if>
  357. <if test="fSealno != null and fSealno != ''">f_sealno = #{fSealno},</if>
  358. <if test="createBy != null">create_by = #{createBy},</if>
  359. <if test="createTime != null">create_time = #{createTime},</if>
  360. <if test="updateBy != null">update_by = #{updateBy},</if>
  361. <if test="updateTime != null">update_time = #{updateTime},</if>
  362. <if test="remark != null">remark = #{remark},</if>
  363. <if test="fBuildBoxTime != null">f_build_box_time = #{fBuildBoxTime},</if>
  364. <if test="fBoxTurtleYear != null">f_box_turtle_year = #{fBoxTurtleYear},</if>
  365. <if test="fBoxTurtleMonth != null">f_box_turtle_month = #{fBoxTurtleMonth},</if>
  366. <if test="fBoxLord != null">f_box_lord = #{fBoxLord},</if>
  367. <if test="fPactDealHorn != null">f_pact_deal_horn = #{fPactDealHorn},</if>
  368. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  369. <if test="fBoxWeight != null">f_box_weight = #{fBoxWeight},</if>
  370. <if test="onHireStart != null">on_hire_start = #{onHireStart},</if>
  371. <if test="onHireEnd != null">on_hire_end = #{onHireEnd},</if>
  372. </trim>
  373. where f_id = #{fId}
  374. </update>
  375. <update id="updateTCntrnoByfNo" parameterType="TCntrno">
  376. update t_cntrno
  377. <trim prefix="SET" suffixOverrides=",">
  378. <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
  379. <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
  380. <if test="fOwner != null and fOwner != ''">f_owner = #{fOwner},</if>
  381. <if test="fSource != null">f_source = #{fSource},</if>
  382. <if test="fRent != null">f_rent = #{fRent},</if>
  383. <if test="fUpdatetime != null">f_updatetime = #{fUpdatetime},</if>
  384. <if test="fUpdateaddress != null and fUpdateaddress != ''">f_updateaddress = #{fUpdateaddress},</if>
  385. <if test="fUpdateef != null and fUpdateef != ''">f_updateEF = #{fUpdateef},</if>
  386. <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus = #{fCntrstatus},</if>
  387. <if test="fStatus != null">f_status = #{fStatus},</if>
  388. <if test="fOpctnstatus != null and fOpctnstatus != ''">f_opctnstatus = #{fOpctnstatus},</if>
  389. <if test="fSealno != null and fSealno != ''">f_sealno = #{fSealno},</if>
  390. <if test="createBy != null">create_by = #{createBy},</if>
  391. <if test="createTime != null">create_time = #{createTime},</if>
  392. <if test="updateBy != null">update_by = #{updateBy},</if>
  393. <if test="updateTime != null">update_time = #{updateTime},</if>
  394. <if test="remark != null">remark = #{remark},</if>
  395. <if test="remark == null">remark = null,</if>
  396. <if test="fBuildBoxTime != null">f_build_box_time = #{fBuildBoxTime},</if>
  397. <if test="fBoxTurtleYear != null">f_box_turtle_year = #{fBoxTurtleYear},</if>
  398. <if test="fBoxTurtleMonth != null">f_box_turtle_month = #{fBoxTurtleMonth},</if>
  399. <if test="fBoxLord != null">f_box_lord = #{fBoxLord},</if>
  400. <if test="fPactDealHorn != null">f_pact_deal_horn = #{fPactDealHorn},</if>
  401. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  402. <if test="fBoxWeight != null">f_box_weight = #{fBoxWeight},</if>
  403. <if test="onHireStart != null">on_hire_start = #{onHireStart},</if>
  404. <if test="onHireEnd != null">on_hire_end = #{onHireEnd},</if>
  405. </trim>
  406. where f_no = #{fNo}
  407. </update>
  408. <delete id="deleteTCntrnoById" parameterType="Long">
  409. delete from t_cntrno where f_id = #{fId}
  410. </delete>
  411. <delete id="deleteTCntrnoByIds" parameterType="String">
  412. delete from t_cntrno where f_id in
  413. <foreach item="fId" collection="array" open="(" separator="," close=")">
  414. #{fId}
  415. </foreach>
  416. </delete>
  417. <!--批量更新数据状态-->
  418. <update id="updateTcntrnoStatus" parameterType="string">
  419. update t_cntrno
  420. set f_status = 'F'
  421. where f_id in
  422. <foreach item="fId" collection="array" open="(" separator="," close=")">
  423. #{fId}
  424. </foreach>
  425. </update>
  426. <!--获取集装动态分布信息 -->
  427. <select id="getTCntrnoMessage" parameterType="string" resultType="map">
  428. SELECT
  429. container.*,
  430. box.*
  431. FROM
  432. (
  433. SELECT
  434. tt.f_updateaddress AS 地点
  435. <if test=" sql != null and sql != ''">
  436. ,${sql}
  437. </if>
  438. FROM
  439. (
  440. SELECT
  441. tc.f_updateaddress f_updateaddress,
  442. tc.typeidCount typeidCount,
  443. t.f_no f_no
  444. FROM
  445. (
  446. SELECT
  447. ta.f_name f_updateaddress,
  448. tcn.f_typeid,
  449. COUNT( tcn.f_updateaddress ) typeidCount
  450. FROM
  451. t_cntrno tcn
  452. LEFT JOIN t_address ta ON tcn.f_updateaddress = ta.f_id
  453. WHERE
  454. tcn.f_status = 'T'
  455. GROUP BY
  456. tcn.f_updateaddress,
  457. tcn.f_typeid
  458. ) tc
  459. LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
  460. ) tt
  461. GROUP BY
  462. tt.f_updateaddress
  463. ) container
  464. LEFT JOIN (
  465. SELECT
  466. a.f_updateaddress
  467. <if test=" stand != null and stand != ''">
  468. ,${stand}
  469. </if>
  470. FROM
  471. (
  472. SELECT
  473. tc.f_updateaddress f_updateaddress,
  474. tc.f_updateEF f_updateEF,
  475. tc.typeName typeName,
  476. tc.efCount efCount,
  477. sdda.dict_label dict_label
  478. FROM
  479. (
  480. SELECT
  481. ta.f_name f_updateaddress,
  482. tct.f_updateEF,
  483. tc.f_no typeName,
  484. COUNT( tct.f_updateaddress ) efCount
  485. FROM
  486. t_cntrno tct
  487. LEFT JOIN t_address ta ON tct.f_updateaddress = ta.f_id
  488. LEFT JOIN t_cntr tc ON tct.f_typeid = tc.f_id
  489. WHERE
  490. tct.f_status = 'T'
  491. GROUP BY
  492. tct.f_updateaddress,
  493. tct.f_updateEF,
  494. tct.f_typeid
  495. ) tc
  496. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  497. AND sdda.dict_type = 'f_updateEF'
  498. ) a
  499. GROUP BY
  500. a.f_updateaddress
  501. ) box ON container.地点 = box.f_updateaddress
  502. <where>
  503. <if test="tCntrno.fUpdateaddress != null and tCntrno.fUpdateaddress != ''">
  504. container.地点 like concat('%', #{tCntrno.fUpdateaddress}, '%')</if>
  505. </where>
  506. </select>
  507. <select id="selectTCntrnoFNo" parameterType="TCntrno" resultMap="TCntrnoResult">
  508. SELECT
  509. f_id,
  510. f_no
  511. FROM
  512. t_cntrno
  513. WHERE
  514. f_no = #{fNo}
  515. </select>
  516. <insert id="insertTCntrnoList" parameterType="list">
  517. insert into t_cntrno
  518. <trim prefix="(" suffix=")" suffixOverrides=",">
  519. <if test="fId != null">f_id,</if>
  520. <if test="fNo != null and fNo != ''">f_no,</if>
  521. <if test="fTypeid != null">f_typeid,</if>
  522. <if test="fOwner != null and fOwner != ''">f_owner,</if>
  523. <if test="fSource != null">f_source,</if>
  524. <if test="fRent != null">f_rent,</if>
  525. <if test="fUpdatetime != null">f_updatetime,</if>
  526. <if test="fUpdateaddress != null and fUpdateaddress != ''">f_updateaddress,</if>
  527. <if test="fUpdateef != null and fUpdateef != ''">f_updateEF,</if>
  528. <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus,</if>
  529. <if test="fStatus != null">f_status,</if>
  530. <if test="fOpctnstatus != null and fOpctnstatus != ''">f_opctnstatus,</if>
  531. <if test="fSealno != null and fSealno != ''">f_sealno,</if>
  532. <if test="createBy != null">create_by,</if>
  533. <if test="createTime != null">create_time,</if>
  534. <if test="updateBy != null">update_by,</if>
  535. <if test="updateTime != null">update_time,</if>
  536. <if test="remark != null">remark,</if>
  537. </trim>
  538. <foreach collection="list" item="item" separator=",">
  539. <trim prefix="values (" suffix=")" suffixOverrides=",">
  540. <if test="fId != null">#{fId},</if>
  541. <if test="fNo != null and fNo != ''">#{fNo},</if>
  542. <if test="fTypeid != null">#{fTypeid},</if>
  543. <if test="fOwner != null and fOwner != ''">#{fOwner},</if>
  544. <if test="fSource != null">#{fSource},</if>
  545. <if test="fRent != null">#{fRent},</if>
  546. <if test="fUpdatetime != null">#{fUpdatetime},</if>
  547. <if test="fUpdateaddress != null and fUpdateaddress != ''">#{fUpdateaddress},</if>
  548. <if test="fUpdateef != null and fUpdateef != ''">#{fUpdateef},</if>
  549. <if test="fCntrstatus != null and fCntrstatus != ''">#{fCntrstatus},</if>
  550. <if test="fStatus != null">#{fStatus},</if>
  551. <if test="fOpctnstatus != null and fOpctnstatus != ''">#{fOpctnstatus},</if>
  552. <if test="fSealno != null and fSealno != ''">#{fSealno},</if>
  553. <if test="createBy != null">#{createBy},</if>
  554. <if test="createTime != null">#{createTime},</if>
  555. <if test="updateBy != null">#{updateBy},</if>
  556. <if test="updateTime != null">#{updateTime},</if>
  557. <if test="remark != null">#{remark},</if>
  558. </trim>
  559. </foreach>
  560. </insert>
  561. <select id="getTcntrnoFno" parameterType="TCntrno" resultType="map">
  562. SELECT
  563. tc.f_no,
  564. address.f_name addressName,
  565. sdda.dict_label updateEFName
  566. FROM
  567. t_cntrno tc
  568. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  569. AND sdda.dict_type = 'f_updateEF'
  570. LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
  571. <where>
  572. tc.f_status = 'T'
  573. <if test="fNo != null and fNo != ''">and tc.f_no like concat('%', #{fNo}, '%') </if>
  574. <if test="fUpdateaddress != null and fUpdateaddress != ''">and tc.f_updateaddress = #{fUpdateaddress}</if>
  575. <if test="fUpdateef != null and fUpdateef != ''">and tc.f_updateEF = #{fUpdateef}</if>
  576. </where>
  577. ORDER BY tc.f_no
  578. </select>
  579. <!--获取箱分布情况-->
  580. <select id="boxDistributionStatistics" parameterType="TCntrno" resultType="com.ruoyi.shipping.excel.BoxMessage">
  581. SELECT
  582. MAX(case when tc.fNo = '20GP' then tc.boxNumber ELSE 0 end) AS 'TWENTYGP',
  583. MAX(case when tc.fNo = '20RF' then tc.boxNumber ELSE 0 end) AS 'TWENTYRF',
  584. MAX(case when tc.fNo = '20OT' then tc.boxNumber ELSE 0 end) AS 'TWENTYOT',
  585. MAX(case when tc.fNo = '20FR' then tc.boxNumber ELSE 0 end) AS 'TWENTYFR',
  586. MAX(case when tc.fNo = '20HC' then tc.boxNumber ELSE 0 end) AS 'TWENTYTK',
  587. MAX(case when tc.fNo = '40GP' then tc.boxNumber ELSE 0 end) AS 'FORTYGP',
  588. MAX(case when tc.fNo = '40HC' then tc.boxNumber ELSE 0 end) AS 'FORTYHC',
  589. MAX(case when tc.fNo = '40HR' then tc.boxNumber ELSE 0 end) AS 'FORTYHR',
  590. MAX(case when tc.fNo = '40FR' then tc.boxNumber ELSE 0 end) AS 'FORTYFR',
  591. MAX(case when tc.fNo = '40TK' then tc.boxNumber ELSE 0 end) AS 'FORTYTK',
  592. MAX(case when tc.fNo = '40OT' then tc.boxNumber ELSE 0 end) AS 'FORTYOT'
  593. FROM
  594. (
  595. SELECT
  596. IFNULL( COUNT( 1 ), 0 ) boxNumber,
  597. tr.f_no fNo,
  598. sd.dict_label opCTnStatusName
  599. FROM
  600. t_cntrno tc
  601. LEFT JOIN t_cntr tr ON tc.f_typeid = tr.f_id
  602. LEFT JOIN t_address ta ON tc.f_updateaddress = ta.f_id
  603. LEFT JOIN sys_dict_data sd ON tc.f_opctnstatus = sd.dict_value
  604. AND sd.dict_type = 'f_opctnstatus'
  605. <where>
  606. tc.f_status = 'T'
  607. <if test="fUpdateaddress != null and fUpdateaddress != ''">and tc.f_updateaddress = #{fUpdateaddress}</if>
  608. <if test="fOpctnstatus != null and fOpctnstatus != ''">and tc.f_opctnstatus = #{fOpctnstatus}</if>
  609. <if test="remark != null">and tc.remark = #{remark}</if>
  610. <if test="fUpdateef != null and fUpdateef != ''">and tc.f_updateEF = #{fUpdateef}</if>
  611. <if test="fCntrstatus != null and fCntrstatus != ''">and tc.f_cntrstatus = #{fCntrstatus}</if>
  612. </where>
  613. GROUP BY
  614. LEFT ( tr.f_no, 2 ),
  615. RIGHT ( tr.f_no, 2 )
  616. )tc
  617. </select>
  618. <!--获取箱地点为港口信息情况-->
  619. <select id="getBoxPortMessage" parameterType="TCntrno" resultMap="TCntrnoResult">
  620. SELECT
  621. DISTINCT
  622. IFNULL(ta.f_portid, 0) fUpdateaddress,
  623. IFNULL(tr.f_name,'无') addressName
  624. FROM
  625. t_cntrno tc
  626. LEFT JOIN
  627. t_address ta ON ta.f_id = tc.f_updateaddress
  628. LEFT JOIN t_address tr ON ta.f_portid = tr.f_id
  629. LEFT JOIN sys_dict_data sd ON ta.f_types = sd.dict_value AND sd.dict_type = 'f_types'
  630. WHERE sd.dict_label != '港口'
  631. UNION
  632. SELECT
  633. DISTINCT
  634. IFNULL(tc.f_updateaddress,0) fUpdateaddress,
  635. IFNULL(ta.f_name ,'无') addressName
  636. FROM
  637. t_cntrno tc
  638. LEFT JOIN
  639. t_address ta ON ta.f_id = tc.f_updateaddress
  640. LEFT JOIN sys_dict_data sd ON ta.f_types = sd.dict_value AND sd.dict_type = 'f_types'
  641. WHERE sd.dict_label = '港口'
  642. </select>
  643. <!--获取箱地点不为港口信息情况-->
  644. <select id="getBoxAddressMessage" parameterType="TCntrno" resultMap="TCntrnoResult">
  645. SELECT
  646. DISTINCT
  647. tc.f_updateaddress,
  648. ta.f_name addressName,
  649. ta.f_name portName
  650. FROM
  651. t_cntrno tc
  652. LEFT JOIN
  653. t_address ta ON ta.f_id = tc.f_updateaddress
  654. LEFT JOIN sys_dict_data sd ON ta.f_types = sd.dict_value AND sd.dict_type = 'f_types'
  655. WHERE sd.dict_label = '港口'
  656. UNION
  657. SELECT
  658. DISTINCT
  659. tc.f_updateaddress,
  660. ta.f_name addressName,
  661. IFNULL(tr.f_name,'无')portName
  662. FROM
  663. t_cntrno tc
  664. LEFT JOIN
  665. t_address ta ON ta.f_id = tc.f_updateaddress
  666. LEFT JOIN t_address tr ON ta.f_portid = tr.f_id
  667. LEFT JOIN sys_dict_data sd ON ta.f_types = sd.dict_value AND sd.dict_type = 'f_types'
  668. WHERE sd.dict_label != '港口'
  669. </select>
  670. <!--获取地点为在船的备注-->
  671. <select id="getBoxRemark" parameterType="TCntrno" resultMap="TCntrnoResult">
  672. SELECT
  673. DISTINCT
  674. remark
  675. FROM
  676. t_cntrno
  677. WHERE
  678. f_updateaddress = #{fUpdateaddress}
  679. AND remark IS NOT NULL
  680. </select>
  681. <select id="homeBox" resultType="map">
  682. SELECT
  683. ta.f_name addressName,
  684. IFNULL(COUNT(1),0) boxNumber
  685. FROM
  686. t_cntrno tc
  687. LEFT JOIN t_address ta ON tc.f_updateaddress = ta.f_id
  688. WHERE
  689. ta.f_name != '在船'
  690. AND tc.f_status != 'F'
  691. GROUP BY tc.f_updateaddress
  692. UNION
  693. SELECT
  694. '在船' addressName,
  695. IFNULL(COUNT(1),0) boxNumber
  696. FROM
  697. t_cntrno tc
  698. LEFT JOIN t_address ta ON tc.f_updateaddress = ta.f_id
  699. WHERE
  700. ta.f_name = '在船'
  701. AND tc.f_status != 'F'
  702. </select>
  703. <update id="updateHire" parameterType="TCntrno">
  704. update t_cntrno
  705. <trim prefix="SET" suffixOverrides=",">
  706. <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
  707. <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
  708. <if test="fOwner != null and fOwner != ''">f_owner = #{fOwner},</if>
  709. <if test="fSource != null">f_source = #{fSource},</if>
  710. <if test="fRent != null">f_rent = #{fRent},</if>
  711. <if test="fUpdatetime != null">f_updatetime = #{fUpdatetime},</if>
  712. <if test="fUpdateaddress != null and fUpdateaddress != ''">f_updateaddress = #{fUpdateaddress},</if>
  713. <if test="fUpdateef != null and fUpdateef != ''">f_updateEF = #{fUpdateef},</if>
  714. <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus = #{fCntrstatus},</if>
  715. <if test="fStatus != null">f_status = #{fStatus},</if>
  716. <if test="fSealno != null">f_sealno = #{fSealno},</if>
  717. <if test="fOpctnstatus != null">f_opctnstatus = #{fOpctnstatus},</if>
  718. <if test="createBy != null">create_by = #{createBy},</if>
  719. <if test="createTime != null">create_time = #{createTime},</if>
  720. <if test="updateBy != null">update_by = #{updateBy},</if>
  721. <if test="updateTime != null">update_time = #{updateTime},</if>
  722. <if test="remark != null">remark = #{remark},</if>
  723. <if test="fBuildBoxTime != null">f_build_box_time = #{fBuildBoxTime},</if>
  724. <if test="fBoxTurtleYear != null">f_box_turtle_year = #{fBoxTurtleYear},</if>
  725. <if test="fBoxTurtleMonth != null">f_box_turtle_month = #{fBoxTurtleMonth},</if>
  726. <if test="fBoxLord != null">f_box_lord = #{fBoxLord},</if>
  727. <if test="fPactDealHorn != null">f_pact_deal_horn = #{fPactDealHorn},</if>
  728. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  729. <if test="fBoxWeight != null">f_box_weight = #{fBoxWeight},</if>
  730. <if test="onHireStart != null">on_hire_start = #{onHireStart},</if>
  731. <if test="onHireEnd != null">on_hire_end = #{onHireEnd},</if>
  732. </trim>
  733. where f_id in
  734. <foreach item="fId" collection="cntrnoList" open="(" separator="," close=")">
  735. #{fId}
  736. </foreach>
  737. </update>
  738. </mapper>