QmjsShoppingMallMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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="beilv.system.mapper.QmjsShoppingMallMapper">
  6. <resultMap type="QmjsShoppingMall" id="QmjsShoppingMallResult">
  7. <result property="id" column="id" />
  8. <result property="goodsName" column="goods_name" />
  9. <result property="goodsCode" column="goods_code" />
  10. <result property="goodsType" column="goods_type" />
  11. <result property="goodsImg" column="goods_img" />
  12. <result property="goodsDescribe" column="goods_describe" />
  13. <result property="goodsUnit" column="goods_unit" />
  14. <result property="goodsCurrentPrice" column="goods_current_price" />
  15. <result property="salePrice" column="sale_price" />
  16. <result property="suggestionPrice" column="suggestion_price" />
  17. <result property="goodsInventory" column="goods_inventory" />
  18. <result property="inventoryCost" column="inventory_cost" />
  19. <result property="goodsState" column="goods_state" />
  20. </resultMap>
  21. <sql id="selectQmjsShoppingMallVo">
  22. select id, goods_name, goods_code, goods_type, goods_img, goods_describe, goods_unit, goods_current_price, sale_price, suggestion_price, goods_inventory, inventory_cost, goods_state from qmjs_shopping_mall
  23. </sql>
  24. <select id="selectQmjsShoppingMallList" parameterType="QmjsShoppingMall" resultMap="QmjsShoppingMallResult">
  25. <include refid="selectQmjsShoppingMallVo"/>
  26. <where>
  27. <if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
  28. <if test="goodsCode != null and goodsCode != ''"> and goods_code = #{goodsCode}</if>
  29. <if test="goodsType != null and goodsType != ''"> and goods_type = #{goodsType}</if>
  30. <if test="goodsImg != null and goodsImg != ''"> and goods_img = #{goodsImg}</if>
  31. <if test="goodsDescribe != null and goodsDescribe != ''"> and goods_describe = #{goodsDescribe}</if>
  32. <if test="goodsUnit != null and goodsUnit != ''"> and goods_unit = #{goodsUnit}</if>
  33. <if test="goodsCurrentPrice != null and goodsCurrentPrice != ''"> and goods_current_price = #{goodsCurrentPrice}</if>
  34. <if test="salePrice != null "> and sale_price = #{salePrice}</if>
  35. <if test="suggestionPrice != null "> and suggestion_price = #{suggestionPrice}</if>
  36. <if test="goodsInventory != null and goodsInventory != ''"> and goods_inventory = #{goodsInventory}</if>
  37. <if test="inventoryCost != null "> and inventory_cost = #{inventoryCost}</if>
  38. <if test="goodsState != null and goodsState != ''"> and goods_state = #{goodsState}</if>
  39. </where>
  40. </select>
  41. <select id="selectQmjsShoppingMallById" parameterType="Long" resultMap="QmjsShoppingMallResult">
  42. <include refid="selectQmjsShoppingMallVo"/>
  43. where id = #{id}
  44. </select>
  45. <insert id="insertQmjsShoppingMall" parameterType="QmjsShoppingMall" useGeneratedKeys="true" keyProperty="id">
  46. insert into qmjs_shopping_mall
  47. <trim prefix="(" suffix=")" suffixOverrides=",">
  48. <if test="goodsName != null">goods_name,</if>
  49. <if test="goodsCode != null">goods_code,</if>
  50. <if test="goodsType != null">goods_type,</if>
  51. <if test="goodsImg != null">goods_img,</if>
  52. <if test="goodsDescribe != null">goods_describe,</if>
  53. <if test="goodsUnit != null">goods_unit,</if>
  54. <if test="goodsCurrentPrice != null">goods_current_price,</if>
  55. <if test="salePrice != null">sale_price,</if>
  56. <if test="suggestionPrice != null">suggestion_price,</if>
  57. <if test="goodsInventory != null">goods_inventory,</if>
  58. <if test="inventoryCost != null">inventory_cost,</if>
  59. <if test="goodsState != null">goods_state,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="goodsName != null">#{goodsName},</if>
  63. <if test="goodsCode != null">#{goodsCode},</if>
  64. <if test="goodsType != null">#{goodsType},</if>
  65. <if test="goodsImg != null">#{goodsImg},</if>
  66. <if test="goodsDescribe != null">#{goodsDescribe},</if>
  67. <if test="goodsUnit != null">#{goodsUnit},</if>
  68. <if test="goodsCurrentPrice != null">#{goodsCurrentPrice},</if>
  69. <if test="salePrice != null">#{salePrice},</if>
  70. <if test="suggestionPrice != null">#{suggestionPrice},</if>
  71. <if test="goodsInventory != null">#{goodsInventory},</if>
  72. <if test="inventoryCost != null">#{inventoryCost},</if>
  73. <if test="goodsState != null">#{goodsState},</if>
  74. </trim>
  75. </insert>
  76. <update id="updateQmjsShoppingMall" parameterType="QmjsShoppingMall">
  77. update qmjs_shopping_mall
  78. <trim prefix="SET" suffixOverrides=",">
  79. <if test="goodsName != null">goods_name = #{goodsName},</if>
  80. <if test="goodsCode != null">goods_code = #{goodsCode},</if>
  81. <if test="goodsType != null">goods_type = #{goodsType},</if>
  82. <if test="goodsImg != null">goods_img = #{goodsImg},</if>
  83. <if test="goodsDescribe != null">goods_describe = #{goodsDescribe},</if>
  84. <if test="goodsUnit != null">goods_unit = #{goodsUnit},</if>
  85. <if test="goodsCurrentPrice != null">goods_current_price = #{goodsCurrentPrice},</if>
  86. <if test="salePrice != null">sale_price = #{salePrice},</if>
  87. <if test="suggestionPrice != null">suggestion_price = #{suggestionPrice},</if>
  88. <if test="goodsInventory != null">goods_inventory = #{goodsInventory},</if>
  89. <if test="inventoryCost != null">inventory_cost = #{inventoryCost},</if>
  90. <if test="goodsState != null">goods_state = #{goodsState},</if>
  91. </trim>
  92. where id = #{id}
  93. </update>
  94. <delete id="deleteQmjsShoppingMallById" parameterType="Long">
  95. delete from qmjs_shopping_mall where id = #{id}
  96. </delete>
  97. <delete id="deleteQmjsShoppingMallByIds" parameterType="String">
  98. delete from qmjs_shopping_mall where id in
  99. <foreach item="id" collection="array" open="(" separator="," close=")">
  100. #{id}
  101. </foreach>
  102. </delete>
  103. </mapper>