FsGuCoinGoodsMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.fs.his.mapper.FsGuCoinGoodsMapper">
  6. <resultMap type="FsGuCoinGoods" id="FsGuCoinGoodsResult">
  7. <result property="goodsId" column="goods_id" />
  8. <result property="imgUrl" column="img_url" />
  9. <result property="images" column="images" />
  10. <result property="goodsName" column="goods_name" />
  11. <result property="otPrice" column="ot_price" />
  12. <result property="goodsType" column="goods_type" />
  13. <result property="status" column="status" />
  14. <result property="guCoin" column="gu_coin" />
  15. <result property="cash" column="cash" />
  16. <result property="sort" column="sort" />
  17. <result property="stock" column="stock" />
  18. <result property="descs" column="descs" />
  19. <result property="barCode" column="bar_code" />
  20. <result property="tempId" column="temp_id" />
  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="selectFsGuCoinGoodsVo">
  27. select * from fs_gu_coin_goods
  28. </sql>
  29. <select id="selectFsGuCoinGoodsByGoodsId" parameterType="Long" resultMap="FsGuCoinGoodsResult">
  30. <include refid="selectFsGuCoinGoodsVo"/>
  31. where goods_id = #{goodsId}
  32. </select>
  33. <select id="selectFsGuCoinGoodsList" parameterType="com.fs.his.param.FsGuCoinGoodsParam" resultMap="FsGuCoinGoodsResult">
  34. <include refid="selectFsGuCoinGoodsVo"/>
  35. <where>
  36. <if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
  37. <if test="goodsType != null"> and goods_type = #{goodsType}</if>
  38. <if test="status != null"> and status = #{status}</if>
  39. <if test="goodsId != null"> and goods_id = #{goodsId}</if>
  40. </where>
  41. order by sort asc, goods_id desc
  42. </select>
  43. <insert id="insertFsGuCoinGoods" parameterType="FsGuCoinGoods" useGeneratedKeys="true" keyProperty="goodsId">
  44. insert into fs_gu_coin_goods
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="imgUrl != null and imgUrl != ''">img_url,</if>
  47. <if test="images != null">images,</if>
  48. <if test="goodsName != null and goodsName != ''">goods_name,</if>
  49. <if test="otPrice != null">ot_price,</if>
  50. <if test="goodsType != null">goods_type,</if>
  51. <if test="status != null">status,</if>
  52. <if test="guCoin != null">gu_coin,</if>
  53. <if test="cash != null">cash,</if>
  54. <if test="sort != null">sort,</if>
  55. <if test="stock != null">stock,</if>
  56. <if test="descs != null">descs,</if>
  57. <if test="barCode != null">bar_code,</if>
  58. <if test="tempId != null">temp_id,</if>
  59. <if test="createBy != null">create_by,</if>
  60. <if test="createTime != null">create_time,</if>
  61. </trim>
  62. <trim prefix="values (" suffix=")" suffixOverrides=",">
  63. <if test="imgUrl != null and imgUrl != ''">#{imgUrl},</if>
  64. <if test="images != null">#{images},</if>
  65. <if test="goodsName != null and goodsName != ''">#{goodsName},</if>
  66. <if test="otPrice != null">#{otPrice},</if>
  67. <if test="goodsType != null">#{goodsType},</if>
  68. <if test="status != null">#{status},</if>
  69. <if test="guCoin != null">#{guCoin},</if>
  70. <if test="cash != null">#{cash},</if>
  71. <if test="sort != null">#{sort},</if>
  72. <if test="stock != null">#{stock},</if>
  73. <if test="descs != null">#{descs},</if>
  74. <if test="barCode != null">#{barCode},</if>
  75. <if test="tempId != null">#{tempId},</if>
  76. <if test="createBy != null">#{createBy},</if>
  77. <if test="createTime != null">#{createTime},</if>
  78. </trim>
  79. </insert>
  80. <update id="updateFsGuCoinGoods" parameterType="FsGuCoinGoods">
  81. update fs_gu_coin_goods
  82. <trim prefix="SET" suffixOverrides=",">
  83. <if test="imgUrl != null and imgUrl != ''">img_url = #{imgUrl},</if>
  84. <if test="images != null">images = #{images},</if>
  85. <if test="goodsName != null and goodsName != ''">goods_name = #{goodsName},</if>
  86. <if test="otPrice != null">ot_price = #{otPrice},</if>
  87. <if test="goodsType != null">goods_type = #{goodsType},</if>
  88. <if test="status != null">status = #{status},</if>
  89. <if test="guCoin != null">gu_coin = #{guCoin},</if>
  90. <if test="cash != null">cash = #{cash},</if>
  91. <if test="sort != null">sort = #{sort},</if>
  92. <if test="stock != null">stock = #{stock},</if>
  93. <if test="descs != null">descs = #{descs},</if>
  94. <if test="barCode != null">bar_code = #{barCode},</if>
  95. <if test="tempId != null">temp_id = #{tempId},</if>
  96. <if test="updateBy != null">update_by = #{updateBy},</if>
  97. <if test="updateTime != null">update_time = #{updateTime},</if>
  98. </trim>
  99. where goods_id = #{goodsId}
  100. </update>
  101. <delete id="deleteFsGuCoinGoodsByGoodsId" parameterType="Long">
  102. delete from fs_gu_coin_goods where goods_id = #{goodsId}
  103. </delete>
  104. <delete id="deleteFsGuCoinGoodsByGoodsIds" parameterType="String">
  105. delete from fs_gu_coin_goods where goods_id in
  106. <foreach item="goodsId" collection="array" open="(" separator="," close=")">
  107. #{goodsId}
  108. </foreach>
  109. </delete>
  110. </mapper>