WatershedTyphoonMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.system.mapper.WatershedTyphoonMapper">
  6. <resultMap type="com.ruoyi.system.domain.WatershedTyphoon" id="WatershedTyphoonResult">
  7. <id property="typhoonId" column="typhoon_id" />
  8. <result property="typhoonName" column="typhoon_name" />
  9. <result property="typhoonCode" column="typhoon_code" />
  10. <result property="startTime" column="start_time" />
  11. <result property="endTime" column="end_time" />
  12. <result property="filePath" column="file_path" />
  13. <result property="fileSize" column="file_size" />
  14. <result property="uploadUnit" column="upload_unit" />
  15. <result property="status" column="status" />
  16. <result property="createBy" column="create_by" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateBy" column="update_by" />
  19. <result property="updateTime" column="update_time" />
  20. <result property="remark" column="remark" />
  21. </resultMap>
  22. <sql id="selectWatershedTyphoonVo">
  23. select typhoon_id, typhoon_name, typhoon_code, start_time, end_time, file_path, file_size, upload_unit, status, create_by, create_time, update_by, update_time, remark from watershed_typhoon
  24. </sql>
  25. <select id="selectWatershedTyphoonByTyphoonId" parameterType="Long" resultMap="WatershedTyphoonResult">
  26. <include refid="selectWatershedTyphoonVo"/>
  27. where typhoon_id = #{typhoonId}
  28. </select>
  29. <select id="selectWatershedTyphoonList" parameterType="com.ruoyi.system.domain.WatershedTyphoon" resultMap="WatershedTyphoonResult">
  30. <include refid="selectWatershedTyphoonVo"/>
  31. <where>
  32. <if test="typhoonName != null and typhoonName != ''"> and typhoon_name like concat('%', #{typhoonName}, '%')</if>
  33. <if test="typhoonCode != null and typhoonCode != ''"> and typhoon_code = #{typhoonCode}</if>
  34. <if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
  35. <if test="endTime != null and endTime != ''"> and end_time = #{endTime}</if>
  36. <if test="uploadUnit != null and uploadUnit != ''"> and upload_unit = #{uploadUnit}</if>
  37. <if test="status != null and status != ''"> and status = #{status}</if>
  38. </where>
  39. </select>
  40. <insert id="insertWatershedTyphoon" parameterType="com.ruoyi.system.domain.WatershedTyphoon" useGeneratedKeys="true" keyProperty="typhoonId">
  41. insert into watershed_typhoon
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="typhoonName != null and typhoonName != ''">typhoon_name,</if>
  44. <if test="typhoonCode != null and typhoonCode != ''">typhoon_code,</if>
  45. <if test="startTime != null and startTime != ''">start_time,</if>
  46. <if test="endTime != null and endTime != ''">end_time,</if>
  47. <if test="filePath != null and filePath != ''">file_path,</if>
  48. <if test="fileSize != null">file_size,</if>
  49. <if test="uploadUnit != null and uploadUnit != ''">upload_unit,</if>
  50. <if test="status != null and status != ''">status,</if>
  51. <if test="createBy != null and createBy != ''">create_by,</if>
  52. <if test="createTime != null">create_time,</if>
  53. <if test="updateBy != null and updateBy != ''">update_by,</if>
  54. <if test="updateTime != null">update_time,</if>
  55. <if test="remark != null and remark != ''">remark,</if>
  56. </trim>
  57. <trim prefix="values (" suffix=")" suffixOverrides=",">
  58. <if test="typhoonName != null and typhoonName != ''">#{typhoonName},</if>
  59. <if test="typhoonCode != null and typhoonCode != ''">#{typhoonCode},</if>
  60. <if test="startTime != null and startTime != ''">#{startTime},</if>
  61. <if test="endTime != null and endTime != ''">#{endTime},</if>
  62. <if test="filePath != null and filePath != ''">#{filePath},</if>
  63. <if test="fileSize != null">#{fileSize},</if>
  64. <if test="uploadUnit != null and uploadUnit != ''">#{uploadUnit},</if>
  65. <if test="status != null and status != ''">#{status},</if>
  66. <if test="createBy != null and createBy != ''">#{createBy},</if>
  67. <if test="createTime != null">#{createTime},</if>
  68. <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
  69. <if test="updateTime != null">#{updateTime},</if>
  70. <if test="remark != null and remark != ''">#{remark},</if>
  71. </trim>
  72. </insert>
  73. <update id="updateWatershedTyphoon" parameterType="com.ruoyi.system.domain.WatershedTyphoon">
  74. update watershed_typhoon
  75. <trim prefix="SET" suffixOverrides=",">
  76. <if test="typhoonName != null and typhoonName != ''">typhoon_name = #{typhoonName},</if>
  77. <if test="typhoonCode != null and typhoonCode != ''">typhoon_code = #{typhoonCode},</if>
  78. <if test="startTime != null and startTime != ''">start_time = #{startTime},</if>
  79. <if test="endTime != null and endTime != ''">end_time = #{endTime},</if>
  80. <if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
  81. <if test="fileSize != null">file_size = #{fileSize},</if>
  82. <if test="uploadUnit != null and uploadUnit != ''">upload_unit = #{uploadUnit},</if>
  83. <if test="status != null and status != ''">status = #{status},</if>
  84. <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
  85. <if test="createTime != null">create_time = #{createTime},</if>
  86. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  87. <if test="updateTime != null">update_time = #{updateTime},</if>
  88. <if test="remark != null and remark != ''">remark = #{remark},</if>
  89. </trim>
  90. where typhoon_id = #{typhoonId}
  91. </update>
  92. <delete id="deleteWatershedTyphoonByTyphoonId" parameterType="Long">
  93. delete from watershed_typhoon where typhoon_id = #{typhoonId}
  94. </delete>
  95. <delete id="deleteWatershedTyphoonByTyphoonIds" parameterType="String">
  96. delete from watershed_typhoon where typhoon_id in
  97. <foreach item="typhoonId" collection="array" open="(" separator="," close=")">
  98. #{typhoonId}
  99. </foreach>
  100. </delete>
  101. </mapper>