TTemporaryFileMapper.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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.TTemporaryFileMapper">
  6. <resultMap type="TTemporaryFile" id="TTemporaryFileResult">
  7. <result property="fId" column="f_id" />
  8. <result property="fCntrno" column="f_cntrno" />
  9. <result property="fSealno" column="f_sealno" />
  10. <result property="fGoodsid" column="f_goodsid" />
  11. <result property="fPackageid" column="f_packageid" />
  12. <result property="fCntrid" column="f_cntrid" />
  13. <result property="fCntrweight" column="f_cntrweight" />
  14. <result property="goodsName" column="goods_name" />
  15. <result property="packageName" column="package_name" />
  16. <result property="cntrName" column="cntr_name" />
  17. <result property="fileName" column="file_name" />
  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. </resultMap>
  24. <sql id="selectTTemporaryFileVo">
  25. select f_id, f_cntrno, f_sealno, f_goodsid, f_packageid, f_cntrid, f_cntrweight, goods_name, package_name, cntr_name, file_name, create_by, create_time, update_by, update_time, remark from t_temporary_file
  26. </sql>
  27. <select id="selectTTemporaryFileList" parameterType="TTemporaryFile" resultMap="TTemporaryFileResult">
  28. <include refid="selectTTemporaryFileVo"/>
  29. <where>
  30. <if test="fCntrno != null and fCntrno != ''"> and f_cntrno = #{fCntrno}</if>
  31. <if test="fSealno != null and fSealno != ''"> and f_sealno = #{fSealno}</if>
  32. <if test="fGoodsid != null "> and f_goodsid = #{fGoodsid}</if>
  33. <if test="fPackageid != null and fPackageid != ''"> and f_packageid = #{fPackageid}</if>
  34. <if test="fCntrid != null "> and f_cntrid = #{fCntrid}</if>
  35. <if test="fCntrweight != null "> and f_cntrweight = #{fCntrweight}</if>
  36. <if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
  37. <if test="packageName != null and packageName != ''"> and package_name like concat('%', #{packageName}, '%')</if>
  38. <if test="cntrName != null and cntrName != ''"> and cntr_name like concat('%', #{cntrName}, '%')</if>
  39. <if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
  40. </where>
  41. </select>
  42. <select id="selectTTemporaryFileById" parameterType="Long" resultMap="TTemporaryFileResult">
  43. <include refid="selectTTemporaryFileVo"/>
  44. where f_id = #{fId}
  45. </select>
  46. <insert id="insertTTemporaryFile" parameterType="TTemporaryFile" useGeneratedKeys="true" keyProperty="fId">
  47. insert into t_temporary_file
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="fCntrno != null">f_cntrno,</if>
  50. <if test="fSealno != null">f_sealno,</if>
  51. <if test="fGoodsid != null">f_goodsid,</if>
  52. <if test="fPackageid != null">f_packageid,</if>
  53. <if test="fCntrid != null">f_cntrid,</if>
  54. <if test="fCntrweight != null">f_cntrweight,</if>
  55. <if test="goodsName != null">goods_name,</if>
  56. <if test="packageName != null">package_name,</if>
  57. <if test="cntrName != null">cntr_name,</if>
  58. <if test="fileName != null">file_name,</if>
  59. <if test="createBy != null">create_by,</if>
  60. <if test="createTime != null">create_time,</if>
  61. <if test="updateBy != null">update_by,</if>
  62. <if test="updateTime != null">update_time,</if>
  63. <if test="remark != null">remark,</if>
  64. </trim>
  65. <trim prefix="values (" suffix=")" suffixOverrides=",">
  66. <if test="fCntrno != null">#{fCntrno},</if>
  67. <if test="fSealno != null">#{fSealno},</if>
  68. <if test="fGoodsid != null">#{fGoodsid},</if>
  69. <if test="fPackageid != null">#{fPackageid},</if>
  70. <if test="fCntrid != null">#{fCntrid},</if>
  71. <if test="fCntrweight != null">#{fCntrweight},</if>
  72. <if test="goodsName != null">#{goodsName},</if>
  73. <if test="packageName != null">#{packageName},</if>
  74. <if test="cntrName != null">#{cntrName},</if>
  75. <if test="fileName != null">#{fileName},</if>
  76. <if test="createBy != null">#{createBy},</if>
  77. <if test="createTime != null">#{createTime},</if>
  78. <if test="updateBy != null">#{updateBy},</if>
  79. <if test="updateTime != null">#{updateTime},</if>
  80. <if test="remark != null">#{remark},</if>
  81. </trim>
  82. </insert>
  83. <update id="updateTTemporaryFile" parameterType="TTemporaryFile">
  84. update t_temporary_file
  85. <trim prefix="SET" suffixOverrides=",">
  86. <if test="fCntrno != null">f_cntrno = #{fCntrno},</if>
  87. <if test="fSealno != null">f_sealno = #{fSealno},</if>
  88. <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
  89. <if test="fPackageid != null">f_packageid = #{fPackageid},</if>
  90. <if test="fCntrid != null">f_cntrid = #{fCntrid},</if>
  91. <if test="fCntrweight != null">f_cntrweight = #{fCntrweight},</if>
  92. <if test="goodsName != null">goods_name = #{goodsName},</if>
  93. <if test="packageName != null">package_name = #{packageName},</if>
  94. <if test="cntrName != null">cntr_name = #{cntrName},</if>
  95. <if test="fileName != null">file_name = #{fileName},</if>
  96. <if test="createBy != null">create_by = #{createBy},</if>
  97. <if test="createTime != null">create_time = #{createTime},</if>
  98. <if test="updateBy != null">update_by = #{updateBy},</if>
  99. <if test="updateTime != null">update_time = #{updateTime},</if>
  100. <if test="remark != null">remark = #{remark},</if>
  101. </trim>
  102. where f_id = #{fId}
  103. </update>
  104. <delete id="deleteTTemporaryFileById" parameterType="Long">
  105. delete from t_temporary_file where f_id = #{fId}
  106. </delete>
  107. <delete id="deleteTTemporaryFilefileName" parameterType="string">
  108. delete from t_temporary_file where file_name = #{fileName} and create_by = #{createBy}
  109. </delete>
  110. <delete id="deleteTTemporaryFileByIds" parameterType="String">
  111. delete from t_temporary_file where f_id in
  112. <foreach item="fId" collection="array" open="(" separator="," close=")">
  113. #{fId}
  114. </foreach>
  115. </delete>
  116. <select id="selectTTemporaryFileMessage" parameterType="TTemporaryFile" resultType="com.ruoyi.shipping.domain.TTemporaryFile">
  117. SELECT
  118. tf.f_id AS fId,
  119. tf.f_cntrno AS fCntrno,
  120. tf.f_sealno AS fSealno,
  121. IFNULL(tg.f_id,0) AS fGoodsid,
  122. sd.dict_value AS fPackageid,
  123. tc.f_id AS fCntrid,
  124. tf.f_cntrweight AS fCntrweight,
  125. tf.goods_name AS goodsName,
  126. tf.package_name AS packageName,
  127. tf.cntr_name AS cntrName,
  128. tf.file_name AS fileName,
  129. tf.create_by AS createBy,
  130. tf.create_time AS createTime,
  131. tf.update_by AS updateBy,
  132. tf.update_time AS updateTime,
  133. tf.remark AS remark
  134. FROM
  135. t_temporary_file tf
  136. LEFT JOIN t_goods tg ON tf.goods_name = tg.f_name
  137. LEFT JOIN sys_dict_data sd ON sd.dict_label = tf.package_name
  138. AND sd.dict_type = 'f_packageid'
  139. LEFT JOIN t_cntr tc ON tc.f_no = tf.cntr_name
  140. <where>
  141. <if test="fCntrno != null and fCntrno != ''"> and tf.f_cntrno = #{fCntrno}</if>
  142. <if test="fSealno != null and fSealno != ''"> and tf.f_sealno = #{fSealno}</if>
  143. <if test="fGoodsid != null "> and tf.f_goodsid = #{fGoodsid}</if>
  144. <if test="fPackageid != null and fPackageid != ''"> and tf.f_packageid = #{fPackageid}</if>
  145. <if test="fCntrid != null "> and tf.f_cntrid = #{fCntrid}</if>
  146. <if test="fCntrweight != null "> and tf.f_cntrweight = #{fCntrweight}</if>
  147. <if test="goodsName != null and goodsName != ''"> and tf.goods_name like concat('%', #{goodsName}, '%')</if>
  148. <if test="packageName != null and packageName != ''"> and tf.package_name like concat('%', #{packageName}, '%')</if>
  149. <if test="cntrName != null and cntrName != ''"> and tf.cntr_name like concat('%', #{cntrName}, '%')</if>
  150. <if test="fileName != null and fileName != ''"> and tf.file_name = #{fileName}</if>
  151. <if test="createBy != null and createBy != ''">and tf.create_by = #{createBy}</if>
  152. </where>
  153. ORDER BY tf.f_cntrno
  154. </select>
  155. </mapper>