WatershedModelMapper.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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="rotationX" column="rotation_x" />
  20. <result property="rotationY" column="rotation_y" />
  21. <result property="rotationZ" column="rotation_z" />
  22. <result property="scaleX" column="scale_x" />
  23. <result property="scaleY" column="scale_y" />
  24. <result property="scaleZ" column="scale_z" />
  25. <result property="createBy" column="create_by" />
  26. <result property="createTime" column="create_time" />
  27. <result property="updateBy" column="update_by" />
  28. <result property="updateTime" column="update_time" />
  29. <result property="remark" column="remark" />
  30. </resultMap>
  31. <sql id="selectWatershedModelVo">
  32. select model_id, model_name, description, category, subcategory, model_type, model_format, file_path, file_size, upload_unit, status, model_coordinates, rotation_x, rotation_y, rotation_z, scale_x, scale_y, scale_z, create_by, create_time, update_by, update_time, remark from watershed_model
  33. </sql>
  34. <select id="selectWatershedModelByModelId" parameterType="Long" resultMap="WatershedModelResult">
  35. <include refid="selectWatershedModelVo"/>
  36. where model_id = #{modelId}
  37. </select>
  38. <select id="selectWatershedModelList" parameterType="com.ruoyi.system.domain.WatershedModel" resultMap="WatershedModelResult">
  39. <include refid="selectWatershedModelVo"/>
  40. <where>
  41. <if test="modelName != null and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
  42. <if test="description != null and description != ''"> and description like concat('%', #{description}, '%')</if>
  43. <if test="category != null and category != ''"> and category = #{category}</if>
  44. <if test="subcategory != null and subcategory != ''"> and subcategory = #{subcategory}</if>
  45. <if test="modelType != null and modelType != ''"> and model_type = #{modelType}</if>
  46. <if test="modelFormat != null and modelFormat != ''"> and model_format = #{modelFormat}</if>
  47. <if test="uploadUnit != null and uploadUnit != ''"> and upload_unit = #{uploadUnit}</if>
  48. <if test="status != null and status != ''"> and status = #{status}</if>
  49. <if test="modelCoordinates != null and modelCoordinates != ''"> and model_coordinates like concat('%', #{modelCoordinates}, '%')</if>
  50. </where>
  51. </select>
  52. <insert id="insertWatershedModel" parameterType="com.ruoyi.system.domain.WatershedModel" useGeneratedKeys="true" keyProperty="modelId">
  53. insert into watershed_model
  54. <trim prefix="(" suffix=")" suffixOverrides=",">
  55. <if test="modelName != null and modelName != ''">model_name,</if>
  56. <if test="description != null and description != ''">description,</if>
  57. <if test="category != null and category != ''">category,</if>
  58. <if test="subcategory != null and subcategory != ''">subcategory,</if>
  59. <if test="modelType != null and modelType != ''">model_type,</if>
  60. <if test="modelFormat != null and modelFormat != ''">model_format,</if>
  61. <if test="filePath != null and filePath != ''">file_path,</if>
  62. <if test="fileSize != null">file_size,</if>
  63. <if test="uploadUnit != null and uploadUnit != ''">upload_unit,</if>
  64. <if test="status != null and status != ''">status,</if>
  65. <if test="modelCoordinates != null and modelCoordinates != ''">model_coordinates,</if>
  66. <if test="rotationX != null">rotation_x,</if>
  67. <if test="rotationY != null">rotation_y,</if>
  68. <if test="rotationZ != null">rotation_z,</if>
  69. <if test="scaleX != null">scale_x,</if>
  70. <if test="scaleY != null">scale_y,</if>
  71. <if test="scaleZ != null">scale_z,</if>
  72. <if test="createBy != null and createBy != ''">create_by,</if>
  73. <if test="createTime != null">create_time,</if>
  74. <if test="updateBy != null and updateBy != ''">update_by,</if>
  75. <if test="updateTime != null">update_time,</if>
  76. <if test="remark != null and remark != ''">remark,</if>
  77. </trim>
  78. <trim prefix="values (" suffix=")" suffixOverrides=",">
  79. <if test="modelName != null and modelName != ''">#{modelName},</if>
  80. <if test="description != null and description != ''">#{description},</if>
  81. <if test="category != null and category != ''">#{category},</if>
  82. <if test="subcategory != null and subcategory != ''">#{subcategory},</if>
  83. <if test="modelType != null and modelType != ''">#{modelType},</if>
  84. <if test="modelFormat != null and modelFormat != ''">#{modelFormat},</if>
  85. <if test="filePath != null and filePath != ''">#{filePath},</if>
  86. <if test="fileSize != null">#{fileSize},</if>
  87. <if test="uploadUnit != null and uploadUnit != ''">#{uploadUnit},</if>
  88. <if test="status != null and status != ''">#{status},</if>
  89. <if test="modelCoordinates != null and modelCoordinates != ''">#{modelCoordinates},</if>
  90. <if test="rotationX != null">#{rotationX},</if>
  91. <if test="rotationY != null">#{rotationY},</if>
  92. <if test="rotationZ != null">#{rotationZ},</if>
  93. <if test="scaleX != null">#{scaleX},</if>
  94. <if test="scaleY != null">#{scaleY},</if>
  95. <if test="scaleZ != null">#{scaleZ},</if>
  96. <if test="createBy != null and createBy != ''">#{createBy},</if>
  97. <if test="createTime != null">#{createTime},</if>
  98. <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
  99. <if test="updateTime != null">#{updateTime},</if>
  100. <if test="remark != null and remark != ''">#{remark},</if>
  101. </trim>
  102. </insert>
  103. <update id="updateWatershedModel" parameterType="com.ruoyi.system.domain.WatershedModel">
  104. update watershed_model
  105. <trim prefix="SET" suffixOverrides=",">
  106. <if test="modelName != null and modelName != ''">model_name = #{modelName},</if>
  107. <if test="description != null and description != ''">description = #{description},</if>
  108. <if test="category != null and category != ''">category = #{category},</if>
  109. <if test="subcategory != null and subcategory != ''">subcategory = #{subcategory},</if>
  110. <if test="modelType != null and modelType != ''">model_type = #{modelType},</if>
  111. <if test="modelFormat != null and modelFormat != ''">model_format = #{modelFormat},</if>
  112. <if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
  113. <if test="fileSize != null">file_size = #{fileSize},</if>
  114. <if test="uploadUnit != null and uploadUnit != ''">upload_unit = #{uploadUnit},</if>
  115. <if test="status != null and status != ''">status = #{status},</if>
  116. <if test="modelCoordinates != null and modelCoordinates != ''">model_coordinates = #{modelCoordinates},</if>
  117. <if test="rotationX != null">rotation_x = #{rotationX},</if>
  118. <if test="rotationY != null">rotation_y = #{rotationY},</if>
  119. <if test="rotationZ != null">rotation_z = #{rotationZ},</if>
  120. <if test="scaleX != null">scale_x = #{scaleX},</if>
  121. <if test="scaleY != null">scale_y = #{scaleY},</if>
  122. <if test="scaleZ != null">scale_z = #{scaleZ},</if>
  123. <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
  124. <if test="createTime != null">create_time = #{createTime},</if>
  125. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  126. <if test="updateTime != null">update_time = #{updateTime},</if>
  127. <if test="remark != null and remark != ''">remark = #{remark},</if>
  128. </trim>
  129. where model_id = #{modelId}
  130. </update>
  131. <delete id="deleteWatershedModelByModelId" parameterType="Long">
  132. delete from watershed_model where model_id = #{modelId}
  133. </delete>
  134. <delete id="deleteWatershedModelByModelIds" parameterType="String">
  135. delete from watershed_model where model_id in
  136. <foreach item="modelId" collection="array" open="(" separator="," close=")">
  137. #{modelId}
  138. </foreach>
  139. </delete>
  140. </mapper>