TCntrnoMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  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. </resultMap>
  31. <sql id="selectTCntrnoVo">
  32. 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,
  33. f_build_box_time,f_box_turtle_year,f_box_turtle_month,f_box_lord,f_pact_deal_horn from t_cntrno
  34. </sql>
  35. <select id="selectTCntrnoList" parameterType="TCntrno" resultMap="TCntrnoResult">
  36. <include refid="selectTCntrnoVo"/>
  37. <where>
  38. <if test="fNo != null and fNo != ''">and f_no = #{fNo}</if>
  39. <if test="fTypeid != null ">and f_typeid = #{fTypeid}</if>
  40. <if test="fOwner != null and fOwner != ''">and f_owner = #{fOwner}</if>
  41. <if test="fSource != null and fSource != ''">and f_source = #{fSource}</if>
  42. <if test="fRent != null and fRent != ''">and f_rent = #{fRent}</if>
  43. <if test="fUpdatetime != null ">and f_updatetime = #{fUpdatetime}</if>
  44. <if test="fUpdateaddress != null and fUpdateaddress != ''">and f_updateaddress = #{fUpdateaddress}</if>
  45. <if test="fUpdateef != null and fUpdateef != ''">and f_updateEF = #{fUpdateef}</if>
  46. <if test="fCntrstatus != null and fCntrstatus != ''">and f_cntrstatus = #{fCntrstatus}</if>
  47. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  48. <if test="fOpctnstatus != null and fOpctnstatus != ''">and f_opctnstatus = #{fOpctnstatus}</if>
  49. <if test="fSealno != null and fSealno != ''">and f_sealno = #{fSealno}</if>
  50. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  51. and create_time &gt;= #{cLoadDate[0]}
  52. </if>
  53. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  54. and create_time &lt;= #{cLoadDate[1]}
  55. </if>
  56. <if test="fBuildBoxTime != null "> and f_build_box_time = #{fBuildBoxTime}</if>
  57. <if test="fBoxTurtleYear != null and fBoxTurtleYear != ''"> and f_box_turtle_year = #{fBoxTurtleYear}</if>
  58. <if test="fBoxTurtleMonth != null and fBoxTurtleMonth != ''"> and f_box_turtle_month = #{fBoxTurtleMonth}</if>
  59. <if test="fBoxLord != null and fBoxLord != ''"> and f_box_lord = #{fBoxLord}</if>
  60. <if test="fPactDealHorn != null and fPactDealHorn != ''"> and f_pact_deal_horn = #{fPactDealHorn}</if>
  61. </where>
  62. </select>
  63. <select id="selectTcntrnoMessage" parameterType="TCntrno" resultMap="TCntrnoResult">
  64. SELECT
  65. tc.f_id,
  66. tc.f_no,
  67. tc.f_typeid,
  68. t.f_no typeidName,
  69. t.f_cntrsize cntrsize,
  70. prs.dict_label cntrsizeName,
  71. tc.f_owner,
  72. pro.dict_label ownerName,
  73. tc.f_source,
  74. sd.dict_label sourceName,
  75. tc.f_rent,
  76. sdd.dict_label rentName,
  77. tc.f_updatetime,
  78. tc.f_updateaddress,
  79. address.f_name addressName,
  80. tc.f_updateEF,
  81. sdda.dict_label updateEFName,
  82. tc.f_cntrstatus,
  83. pr.dict_label cntrstatusName,
  84. case when tc.f_status = 'T' then '正常' else '停用' end as f_status,
  85. prd.dict_label opctnstatusName,
  86. tc.create_by,
  87. tc.create_time,
  88. tc.update_by,
  89. tc.update_time,
  90. tc.remark,
  91. tc.f_build_box_time,
  92. tc.f_box_turtle_year,
  93. tc.f_box_turtle_month,
  94. tc.f_box_lord,
  95. tc.f_pact_deal_horn
  96. FROM
  97. t_cntrno tc
  98. LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
  99. AND pro.dict_type = 'f_owner'
  100. LEFT JOIN sys_dict_data sd ON sd.dict_value = tc.f_source
  101. AND sd.dict_type = 'f_source'
  102. LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tc.f_rent
  103. AND sdd.dict_type = 'f_rent'
  104. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  105. AND sdda.dict_type = 'f_updateEF'
  106. LEFT JOIN sys_dict_data pr ON pr.dict_value = tc.f_cntrstatus
  107. AND pr.dict_type = 'f_cntrstatus'
  108. LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
  109. LEFT JOIN sys_dict_data prs ON prs.dict_value = t.f_cntrsize
  110. AND prs.dict_type = 'f_cntrsize'
  111. LEFT JOIN sys_dict_data prd ON prd.dict_value = tc.f_opctnstatus
  112. AND prd.dict_type = 'f_opctnstatus'
  113. LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
  114. <where>
  115. tc.f_status = 'T'
  116. <if test="tc.fNo != null and tc.fNo != ''">and tc.f_no like concat('%', #{tc.fNo}, '%') </if>
  117. <if test="tc.fTypeid != null ">and tc.f_typeid = #{tc.fTypeid}</if>
  118. <if test="tc.fOwner != null and tc.fOwner != ''">and tc.f_owner = #{tc.fOwner}</if>
  119. <if test="tc.fSource != null and tc.fSource != ''">and tc.f_source = #{tc.fSource}</if>
  120. <if test="tc.fRent != null and tc.fRent != ''">and tc.f_rent = #{tc.fRent}</if>
  121. <if test="tc.fUpdatetime != null ">and tc.f_updatetime = #{tc.fUpdatetime}</if>
  122. <if test="tc.fUpdateaddress != null and tc.fUpdateaddress != ''">and tc.f_updateaddress = #{tc.fUpdateaddress}</if>
  123. <if test="tc.fUpdateef != null and tc.fUpdateef != ''">and tc.f_updateEF = #{tc.fUpdateef}</if>
  124. <if test="tc.fCntrstatus != null and tc.fCntrstatus != ''">and tc.f_cntrstatus = #{tc.fCntrstatus}</if>
  125. <if test="tc.fStatus != null and tc.fStatus != ''">and tc.f_status = #{tc.fStatus}</if>
  126. <if test="tc.fOpctnstatus != null and tc.fOpctnstatus != ''">and tc.f_opctnstatus = #{tc.fOpctnstatus}</if>
  127. <if test="tc.fSealno != null and tc.fSealno != ''">and tc.f_sealno = #{tc.fSealno}</if>
  128. <if test='tc.cLoadDate != null and tc.cLoadDate[0] != null and tc.cLoadDate[0]!= ""'>
  129. and tc.create_time &gt;= #{tc.cLoadDate[0]}
  130. </if>
  131. <if test='tc.cLoadDate != null and tc.cLoadDate[1] != null and tc.cLoadDate[1]!= ""'>
  132. and tc.create_time &lt;= #{tc.cLoadDate[1]}
  133. </if>
  134. <if test="address != null and address != ''">and address.f_name = #{address}</if>
  135. <if test="typeidName != null and typeidName != ''">and t.f_no = #{typeidName}</if>
  136. <if test="cntrstatusName != null and cntrstatusName != ''">and pr.dict_label = #{cntrstatusName}</if>
  137. <if test="updateEFName != null and updateEFName != ''">and sdda.dict_label = #{updateEFName}</if>
  138. <if test="cntrsize != null ">and t.f_cntrsize = #{cntrsize}</if>
  139. <if test="tc.fBuildBoxTime != null "> and tc.f_build_box_time = #{fBuildBoxTime}</if>
  140. <if test="tc.fBoxTurtleYear != null and tc.fBoxTurtleYear != ''"> and tc.f_box_turtle_year = #{fBoxTurtleYear}</if>
  141. <if test="tc.fBoxTurtleMonth != null and tc.fBoxTurtleMonth != ''"> and tc.f_box_turtle_month = #{fBoxTurtleMonth}</if>
  142. <if test="tc.fBoxLord != null and tc.fBoxLord != ''"> and tc.f_box_lord = #{tc.fBoxLord}</if>
  143. <if test="tc.fPactDealHorn != null and tc.fPactDealHorn != ''"> and tc.f_pact_deal_horn = #{tc.fPactDealHorn}</if>
  144. </where>
  145. ORDER BY tc.f_no,CONVERT(tc.f_updateaddress USING gbk),CONVERT(t.f_no USING gbk),
  146. tc.f_updateEF,tc.f_cntrstatus,tc.f_owner
  147. </select>
  148. <select id="selectTCntrnoById" parameterType="Long" resultMap="TCntrnoResult">
  149. SELECT
  150. tc.f_id,
  151. tc.f_no,
  152. tc.f_typeid,
  153. tc.f_sealno,
  154. t.f_name typeidName,
  155. t.f_cntrsize cntrsize,
  156. prs.dict_label cntrsizeName,
  157. tc.f_owner,
  158. pro.dict_label ownerName,
  159. tc.f_source,
  160. sd.dict_label sourceName,
  161. tc.f_rent,
  162. sdd.dict_label rentName,
  163. tc.f_updatetime,
  164. tc.f_updateaddress,
  165. address.f_name addressName,
  166. tc.f_updateEF,
  167. sdda.dict_label updateEFName,
  168. tc.f_cntrstatus,
  169. pr.dict_label cntrstatusName,
  170. case when tc.f_status = 'T' then '正常' else '停用' end as f_status,
  171. tc.f_opctnstatus,
  172. tc.create_by,
  173. tc.create_time,
  174. tc.update_by,
  175. tc.update_time,
  176. tc.remark,
  177. tc.f_build_box_time,
  178. tc.f_box_turtle_year,
  179. tc.f_box_turtle_month,
  180. tc.f_box_lord,
  181. tc.f_pact_deal_horn
  182. FROM
  183. t_cntrno tc
  184. LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
  185. AND pro.dict_type = 'f_owner'
  186. LEFT JOIN sys_dict_data sd ON sd.dict_value = tc.f_source
  187. AND sd.dict_type = 'f_source'
  188. LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tc.f_rent
  189. AND sdd.dict_type = 'f_rent'
  190. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  191. AND sdda.dict_type = 'f_updateEF'
  192. LEFT JOIN sys_dict_data pr ON pr.dict_value = tc.f_cntrstatus
  193. AND pr.dict_type = 'f_cntrstatus'
  194. LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
  195. LEFT JOIN sys_dict_data prs ON prs.dict_value = t.f_cntrsize
  196. AND prs.dict_type = 'f_cntrsize'
  197. LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
  198. where tc.f_id = #{fId}
  199. </select>
  200. <insert id="insertTCntrno" parameterType="TCntrno">
  201. insert into t_cntrno
  202. <trim prefix="(" suffix=")" suffixOverrides=",">
  203. <if test="fId != null">f_id,</if>
  204. <if test="fNo != null and fNo != ''">f_no,</if>
  205. <if test="fTypeid != null">f_typeid,</if>
  206. <if test="fOwner != null and fOwner != ''">f_owner,</if>
  207. <if test="fSource != null">f_source,</if>
  208. <if test="fRent != null">f_rent,</if>
  209. <if test="fUpdatetime != null">f_updatetime,</if>
  210. <if test="fUpdateaddress != null and fUpdateaddress != ''">f_updateaddress,</if>
  211. <if test="fUpdateef != null and fUpdateef != ''">f_updateEF,</if>
  212. <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus,</if>
  213. <if test="fStatus != null">f_status,</if>
  214. <if test="fOpctnstatus != null and fOpctnstatus != ''">f_opctnstatus,</if>
  215. <if test="fSealno != null and fSealno != ''">f_sealno,</if>
  216. <if test="createBy != null">create_by,</if>
  217. <if test="createTime != null">create_time,</if>
  218. <if test="updateBy != null">update_by,</if>
  219. <if test="updateTime != null">update_time,</if>
  220. <if test="remark != null">remark,</if>
  221. <if test="fBuildBoxTime != null">f_build_box_time,</if>
  222. <if test="fBoxTurtleYear != null">f_box_turtle_year,</if>
  223. <if test="fBoxTurtleMonth != null">f_box_turtle_month,</if>
  224. <if test="fBoxLord != null">f_box_lord,</if>
  225. <if test="fPactDealHorn != null">f_pact_deal_horn,</if>
  226. </trim>
  227. <trim prefix="values (" suffix=")" suffixOverrides=",">
  228. <if test="fId != null">#{fId},</if>
  229. <if test="fNo != null and fNo != ''">#{fNo},</if>
  230. <if test="fTypeid != null">#{fTypeid},</if>
  231. <if test="fOwner != null and fOwner != ''">#{fOwner},</if>
  232. <if test="fSource != null">#{fSource},</if>
  233. <if test="fRent != null">#{fRent},</if>
  234. <if test="fUpdatetime != null">#{fUpdatetime},</if>
  235. <if test="fUpdateaddress != null and fUpdateaddress != ''">#{fUpdateaddress},</if>
  236. <if test="fUpdateef != null and fUpdateef != ''">#{fUpdateef},</if>
  237. <if test="fCntrstatus != null and fCntrstatus != ''">#{fCntrstatus},</if>
  238. <if test="fStatus != null">#{fStatus},</if>
  239. <if test="fOpctnstatus != null and fOpctnstatus != ''">#{fOpctnstatus},</if>
  240. <if test="fSealno != null and fSealno != ''">#{fSealno},</if>
  241. <if test="createBy != null">#{createBy},</if>
  242. <if test="createTime != null">#{createTime},</if>
  243. <if test="updateBy != null">#{updateBy},</if>
  244. <if test="updateTime != null">#{updateTime},</if>
  245. <if test="remark != null">#{remark},</if>
  246. <if test="fBuildBoxTime != null">#{fBuildBoxTime},</if>
  247. <if test="fBoxTurtleYear != null">#{fBoxTurtleYear},</if>
  248. <if test="fBoxTurtleMonth != null">#{fBoxTurtleMonth},</if>
  249. <if test="fBoxLord != null">#{fBoxLord},</if>
  250. <if test="fPactDealHorn != null">#{fPactDealHorn},</if>
  251. </trim>
  252. </insert>
  253. <update id="updateTCntrno" parameterType="TCntrno">
  254. update t_cntrno
  255. <trim prefix="SET" suffixOverrides=",">
  256. <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
  257. <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
  258. <if test="fOwner != null and fOwner != ''">f_owner = #{fOwner},</if>
  259. <if test="fSource != null">f_source = #{fSource},</if>
  260. <if test="fRent != null">f_rent = #{fRent},</if>
  261. <if test="fUpdatetime != null">f_updatetime = #{fUpdatetime},</if>
  262. <if test="fUpdateaddress != null and fUpdateaddress != ''">f_updateaddress = #{fUpdateaddress},</if>
  263. <if test="fUpdateef != null and fUpdateef != ''">f_updateEF = #{fUpdateef},</if>
  264. <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus = #{fCntrstatus},</if>
  265. <if test="fStatus != null">f_status = #{fStatus},</if>
  266. <if test="fOpctnstatus != null and fOpctnstatus != ''">f_opctnstatus = #{fOpctnstatus},</if>
  267. <if test="fSealno != null and fSealno != ''">f_sealno = #{fSealno},</if>
  268. <if test="createBy != null">create_by = #{createBy},</if>
  269. <if test="createTime != null">create_time = #{createTime},</if>
  270. <if test="updateBy != null">update_by = #{updateBy},</if>
  271. <if test="updateTime != null">update_time = #{updateTime},</if>
  272. <if test="remark != null">remark = #{remark},</if>
  273. <if test="fBuildBoxTime != null">f_build_box_time = #{fBuildBoxTime},</if>
  274. <if test="fBoxTurtleYear != null">f_box_turtle_year = #{fBoxTurtleYear},</if>
  275. <if test="fBoxTurtleMonth != null">f_box_turtle_month = #{fBoxTurtleMonth},</if>
  276. <if test="fBoxLord != null">f_box_lord = #{fBoxLord},</if>
  277. <if test="fPactDealHorn != null">f_pact_deal_horn = #{fPactDealHorn},</if>
  278. </trim>
  279. where f_id = #{fId}
  280. </update>
  281. <delete id="deleteTCntrnoById" parameterType="Long">
  282. delete from t_cntrno where f_id = #{fId}
  283. </delete>
  284. <delete id="deleteTCntrnoByIds" parameterType="String">
  285. delete from t_cntrno where f_id in
  286. <foreach item="fId" collection="array" open="(" separator="," close=")">
  287. #{fId}
  288. </foreach>
  289. </delete>
  290. <!--批量更新数据状态-->
  291. <update id="updateTcntrnoStatus" parameterType="string">
  292. update t_cntrno
  293. set f_status = 'F'
  294. where f_id in
  295. <foreach item="fId" collection="array" open="(" separator="," close=")">
  296. #{fId}
  297. </foreach>
  298. </update>
  299. <!--获取集装动态分布信息 -->
  300. <select id="getTCntrnoMessage" parameterType="string" resultType="map">
  301. SELECT
  302. container.*,
  303. box.`空`,
  304. box.`重`,
  305. car.`好`,
  306. car.`坏`
  307. FROM
  308. (
  309. SELECT
  310. tt.f_updateaddress AS 地点
  311. <if test=" sql != null and sql != ''">
  312. ,${sql}
  313. </if>
  314. FROM
  315. (
  316. SELECT
  317. tc.f_updateaddress f_updateaddress,
  318. tc.typeidCount typeidCount,
  319. t.f_no f_no
  320. FROM
  321. (
  322. SELECT
  323. ta.f_name f_updateaddress,
  324. tcn.f_typeid,
  325. COUNT( tcn.f_updateaddress ) typeidCount
  326. FROM
  327. t_cntrno tcn
  328. LEFT JOIN t_address ta ON tcn.f_updateaddress = ta.f_id
  329. WHERE
  330. tcn.f_status = 'T'
  331. GROUP BY
  332. tcn.f_updateaddress,
  333. tcn.f_typeid
  334. ) tc
  335. LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
  336. ) tt
  337. GROUP BY
  338. tt.f_updateaddress
  339. ) container
  340. LEFT JOIN (
  341. SELECT
  342. a.f_updateaddress,
  343. MAX( CASE WHEN a.dict_label = '空' THEN a.efCount ELSE 0 END ) AS 空,
  344. MAX( CASE WHEN a.dict_label = '重' THEN a.efCount ELSE 0 END ) AS 重
  345. FROM
  346. (
  347. SELECT
  348. tc.f_updateaddress f_updateaddress,
  349. tc.f_updateEF f_updateEF,
  350. tc.efCount efCount,
  351. sdda.dict_label dict_label
  352. FROM
  353. (
  354. SELECT
  355. ta.f_name f_updateaddress,
  356. tct.f_updateEF,
  357. COUNT( tct.f_updateaddress ) efCount
  358. FROM
  359. t_cntrno tct
  360. LEFT JOIN t_address ta ON tct.f_updateaddress = ta.f_id
  361. WHERE
  362. tct.f_status = 'T'
  363. GROUP BY
  364. tct.f_updateaddress,
  365. tct.f_updateEF
  366. ) tc
  367. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  368. AND sdda.dict_type = 'f_updateEF'
  369. ) a
  370. GROUP BY
  371. a.f_updateaddress
  372. ) box ON container.地点 = box.f_updateaddress
  373. LEFT JOIN (
  374. SELECT
  375. b.f_updateaddress,
  376. MAX( CASE WHEN b.dict_label = '好' THEN b.statusCount ELSE 0 END ) AS 好,
  377. MAX( CASE WHEN b.dict_label = '坏' THEN b.statusCount ELSE 0 END ) AS 坏
  378. FROM
  379. (
  380. SELECT
  381. tc.f_updateaddress f_updateaddress,
  382. tc.f_cntrstatus f_cntrstatus,
  383. tc.statusCount statusCount,
  384. sdda.dict_label dict_label
  385. FROM
  386. (
  387. SELECT
  388. ta.f_name f_updateaddress,
  389. tct.f_cntrstatus,
  390. COUNT( tct.f_updateaddress ) statusCount
  391. FROM
  392. t_cntrno tct
  393. LEFT JOIN t_address ta ON tct.f_updateaddress = ta.f_id
  394. WHERE
  395. tct.f_status = 'T'
  396. GROUP BY
  397. tct.f_updateaddress,
  398. tct.f_cntrstatus
  399. ) tc
  400. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_cntrstatus
  401. AND sdda.dict_type = 'f_cntrstatus'
  402. ) b
  403. GROUP BY
  404. b.f_updateaddress
  405. ) car ON container.地点 = car.f_updateaddress
  406. <where>
  407. <if test="tCntrno.fUpdateaddress != null and tCntrno.fUpdateaddress != ''">
  408. container.地点 like concat('%', #{tCntrno.fUpdateaddress}, '%')</if>
  409. </where>
  410. </select>
  411. <select id="selectTCntrnoFNo" parameterType="TCntrno" resultMap="TCntrnoResult">
  412. SELECT
  413. f_id,
  414. f_no
  415. FROM
  416. t_cntrno
  417. WHERE
  418. f_no = #{fNo}
  419. </select>
  420. <insert id="insertTCntrnoList" parameterType="list">
  421. insert into t_cntrno
  422. <trim prefix="(" suffix=")" suffixOverrides=",">
  423. <if test="fId != null">f_id,</if>
  424. <if test="fNo != null and fNo != ''">f_no,</if>
  425. <if test="fTypeid != null">f_typeid,</if>
  426. <if test="fOwner != null and fOwner != ''">f_owner,</if>
  427. <if test="fSource != null">f_source,</if>
  428. <if test="fRent != null">f_rent,</if>
  429. <if test="fUpdatetime != null">f_updatetime,</if>
  430. <if test="fUpdateaddress != null and fUpdateaddress != ''">f_updateaddress,</if>
  431. <if test="fUpdateef != null and fUpdateef != ''">f_updateEF,</if>
  432. <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus,</if>
  433. <if test="fStatus != null">f_status,</if>
  434. <if test="fOpctnstatus != null and fOpctnstatus != ''">f_opctnstatus,</if>
  435. <if test="fSealno != null and fSealno != ''">f_sealno,</if>
  436. <if test="createBy != null">create_by,</if>
  437. <if test="createTime != null">create_time,</if>
  438. <if test="updateBy != null">update_by,</if>
  439. <if test="updateTime != null">update_time,</if>
  440. <if test="remark != null">remark,</if>
  441. </trim>
  442. <foreach collection="list" item="item" separator=",">
  443. <trim prefix="values (" suffix=")" suffixOverrides=",">
  444. <if test="fId != null">#{fId},</if>
  445. <if test="fNo != null and fNo != ''">#{fNo},</if>
  446. <if test="fTypeid != null">#{fTypeid},</if>
  447. <if test="fOwner != null and fOwner != ''">#{fOwner},</if>
  448. <if test="fSource != null">#{fSource},</if>
  449. <if test="fRent != null">#{fRent},</if>
  450. <if test="fUpdatetime != null">#{fUpdatetime},</if>
  451. <if test="fUpdateaddress != null and fUpdateaddress != ''">#{fUpdateaddress},</if>
  452. <if test="fUpdateef != null and fUpdateef != ''">#{fUpdateef},</if>
  453. <if test="fCntrstatus != null and fCntrstatus != ''">#{fCntrstatus},</if>
  454. <if test="fStatus != null">#{fStatus},</if>
  455. <if test="fOpctnstatus != null and fOpctnstatus != ''">#{fOpctnstatus},</if>
  456. <if test="fSealno != null and fSealno != ''">#{fSealno},</if>
  457. <if test="createBy != null">#{createBy},</if>
  458. <if test="createTime != null">#{createTime},</if>
  459. <if test="updateBy != null">#{updateBy},</if>
  460. <if test="updateTime != null">#{updateTime},</if>
  461. <if test="remark != null">#{remark},</if>
  462. </trim>
  463. </foreach>
  464. </insert>
  465. <select id="getTcntrnoFno" parameterType="TCntrno" resultType="map">
  466. SELECT
  467. tc.f_no,
  468. address.f_name addressName,
  469. sdda.dict_label updateEFName
  470. FROM
  471. t_cntrno tc
  472. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  473. AND sdda.dict_type = 'f_updateEF'
  474. LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
  475. <where>
  476. tc.f_status = 'T'
  477. <if test="fNo != null and fNo != ''">and tc.f_no like concat('%', #{fNo}, '%') </if>
  478. <if test="fUpdateaddress != null and fUpdateaddress != ''">and tc.f_updateaddress = #{fUpdateaddress}</if>
  479. <if test="fUpdateef != null and fUpdateef != ''">and tc.f_updateEF = #{fUpdateef}</if>
  480. </where>
  481. ORDER BY tc.f_no
  482. </select>
  483. </mapper>