TCntrnoMapper.xml 22 KB

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