TCntrtrackingMapper.xml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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.TCntrtrackingMapper">
  6. <resultMap type="TCntrtracking" id="TCntrtrackingResult">
  7. <result property="fId" column="f_id" />
  8. <result property="fNo" column="f_no" />
  9. <result property="fMblno" column="f_mblno" />
  10. <result property="fTypeid" column="f_typeid" />
  11. <result property="fOwner" column="f_owner" />
  12. <result property="fVsl" column="f_vsl" />
  13. <result property="fVoy" column="f_voy" />
  14. <result property="fUpdatetime" column="f_updatetime" />
  15. <result property="fUpdateaddress" column="f_updateaddress" />
  16. <result property="fUpdateef" column="f_updateEF" />
  17. <result property="fCntrstatus" column="f_cntrstatus" />
  18. <result property="fStatus" column="f_status" />
  19. <result property="createBy" column="create_by" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateTime" column="update_time" />
  23. <result property="remark" column="remark" />
  24. <result property="fOpctnstatus" column="f_opctnstatus"/>
  25. </resultMap>
  26. <sql id="selectTCntrtrackingVo">
  27. select f_id, f_no, f_mblno, f_typeid, f_owner, f_vsl, f_voy, f_updatetime, f_updateaddress, f_updateEF, f_cntrstatus, case when f_status = 'T' then '正常' else '停用' end as f_status,f_opctnstatus, create_by, create_time, update_by, update_time, remark from t_cntrtracking
  28. </sql>
  29. <select id="selectTCntrtrackingList" parameterType="TCntrtracking" resultMap="TCntrtrackingResult">
  30. SELECT
  31. tc.f_id,
  32. tc.f_no,
  33. tc.f_typeid,
  34. tc.f_mblno,
  35. t.f_no typeidName,
  36. t.f_cntrsize,
  37. prs.dict_label cntrsizeName,
  38. tc.f_owner,
  39. pro.dict_label ownerName,
  40. tc.f_vsl,
  41. tc.f_voy,
  42. tc.f_updatetime,
  43. tc.f_updateaddress,
  44. address.f_name addressName,
  45. tc.f_updateEF,
  46. sdda.dict_label updateEFName,
  47. tc.f_cntrstatus,
  48. pr.dict_label cntrstatusName,
  49. case when tc.f_status = 'T' then '正常' else '停用' end as f_status,
  50. tc.f_opctnstatus,
  51. tc.create_by,
  52. tc.create_time,
  53. tc.update_by,
  54. tc.update_time,
  55. tc.remark
  56. FROM
  57. t_cntrtracking tc
  58. LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
  59. AND pro.dict_type = 'f_owner'
  60. LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
  61. AND sdda.dict_type = 'f_updateEF'
  62. LEFT JOIN sys_dict_data pr ON pr.dict_value = tc.f_cntrstatus
  63. AND pr.dict_type = 'f_cntrstatus'
  64. LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
  65. LEFT JOIN sys_dict_data prs ON prs.dict_value = t.f_cntrsize
  66. AND prs.dict_type = 'f_cntrsize'
  67. LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
  68. <where>
  69. <if test="fNo != null and fNo != ''"> and tc.f_no = #{fNo}</if>
  70. <if test="fMblno != null and fMblno != ''"> and tc.f_mblno = #{fMblno}</if>
  71. <if test="fTypeid != null "> and tc.f_typeid = #{fTypeid}</if>
  72. <if test="fOwner != null and fOwner != ''"> and tc.f_owner = #{fOwner}</if>
  73. <if test="fVsl != null and fVsl != ''"> and tc.f_vsl = #{fVsl}</if>
  74. <if test="fVoy != null and fVoy != ''"> and tc.f_voy = #{fVoy}</if>
  75. <if test="fUpdatetime != null "> and tc.f_updatetime = #{fUpdatetime}</if>
  76. <if test="fUpdateaddress != null and fUpdateaddress != ''"> and tc.f_updateaddress = #{fUpdateaddress}</if>
  77. <if test="fUpdateef != null and fUpdateef != ''"> and tc.f_updateEF = #{fUpdateef}</if>
  78. <if test="fCntrstatus != null and fCntrstatus != ''"> and tc.f_cntrstatus = #{fCntrstatus}</if>
  79. <if test="fStatus != null and fStatus != ''"> and tc.f_status = #{fStatus}</if>
  80. <if test="fOpctnstatus != null and fOpctnstatus != ''">and f_opctnstatus = #{fOpctnstatus}</if>
  81. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  82. and tc.f_updatetime &gt;= #{cLoadDate[0]}
  83. </if>
  84. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  85. and tc.f_updatetime &lt;= #{cLoadDate[1]}
  86. </if>
  87. </where>
  88. ORDER BY tc.f_updatetime desc,tc.f_no
  89. </select>
  90. <select id="selectTCntrtrackingById" parameterType="Long" resultMap="TCntrtrackingResult">
  91. <include refid="selectTCntrtrackingVo"/>
  92. where f_id = #{fId}
  93. </select>
  94. <insert id="insertTCntrtracking" parameterType="TCntrtracking">
  95. <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="fId">
  96. SELECT LAST_INSERT_ID() AS fId
  97. </selectKey>
  98. insert into t_cntrtracking
  99. <trim prefix="(" suffix=")" suffixOverrides=",">
  100. <if test="fId != null">f_id,</if>
  101. <if test="fNo != null">f_no,</if>
  102. <if test="fMblno != null">f_mblno,</if>
  103. <if test="fTypeid != null">f_typeid,</if>
  104. <if test="fOwner != null">f_owner,</if>
  105. <if test="fVsl != null">f_vsl,</if>
  106. <if test="fVoy != null">f_voy,</if>
  107. <if test="fUpdatetime != null">f_updatetime,</if>
  108. <if test="fUpdateaddress != null">f_updateaddress,</if>
  109. <if test="fUpdateef != null">f_updateEF,</if>
  110. <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus,</if>
  111. <if test="fOpctnstatus != null and fOpctnstatus != ''">f_opctnstatus,</if>
  112. <if test="fStatus != null">f_status,</if>
  113. <if test="createBy != null">create_by,</if>
  114. <if test="createTime != null">create_time,</if>
  115. <if test="updateBy != null">update_by,</if>
  116. <if test="updateTime != null">update_time,</if>
  117. <if test="remark != null">remark,</if>
  118. </trim>
  119. <trim prefix="values (" suffix=")" suffixOverrides=",">
  120. <if test="fId != null">#{fId},</if>
  121. <if test="fNo != null">#{fNo},</if>
  122. <if test="fMblno != null">#{fMblno},</if>
  123. <if test="fTypeid != null">#{fTypeid},</if>
  124. <if test="fOwner != null">#{fOwner},</if>
  125. <if test="fVsl != null">#{fVsl},</if>
  126. <if test="fVoy != null">#{fVoy},</if>
  127. <if test="fUpdatetime != null">#{fUpdatetime},</if>
  128. <if test="fUpdateaddress != null">#{fUpdateaddress},</if>
  129. <if test="fUpdateef != null">#{fUpdateef},</if>
  130. <if test="fCntrstatus != null and fCntrstatus != ''">#{fCntrstatus},</if>
  131. <if test="fOpctnstatus != null and fOpctnstatus != ''">#{fOpctnstatus},</if>
  132. <if test="fStatus != null">#{fStatus},</if>
  133. <if test="createBy != null">#{createBy},</if>
  134. <if test="createTime != null">#{createTime},</if>
  135. <if test="updateBy != null">#{updateBy},</if>
  136. <if test="updateTime != null">#{updateTime},</if>
  137. <if test="remark != null">#{remark},</if>
  138. </trim>
  139. </insert>
  140. <update id="updateTCntrtracking" parameterType="TCntrtracking">
  141. update t_cntrtracking
  142. <trim prefix="SET" suffixOverrides=",">
  143. <if test="fNo != null">f_no = #{fNo},</if>
  144. <if test="fMblno != null">f_mblno = #{fMblno},</if>
  145. <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
  146. <if test="fOwner != null">f_owner = #{fOwner},</if>
  147. <if test="fVsl != null">f_vsl = #{fVsl},</if>
  148. <if test="fVoy != null">f_voy = #{fVoy},</if>
  149. <if test="fUpdatetime != null">f_updatetime = #{fUpdatetime},</if>
  150. <if test="fUpdateaddress != null">f_updateaddress = #{fUpdateaddress},</if>
  151. <if test="fUpdateef != null">f_updateEF = #{fUpdateef},</if>
  152. <if test="fCntrstatus != null and fCntrstatus != ''">f_cntrstatus = #{fCntrstatus},</if>
  153. <if test="fStatus != null">f_status = #{fStatus},</if>
  154. <if test="fOpctnstatus != null and fOpctnstatus != ''">f_opctnstatus = #{fOpctnstatus},</if>
  155. <if test="createBy != null">create_by = #{createBy},</if>
  156. <if test="createTime != null">create_time = #{createTime},</if>
  157. <if test="updateBy != null">update_by = #{updateBy},</if>
  158. <if test="updateTime != null">update_time = #{updateTime},</if>
  159. <if test="remark != null">remark = #{remark},</if>
  160. </trim>
  161. where f_id = #{fId}
  162. </update>
  163. <delete id="deleteTCntrtrackingById" parameterType="Long">
  164. delete from t_cntrtracking where f_id = #{fId}
  165. </delete>
  166. <delete id="deleteTCntrtrackingByIds" parameterType="String">
  167. delete from t_cntrtracking where f_id in
  168. <foreach item="fId" collection="array" open="(" separator="," close=")">
  169. #{fId}
  170. </foreach>
  171. </delete>
  172. </mapper>