TCntrnoMapper.xml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  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. car.*
  393. FROM
  394. (
  395. SELECT
  396. tt.f_updateaddress AS 地点
  397. <if test=" sql != null and sql != ''">
  398. ,${sql}
  399. </if>
  400. FROM
  401. (
  402. SELECT
  403. tc.f_updateaddress f_updateaddress,
  404. tc.typeidCount typeidCount,
  405. t.f_no f_no
  406. FROM
  407. (
  408. SELECT
  409. ta.f_name f_updateaddress,
  410. tcn.f_typeid,
  411. COUNT( tcn.f_updateaddress ) typeidCount
  412. FROM
  413. t_cntrno tcn
  414. LEFT JOIN t_address ta ON tcn.f_updateaddress = ta.f_id
  415. WHERE
  416. tcn.f_status = 'T'
  417. GROUP BY
  418. tcn.f_updateaddress,
  419. tcn.f_typeid
  420. ) tc
  421. LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
  422. ) tt
  423. GROUP BY
  424. tt.f_updateaddress
  425. ) container
  426. LEFT JOIN (
  427. SELECT
  428. a.f_updateaddress
  429. <if test=" stand != null and stand != ''">
  430. ,${stand}
  431. </if>
  432. FROM
  433. (
  434. SELECT
  435. tc.f_updateaddress f_updateaddress,
  436. tc.f_updateEF f_updateEF,
  437. tc.typeName typeName,
  438. tc.efCount efCount,
  439. sdda.dict_label dict_label
  440. FROM
  441. (
  442. SELECT
  443. ta.f_name f_updateaddress,
  444. tct.f_updateEF,
  445. tc.f_no typeName,
  446. COUNT( tct.f_updateaddress ) efCount
  447. FROM
  448. t_cntrno tct
  449. LEFT JOIN t_address ta ON tct.f_updateaddress = ta.f_id
  450. LEFT JOIN t_cntr tc ON tct.f_typeid = tc.f_id
  451. WHERE
  452. tct.f_status = 'T'
  453. GROUP BY
  454. tct.f_updateaddress,
  455. tct.f_updateEF,
  456. tct.f_typeid
  457. ) tc
  458. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  459. AND sdda.dict_type = 'f_updateEF'
  460. ) a
  461. GROUP BY
  462. a.f_updateaddress
  463. ) box ON container.地点 = box.f_updateaddress
  464. LEFT JOIN (
  465. SELECT
  466. b.f_updateaddress
  467. <if test=" bareWeight != null and bareWeight != ''">
  468. ,${bareWeight}
  469. </if>
  470. FROM
  471. (
  472. SELECT
  473. tc.f_updateaddress f_updateaddress,
  474. tc.f_cntrstatus f_cntrstatus,
  475. tc.statusCount statusCount,
  476. tc.typeName typeName,
  477. sdda.dict_label dict_label
  478. FROM
  479. (
  480. SELECT
  481. ta.f_name f_updateaddress,
  482. tct.f_cntrstatus,
  483. tc.f_no typeName,
  484. COUNT( tct.f_updateaddress ) statusCount
  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_cntrstatus,
  494. tct.f_typeid
  495. ) tc
  496. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_cntrstatus
  497. AND sdda.dict_type = 'f_cntrstatus'
  498. ) b
  499. GROUP BY
  500. b.f_updateaddress
  501. ) car ON container.地点 = car.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. GROUP BY tc.f_updateaddress
  691. UNION
  692. SELECT
  693. tc.remark addressName,
  694. IFNULL(COUNT(1),0) boxNumber
  695. FROM
  696. t_cntrno tc
  697. LEFT JOIN t_address ta ON tc.f_updateaddress = ta.f_id
  698. WHERE
  699. ta.f_name = '在船'
  700. GROUP BY tc.remark
  701. </select>
  702. </mapper>