ShipArchivesMapper.xml 5.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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="cn.com.taiji.beidou.ship.archives.mapper.ShipArchivesMapper">
  6. <resultMap type="shipArchivesData" id="ShipResult">
  7. <id property="shipId" column="ship_id" />
  8. <result property="devideNo" column="devide_no" />
  9. <result property="shipType" column="ship_type" />
  10. <result property="jobType" column="job_type" />
  11. <result property="jobWay" column="job_way" />
  12. <result property="ownerName" column="owner_name" />
  13. <result property="ownerTelNo" column="owner_tel_no" />
  14. <result property="shipLength" column="ship_length" />
  15. <result property="shipWidth" column="ship_width" />
  16. <result property="shipMaterial" column="ship_material" />
  17. <result property="policeStationId" column="police_station_id" />
  18. <result property="ownerCompany" column="owner_company" />
  19. <result property="createTime" column="create_time" />
  20. <result property="modifyTime" column="modify_time" />
  21. <result property="ownerType" column="owner_type" />
  22. </resultMap>
  23. <select id="selectByDevideNo" parameterType="string" resultMap="ShipResult">
  24. select * from bd_ship_archives where devide_no=#{devideNo}
  25. </select>
  26. <update id="updateById" parameterType="shipArchivesData" >
  27. update bd_ship_archives
  28. <set>
  29. <if test="shipId != null and shipId != ''">ship_id = #{shipId},</if>
  30. <if test="shipType != null and shipType != ''">ship_type = #{shipType},</if>
  31. <if test="jobType != null and jobType != ''">job_type = #{jobType},</if>
  32. <if test="jobWay != null and jobWay != ''">job_way = #{jobWay},</if>
  33. <if test="ownerName != null and ownerName != ''">owner_name = #{ownerName},</if>
  34. <if test="ownerTelNo != null and ownerTelNo != ''">owner_tel_no = #{ownerTelNo},</if>
  35. <if test="shipLength != null">ship_length = #{shipLength},</if>
  36. <if test="shipWidth != null">ship_width = #{shipWidth},</if>
  37. <if test="shipMaterial != null">ship_material = #{shipMaterial},</if>
  38. <if test="policeStationId != null and policeStationId != ''">police_station_id = #{policeStationId},</if>
  39. <if test="ownerCompany != null and ownerCompany != ''">owner_company = #{ownerCompany},</if>
  40. <if test="createTime != null">create_time = #{createTime},</if>
  41. <if test="modifyTime != null">modify_time = #{modifyTime},</if>
  42. <if test="ownerType != null and ownerType != ''">owner_type = #{ownerType}</if>
  43. </set>
  44. where devide_no = #{devideNo}
  45. </update>
  46. <insert id="insertShip" parameterType="shipArchivesData">
  47. insert into bd_ship_archives (
  48. <if test="shipId != null and shipId != ''">ship_id,</if>
  49. <if test="devideNo != null and devideNo != ''">devide_no,</if>
  50. <if test="shipType != null and shipType != ''">ship_type,</if>
  51. <if test="jobType != null and jobType != ''">job_type,</if>
  52. <if test="jobWay != null and jobWay != ''">job_way,</if>
  53. <if test="ownerName != null and ownerName != ''">owner_name,</if>
  54. <if test="ownerTelNo != null and ownerTelNo != ''">owner_tel_no,</if>
  55. <if test="shipLength != null">ship_length,</if>
  56. <if test="shipWidth != null">ship_width,</if>
  57. <if test="shipMaterial != null">ship_material,</if>
  58. <if test="policeStationId != null and policeStationId != ''">police_station_id,</if>
  59. <if test="ownerCompany != null and ownerCompany != ''">owner_company,</if>
  60. <if test="createTime != null">create_time,</if>
  61. <if test="modifyTime != null">modify_time,</if>
  62. <if test="ownerType != null and ownerType != ''">owner_type</if>
  63. )values(
  64. <if test="shipId != null and shipId != ''">#{shipId},</if>
  65. <if test="devideNo != null and devideNo != ''">#{devideNo},</if>
  66. <if test="shipType != null and shipType != ''">#{shipType},</if>
  67. <if test="jobType != null and jobType != ''">#{jobType},</if>
  68. <if test="jobWay != null and jobWay != ''">#{jobWay},</if>
  69. <if test="ownerName != null and ownerName != ''">#{ownerName},</if>
  70. <if test="ownerTelNo != null and ownerTelNo != ''">#{ownerTelNo},</if>
  71. <if test="shipLength != null">#{shipLength},</if>
  72. <if test="shipWidth != null">#{shipWidth},</if>
  73. <if test="shipMaterial != null">#{shipMaterial},</if>
  74. <if test="policeStationId != null and policeStationId != ''">#{policeStationId},</if>
  75. <if test="ownerCompany != null and ownerCompany != ''">#{ownerCompany},</if>
  76. <if test="createTime != null">#{createTime},</if>
  77. <if test="modifyTime != null">#{modifyTime},</if>
  78. <if test="ownerType != null and ownerType != ''">#{ownerType}</if>
  79. )
  80. </insert>
  81. <select id="selectShipArchivesList" parameterType="shipArchivesREQ" resultMap="ShipResult">
  82. select * from bd_ship_archives
  83. <where>
  84. <if test="shipType != null and shipType != ''">ship_type = #{shipType}</if>
  85. </where>
  86. </select>
  87. <select id="selectById" parameterType="string" resultMap="ShipResult">
  88. select * from bd_ship_archives where ship_id=#{shipId}
  89. </select>
  90. </mapper>