TVesselMapper.xml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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.TVesselMapper">
  6. <resultMap type="TVessel" id="TVesselResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fNo" column="f_no"/>
  9. <result property="fName" column="f_name"/>
  10. <result property="fEname" column="f_ename"/>
  11. <result property="fImo" column="f_imo"/>
  12. <result property="fOwer" column="f_ower"/>
  13. <result property="fManage" column="f_manage"/>
  14. <result property="fNationality" column="f_nationality"/>
  15. <result property="fRegistry" column="f_registry"/>
  16. <result property="fDateofdelivery" column="f_dateofdelivery"/>
  17. <result property="fWeight" column="f_weight"/>
  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. </resultMap>
  25. <sql id="selectTVesselVo">
  26. select f_id, f_no, f_name, f_ename, f_imo, f_ower, f_manage, f_nationality, f_registry, f_dateofdelivery, f_weight, case when f_status = 'T' then '正常' else '停用' end as f_status, create_by, create_time, update_by, update_time, remark from t_vessel
  27. </sql>
  28. <select id="selectTVesselList" parameterType="TVessel" resultMap="TVesselResult">
  29. <include refid="selectTVesselVo"/>
  30. <where>
  31. <if test="fNo != null and fNo != ''">and f_no = #{fNo}</if>
  32. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  33. <if test="fEname != null and fEname != ''">and f_ename like concat('%', #{fEname}, '%')</if>
  34. <if test="fImo != null and fImo != ''">and f_imo = #{fImo}</if>
  35. <if test="fOwer != null and fOwer != ''">and f_ower = #{fOwer}</if>
  36. <if test="fManage != null and fManage != ''">and f_manage = #{fManage}</if>
  37. <if test="fNationality != null and fNationality != ''">and f_nationality = #{fNationality}</if>
  38. <if test="fRegistry != null and fRegistry != ''">and f_registry = #{fRegistry}</if>
  39. <if test="fDateofdelivery != null ">and f_dateofdelivery = #{fDateofdelivery}</if>
  40. <if test="fWeight != null ">and f_weight = #{fWeight}</if>
  41. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  42. <if test="createBy != null and createBy != ''">and create_by like concat('%', #{createBy}, '%')</if>
  43. <if test="remark != null and remark != ''">and remark like concat('%', #{remark}, '%')</if>
  44. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  45. and create_time &gt;= #{cLoadDate[0]}
  46. </if>
  47. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  48. and create_time &lt;= #{cLoadDate[1]}
  49. </if>
  50. </where>
  51. </select>
  52. <select id="selectTVesselById" parameterType="Long" resultMap="TVesselResult">
  53. <include refid="selectTVesselVo"/>
  54. where f_id = #{fId}
  55. </select>
  56. <insert id="insertTVessel" parameterType="TVessel" useGeneratedKeys="true" keyProperty="fId">
  57. insert into t_vessel
  58. <trim prefix="(" suffix=")" suffixOverrides=",">
  59. <if test="fNo != null and fNo != ''">f_no,</if>
  60. <if test="fName != null and fName != ''">f_name,</if>
  61. <if test="fEname != null and fEname != ''">f_ename,</if>
  62. <if test="fImo != null and fImo != ''">f_imo,</if>
  63. <if test="fOwer != null">f_ower,</if>
  64. <if test="fManage != null">f_manage,</if>
  65. <if test="fNationality != null">f_nationality,</if>
  66. <if test="fRegistry != null">f_registry,</if>
  67. <if test="fDateofdelivery != null">f_dateofdelivery,</if>
  68. <if test="fWeight != null">f_weight,</if>
  69. <if test="fStatus != null">f_status,</if>
  70. <if test="createBy != null">create_by,</if>
  71. <if test="createTime != null">create_time,</if>
  72. <if test="updateBy != null">update_by,</if>
  73. <if test="updateTime != null">update_time,</if>
  74. <if test="remark != null">remark,</if>
  75. </trim>
  76. <trim prefix="values (" suffix=")" suffixOverrides=",">
  77. <if test="fNo != null and fNo != ''">#{fNo},</if>
  78. <if test="fName != null and fName != ''">#{fName},</if>
  79. <if test="fEname != null and fEname != ''">#{fEname},</if>
  80. <if test="fImo != null and fImo != ''">#{fImo},</if>
  81. <if test="fOwer != null">#{fOwer},</if>
  82. <if test="fManage != null">#{fManage},</if>
  83. <if test="fNationality != null">#{fNationality},</if>
  84. <if test="fRegistry != null">#{fRegistry},</if>
  85. <if test="fDateofdelivery != null">#{fDateofdelivery},</if>
  86. <if test="fWeight != null">#{fWeight},</if>
  87. <if test="fStatus != null">#{fStatus},</if>
  88. <if test="createBy != null">#{createBy},</if>
  89. <if test="createTime != null">#{createTime},</if>
  90. <if test="updateBy != null">#{updateBy},</if>
  91. <if test="updateTime != null">#{updateTime},</if>
  92. <if test="remark != null">#{remark},</if>
  93. </trim>
  94. </insert>
  95. <update id="updateTVessel" parameterType="TVessel">
  96. update t_vessel
  97. <trim prefix="SET" suffixOverrides=",">
  98. <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
  99. <if test="fName != null and fName != ''">f_name = #{fName},</if>
  100. <if test="fEname != null and fEname != ''">f_ename = #{fEname},</if>
  101. <if test="fImo != null and fImo != ''">f_imo = #{fImo},</if>
  102. <if test="fOwer != null">f_ower = #{fOwer},</if>
  103. <if test="fManage != null">f_manage = #{fManage},</if>
  104. <if test="fNationality != null">f_nationality = #{fNationality},</if>
  105. <if test="fRegistry != null">f_registry = #{fRegistry},</if>
  106. <if test="fDateofdelivery != null">f_dateofdelivery = #{fDateofdelivery},</if>
  107. <if test="fWeight != null">f_weight = #{fWeight},</if>
  108. <if test="fStatus != null">f_status = #{fStatus},</if>
  109. <if test="createBy != null">create_by = #{createBy},</if>
  110. <if test="createTime != null">create_time = #{createTime},</if>
  111. <if test="updateBy != null">update_by = #{updateBy},</if>
  112. <if test="updateTime != null">update_time = #{updateTime},</if>
  113. <if test="remark != null">remark = #{remark},</if>
  114. </trim>
  115. where f_id = #{fId}
  116. </update>
  117. <delete id="deleteTVesselById" parameterType="Long">
  118. delete from t_vessel where f_id = #{fId}
  119. </delete>
  120. <delete id="deleteTVesselByIds" parameterType="String">
  121. delete from t_vessel where f_id in
  122. <foreach item="fId" collection="array" open="(" separator="," close=")">
  123. #{fId}
  124. </foreach>
  125. </delete>
  126. <select id="selectTVesselfNo" parameterType="TVessel" resultMap="TVesselResult">
  127. SELECT
  128. f_id,
  129. f_no
  130. FROM
  131. t_vessel
  132. WHERE
  133. f_no = #{fNo}
  134. </select>
  135. <select id="selectTVesselfName" parameterType="TVessel" resultMap="TVesselResult">
  136. SELECT
  137. f_id,
  138. f_name
  139. FROM
  140. t_vessel
  141. WHERE
  142. f_name = #{fName}
  143. </select>
  144. <select id="selectTVesselfEname" parameterType="TVessel" resultMap="TVesselResult">
  145. SELECT
  146. f_id,
  147. f_ename
  148. FROM
  149. t_vessel
  150. WHERE
  151. f_ename = #{fEname}
  152. </select>
  153. <select id="selectTVesselfImo" parameterType="TVessel" resultMap="TVesselResult">
  154. SELECT
  155. f_id,
  156. f_imo
  157. FROM
  158. t_vessel
  159. WHERE
  160. f_imo = #{fImo}
  161. </select>
  162. <select id="selectTVesselfNumber" resultType="map">
  163. SELECT
  164. f_id fId,
  165. f_name fName
  166. FROM
  167. t_vessel
  168. WHERE
  169. f_status = 'T'
  170. <if test="fName != null and fName != ''">
  171. and f_name like concat('%', #{fName}, '%')
  172. </if>
  173. </select>
  174. </mapper>