TCntrnoMapper.xml 31 KB

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