电速宝智配引擎
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

PropertyMapper.xml 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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.PropertyMapper">
  6. <resultMap type="Property" id="PropertyResult">
  7. <id property="id" column="id"/>
  8. <result property="productId" column="product_id"/>
  9. <result property="name" column="name"/>
  10. <result property="count" column="count"/>
  11. <result property="unitprice" column="unitprice"/>
  12. <result property="wholesale" column="wholesale"/>
  13. <result property="installationCost" column="installation_cost"/>
  14. <result property="opCost" column="op_cost"/>
  15. <result property="warrantyPeriod" column="warranty_period"/>
  16. <result property="extendedWarrantyPrice" column="extended_warranty_price"/>
  17. <result property="expectedServiceLife" column="expected_service_life"/>
  18. <result property="depreciationRate" column="depreciation_rate"/>
  19. <result property="brand" column="brand"/>
  20. <result property="productSpecifications" column="product_specifications"/>
  21. <result property="createBy" column="create_by"/>
  22. <result property="createTime" column="create_time"/>
  23. <result property="updateBy" column="update_by"/>
  24. <result property="updateTime" column="update_time"/>
  25. </resultMap>
  26. <sql id="selectPropertyVo">
  27. select id, product_id, name, count, unitprice, wholesale, installation_cost, op_cost, warranty_period,
  28. extended_warranty_price, expected_service_life, depreciation_rate, brand, product_specifications,
  29. create_by, create_time, update_by, update_time
  30. from property
  31. </sql>
  32. <select id="selectPropertyList" parameterType="Property" resultMap="PropertyResult">
  33. <include refid="selectPropertyVo"/>
  34. <where>
  35. <if test="productId != null and productId != ''">
  36. AND product_id = #{productId}
  37. </if>
  38. <if test="name != null and name != ''">
  39. AND name like concat('%', #{name}, '%')
  40. </if>
  41. <if test="brand != null and brand != ''">
  42. AND brand like concat('%', #{brand}, '%')
  43. </if>
  44. <if test="params.beginTime != null and params.beginTime != ''">
  45. and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
  46. </if>
  47. <if test="params.endTime != null and params.endTime != ''">
  48. and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
  49. </if>
  50. </where>
  51. </select>
  52. <select id="selectPropertyById" parameterType="Long" resultMap="PropertyResult">
  53. <include refid="selectPropertyVo"/>
  54. where id = #{id}
  55. </select>
  56. <insert id="insertProperty" parameterType="Property">
  57. insert into property (
  58. <if test="productId != null and productId != ''">product_id,</if>
  59. <if test="name != null and name != ''">name,</if>
  60. <if test="count != null">count,</if>
  61. <if test="unitprice != null">unitprice,</if>
  62. <if test="wholesale != null">wholesale,</if>
  63. <if test="installationCost != null">installation_cost,</if>
  64. <if test="opCost != null">op_cost,</if>
  65. <if test="warrantyPeriod != null and warrantyPeriod != ''">warranty_period,</if>
  66. <if test="extendedWarrantyPrice != null">extended_warranty_price,</if>
  67. <if test="expectedServiceLife != null and expectedServiceLife != ''">expected_service_life,</if>
  68. <if test="depreciationRate != null">depreciation_rate,</if>
  69. <if test="brand != null and brand != ''">brand,</if>
  70. <if test="productSpecifications != null and productSpecifications != ''">product_specifications,</if>
  71. <if test="createBy != null and createBy != ''">create_by,</if>
  72. create_time
  73. )values(
  74. <if test="productId != null and productId != ''">#{productId},</if>
  75. <if test="name != null and name != ''">#{name},</if>
  76. <if test="count != null">#{count},</if>
  77. <if test="unitprice != null">#{unitprice},</if>
  78. <if test="wholesale != null">#{wholesale},</if>
  79. <if test="installationCost != null">#{installationCost},</if>
  80. <if test="opCost != null">#{opCost},</if>
  81. <if test="warrantyPeriod != null and warrantyPeriod != ''">#{warrantyPeriod},</if>
  82. <if test="extendedWarrantyPrice != null">#{extendedWarrantyPrice},</if>
  83. <if test="expectedServiceLife != null and expectedServiceLife != ''">#{expectedServiceLife},</if>
  84. <if test="depreciationRate != null">#{depreciationRate},</if>
  85. <if test="brand != null and brand != ''">#{brand},</if>
  86. <if test="productSpecifications != null and productSpecifications != ''">#{productSpecifications},</if>
  87. <if test="createBy != null and createBy != ''">#{createBy},</if>
  88. sysdate()
  89. )
  90. </insert>
  91. <update id="updateProperty" parameterType="Property">
  92. update property
  93. <set>
  94. <if test="productId != null and productId != ''">product_id = #{productId},</if>
  95. <if test="name != null and name != ''">name = #{name},</if>
  96. <if test="count != null">count = #{count},</if>
  97. <if test="unitprice != null">unitprice = #{unitprice},</if>
  98. <if test="wholesale != null">wholesale = #{wholesale},</if>
  99. <if test="installationCost != null">installation_cost = #{installationCost},</if>
  100. <if test="opCost != null">op_cost = #{opCost},</if>
  101. <if test="warrantyPeriod != null and warrantyPeriod != ''">warranty_period = #{warrantyPeriod},</if>
  102. <if test="extendedWarrantyPrice != null">extended_warranty_price = #{extendedWarrantyPrice},</if>
  103. <if test="expectedServiceLife != null and expectedServiceLife != ''">expected_service_life = #{expectedServiceLife},</if>
  104. <if test="depreciationRate != null">depreciation_rate = #{depreciationRate},</if>
  105. <if test="brand != null and brand != ''">brand = #{brand},</if>
  106. <if test="productSpecifications != null and productSpecifications != ''">product_specifications = #{productSpecifications},</if>
  107. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  108. update_time = sysdate()
  109. </set>
  110. where id = #{id}
  111. </update>
  112. <delete id="deletePropertyById" parameterType="Long">
  113. delete from property where id = #{id}
  114. </delete>
  115. <delete id="deletePropertyByIds" parameterType="Long">
  116. delete from property where id in
  117. <foreach item="id" collection="array" open="(" separator="," close=")">
  118. #{id}
  119. </foreach>
  120. </delete>
  121. </mapper>