MineralAggregateMapper.xml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. create_by,
  15. update_by,
  16. create_time,
  17. update_time,
  18. del_flag
  19. </sql>
  20. <update id="aggreDelete">
  21. update kw_business_mineral_aggregate set del_flag = 1 where id = #{id}
  22. </update>
  23. <select id="mineAggregatePageList"
  24. resultType="com.sckw.mine.entity.res.MineralAggregateListRes">
  25. select <include refid="Base_Column_List" /> from kw_business_mineral_aggregate
  26. <where>
  27. del_flag = 0
  28. <if test="param.name != '' and param.name != null">
  29. and code like concat('%',#{param.name},'%')
  30. </if>
  31. <if test="param.code != '' and param.code != null">
  32. and code like concat('%',#{param.code},'%')
  33. </if>
  34. <if test="param.tenantId != '' and param.tenantId != null">
  35. and tenant_id = #{param.tenantId}
  36. </if>
  37. <if test="param.status != null">
  38. and `status` = #{param.status}
  39. </if>
  40. </where>
  41. order by create_time desc
  42. </select>
  43. <select id="load" resultType="com.sckw.mine.entity.res.KwBusinessMineralAggregateDetailRes">
  44. select <include refid="Base_Column_List" /> from kw_business_mineral_aggregate where id = #{id}
  45. </select>
  46. <update id="aggreUpdate" parameterType="com.sckw.mine.entity.req.MineralAggregateUpdateParam">
  47. UPDATE kw_business_mineral_aggregate
  48. <set>
  49. <trim suffixOverrides=",">
  50. <if test="null != param.name and '' != param.name">`name` = #{param.name},</if>
  51. <if test="null != param.type">type = #{param.type},</if>
  52. <if test="null != param.unit">unit = #{param.unit},</if>
  53. <if test="null != param.size and '' != param.size">size = #{param.size},</if>
  54. <if test="null != param.weight">weight = #{param.weight},</if>
  55. <if test="null != param.status">`status` = #{param.status}</if>
  56. </trim>
  57. </set>
  58. WHERE id = #{param.id}
  59. </update>
  60. </mapper>