WatershedModelMapper.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.WatershedModelMapper">
  6. <resultMap type="com.ruoyi.system.domain.WatershedModel" id="WatershedModelResult">
  7. <id property="modelId" column="model_id" />
  8. <result property="modelName" column="model_name" />
  9. <result property="description" column="description" />
  10. <result property="category" column="category" />
  11. <result property="subcategory" column="subcategory" />
  12. <result property="modelType" column="model_type" />
  13. <result property="modelFormat" column="model_format" />
  14. <result property="filePath" column="file_path" />
  15. <result property="fileSize" column="file_size" />
  16. <result property="uploadUnit" column="upload_unit" />
  17. <result property="status" column="status" />
  18. <result property="modelCoordinates" column="model_coordinates" />
  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="selectWatershedModelVo">
  26. select model_id, model_name, description, category, subcategory, model_type, model_format, file_path, file_size, upload_unit, status, model_coordinates, create_by, create_time, update_by, update_time, remark from watershed_model
  27. </sql>
  28. <select id="selectWatershedModelByModelId" parameterType="Long" resultMap="WatershedModelResult">
  29. <include refid="selectWatershedModelVo"/>
  30. where model_id = #{modelId}
  31. </select>
  32. <select id="selectWatershedModelList" parameterType="com.ruoyi.system.domain.WatershedModel" resultMap="WatershedModelResult">
  33. <include refid="selectWatershedModelVo"/>
  34. <where>
  35. <if test="modelName != null and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
  36. <if test="description != null and description != ''"> and description like concat('%', #{description}, '%')</if>
  37. <if test="category != null and category != ''"> and category = #{category}</if>
  38. <if test="subcategory != null and subcategory != ''"> and subcategory = #{subcategory}</if>
  39. <if test="modelType != null and modelType != ''"> and model_type = #{modelType}</if>
  40. <if test="modelFormat != null and modelFormat != ''"> and model_format = #{modelFormat}</if>
  41. <if test="uploadUnit != null and uploadUnit != ''"> and upload_unit = #{uploadUnit}</if>
  42. <if test="status != null and status != ''"> and status = #{status}</if>
  43. <if test="modelCoordinates != null and modelCoordinates != ''"> and model_coordinates like concat('%', #{modelCoordinates}, '%')</if>
  44. </where>
  45. </select>
  46. <insert id="insertWatershedModel" parameterType="com.ruoyi.system.domain.WatershedModel" useGeneratedKeys="true" keyProperty="modelId">
  47. insert into watershed_model
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="modelName != null and modelName != ''">model_name,</if>
  50. <if test="description != null and description != ''">description,</if>
  51. <if test="category != null and category != ''">category,</if>
  52. <if test="subcategory != null and subcategory != ''">subcategory,</if>
  53. <if test="modelType != null and modelType != ''">model_type,</if>
  54. <if test="modelFormat != null and modelFormat != ''">model_format,</if>
  55. <if test="filePath != null and filePath != ''">file_path,</if>
  56. <if test="fileSize != null">file_size,</if>
  57. <if test="uploadUnit != null and uploadUnit != ''">upload_unit,</if>
  58. <if test="status != null and status != ''">status,</if>
  59. <if test="modelCoordinates != null and modelCoordinates != ''">model_coordinates,</if>
  60. <if test="createBy != null and createBy != ''">create_by,</if>
  61. <if test="createTime != null">create_time,</if>
  62. <if test="updateBy != null and updateBy != ''">update_by,</if>
  63. <if test="updateTime != null">update_time,</if>
  64. <if test="remark != null and remark != ''">remark,</if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="modelName != null and modelName != ''">#{modelName},</if>
  68. <if test="description != null and description != ''">#{description},</if>
  69. <if test="category != null and category != ''">#{category},</if>
  70. <if test="subcategory != null and subcategory != ''">#{subcategory},</if>
  71. <if test="modelType != null and modelType != ''">#{modelType},</if>
  72. <if test="modelFormat != null and modelFormat != ''">#{modelFormat},</if>
  73. <if test="filePath != null and filePath != ''">#{filePath},</if>
  74. <if test="fileSize != null">#{fileSize},</if>
  75. <if test="uploadUnit != null and uploadUnit != ''">#{uploadUnit},</if>
  76. <if test="status != null and status != ''">#{status},</if>
  77. <if test="modelCoordinates != null and modelCoordinates != ''">#{modelCoordinates},</if>
  78. <if test="createBy != null and createBy != ''">#{createBy},</if>
  79. <if test="createTime != null">#{createTime},</if>
  80. <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
  81. <if test="updateTime != null">#{updateTime},</if>
  82. <if test="remark != null and remark != ''">#{remark},</if>
  83. </trim>
  84. </insert>
  85. <update id="updateWatershedModel" parameterType="com.ruoyi.system.domain.WatershedModel">
  86. update watershed_model
  87. <trim prefix="SET" suffixOverrides=",">
  88. <if test="modelName != null and modelName != ''">model_name = #{modelName},</if>
  89. <if test="description != null and description != ''">description = #{description},</if>
  90. <if test="category != null and category != ''">category = #{category},</if>
  91. <if test="subcategory != null and subcategory != ''">subcategory = #{subcategory},</if>
  92. <if test="modelType != null and modelType != ''">model_type = #{modelType},</if>
  93. <if test="modelFormat != null and modelFormat != ''">model_format = #{modelFormat},</if>
  94. <if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
  95. <if test="fileSize != null">file_size = #{fileSize},</if>
  96. <if test="uploadUnit != null and uploadUnit != ''">upload_unit = #{uploadUnit},</if>
  97. <if test="status != null and status != ''">status = #{status},</if>
  98. <if test="modelCoordinates != null and modelCoordinates != ''">model_coordinates = #{modelCoordinates},</if>
  99. <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
  100. <if test="createTime != null">create_time = #{createTime},</if>
  101. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  102. <if test="updateTime != null">update_time = #{updateTime},</if>
  103. <if test="remark != null and remark != ''">remark = #{remark},</if>
  104. </trim>
  105. where model_id = #{modelId}
  106. </update>
  107. <delete id="deleteWatershedModelByModelId" parameterType="Long">
  108. delete from watershed_model where model_id = #{modelId}
  109. </delete>
  110. <delete id="deleteWatershedModelByModelIds" parameterType="String">
  111. delete from watershed_model where model_id in
  112. <foreach item="modelId" collection="array" open="(" separator="," close=")">
  113. #{modelId}
  114. </foreach>
  115. </delete>
  116. </mapper>