后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.6 KiB

  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.iformall.mapper.TtGoodsCategoryMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.TtGoodsCategory">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="level" jdbcType="INTEGER" property="level" />
  7. <result column="name" jdbcType="VARCHAR" property="name" />
  8. <result column="parent_id" jdbcType="INTEGER" property="parentId" />
  9. <result column="enable" jdbcType="INTEGER" property="enable" />
  10. <result column="is_leaf" jdbcType="INTEGER" property="isLeaf" />
  11. <result column="service_fee" jdbcType="INTEGER" property="serviceFee" />
  12. </resultMap>
  13. <sql id="allColumns">
  14. `id`,`level`,`name`,`parent_id`,`enable`,`is_leaf`,`service_fee`
  15. </sql>
  16. <sql id="dynamicWhereConditions">
  17. where 1=1
  18. <if test=" null != id ">
  19. and `id` = #{id}
  20. </if>
  21. <if test=" null != isDel ">
  22. and `is_del` = #{isDel}
  23. </if>
  24. <if test=" null != level ">
  25. and `level` = #{level}
  26. </if>
  27. <if test=" null != name ">
  28. and `name` like concat('%', #{name},'%')
  29. </if>
  30. <if test=" null != parentId ">
  31. and `parent_id` = #{parentId}
  32. </if>
  33. <if test=" null != enable ">
  34. and `enable` = #{enable}
  35. </if>
  36. <if test=" null != isLeaf ">
  37. and `is_leaf` = #{isLeaf}
  38. </if>
  39. <if test=" null != parentIds ">
  40. and parent_id in
  41. <foreach collection="parentIds" index="index" item="idItem" open="(" separator="," close=")">
  42. #{idItem}
  43. </foreach>
  44. </if>
  45. <if test=" null != categoryIds ">
  46. and id in
  47. <foreach collection="categoryIds" index="index" item="idItem" open="(" separator="," close=")">
  48. #{idItem}
  49. </foreach>
  50. </if>
  51. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  52. </sql>
  53. <select id="findList" parameterType="com.iformall.domain.po.TtGoodsCategory" resultMap="BaseResultMap">
  54. select <include refid="allColumns" /> from tt_goods_category
  55. <include refid="dynamicWhereConditions" />
  56. </select>
  57. <select id="findIdAll" parameterType="com.iformall.domain.po.TtGoodsCategory" resultType="Integer">
  58. select id from tt_goods_category
  59. <include refid="dynamicWhereConditions" />
  60. </select>
  61. <update id="updDelByIds" parameterType="com.iformall.domain.po.TtGoodsCategory">
  62. update tt_goods_category set is_del = #{isDel}, update_date = #{updateDate}
  63. where id in
  64. <foreach collection="categoryIds" index="index" item="idItem" open="(" separator="," close=")">
  65. #{idItem}
  66. </foreach>
  67. </update>
  68. </mapper>