MineralAggregateMapper.xml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.sckw.mine.mapper.MineralAggregateMapper">
  4. <sql id="Base_Column_List">
  5. id,
  6. tenant_id,
  7. `code`,
  8. `name`,
  9. type,
  10. unit,
  11. size,
  12. weight,
  13. `status`,
  14. `value`,
  15. create_by,
  16. update_by,
  17. create_time,
  18. update_time,
  19. del_flag
  20. </sql>
  21. <update id="aggreDelete">
  22. update kw_business_mineral_aggregate set del_flag = 1 where id = #{id}
  23. </update>
  24. <select id="mineAggregatePageList"
  25. resultType="com.sckw.mine.entity.res.MineralAggregateListRes">
  26. select <include refid="Base_Column_List" /> from kw_business_mineral_aggregate
  27. <where>
  28. del_flag = 0
  29. <if test="param.name != '' and param.name != null">
  30. and `name` like concat('%',#{param.name},'%')
  31. </if>
  32. <if test="param.code != '' and param.code != null">
  33. and `code` like concat('%',#{param.code},'%')
  34. </if>
  35. <if test="param.tenantId != '' and param.tenantId != null">
  36. and tenant_id = #{param.tenantId}
  37. </if>
  38. <if test="param.status != null">
  39. and `status` = #{param.status}
  40. </if>
  41. <if test="param.startTime != null">
  42. and create_time >= #{param.startTime}
  43. </if>
  44. <if test="param.endTime != null">
  45. and create_time &lt; #{param.endTime}
  46. </if>
  47. <if test="param.createBy != '' and param.createBy != null">
  48. and create_by like concat('%',#{param.createBy},'%')
  49. </if>
  50. </where>
  51. order by create_time desc
  52. </select>
  53. <select id="load" resultType="com.sckw.mine.entity.res.KwBusinessMineralAggregateDetailRes">
  54. select <include refid="Base_Column_List" /> from kw_business_mineral_aggregate where id = #{id}
  55. </select>
  56. <select id="findList" resultType="com.sckw.mine.entity.res.MineralAggregateFindListRes">
  57. select <include refid="Base_Column_List" /> from kw_business_mineral_aggregate
  58. <where>
  59. del_flag = 0
  60. <if test="name != null and name != ''">
  61. and `name` like concat('%',#{name},'%')
  62. </if>
  63. <if test="tenantId != null and tenantId != ''">
  64. and tenant_id = #{tenantId}
  65. </if>
  66. </where>
  67. </select>
  68. <update id="aggreUpdate" parameterType="com.sckw.mine.entity.req.MineralAggregateUpdateParam">
  69. UPDATE kw_business_mineral_aggregate
  70. <set>
  71. <trim suffixOverrides=",">
  72. <if test="null != param.name and '' != param.name">`name` = #{param.name},</if>
  73. <if test="null != param.type">type = #{param.type},</if>
  74. <if test="null != param.unit">unit = #{param.unit},</if>
  75. <if test="null != param.size and '' != param.size">size = #{param.size},</if>
  76. <if test="null != param.weight">weight = #{param.weight},</if>
  77. <if test="null != param.status">`status` = #{param.status}</if>
  78. <if test="null != param.value and '' != param.value">`value` = #{param.value}</if>
  79. </trim>
  80. </set>
  81. WHERE id = #{param.id}
  82. </update>
  83. <update id="statusAction">
  84. update kw_business_mineral_aggregate set status = #{status} where id = #{id}
  85. </update>
  86. </mapper>