IntegralWaresMapper.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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.platform.yijia.dao.IntegralWaresMapper">
  4. <!--返回结果-->
  5. <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.IntegralWares">
  6. <id column="id" jdbcType="INTEGER" property="id" />
  7. <result column="wares_type" jdbcType="VARCHAR" property="waresType" />
  8. <result column="wares_name" jdbcType="VARCHAR" property="waresName" />
  9. <result column="sale_integral" jdbcType="DECIMAL" property="saleIntegral" />
  10. <result column="wares_pic" jdbcType="VARCHAR" property="waresPic" />
  11. <result column="wares_detail" jdbcType="VARCHAR" property="waresDetail" />
  12. <result column="wares_count" jdbcType="INTEGER" property="waresCount" />
  13. <result column="wares_out_count" jdbcType="INTEGER" property="waresOutCount" />
  14. <result column="wares_status" jdbcType="VARCHAR" property="waresStatus" />
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  16. <result column="create_by" jdbcType="VARCHAR" property="createBy" />
  17. <result column="create_name" jdbcType="VARCHAR" property="createName" />
  18. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  19. <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
  20. <result column="update_name" jdbcType="VARCHAR" property="updateName" />
  21. <result column="station_id" jdbcType="INTEGER" property="stationId" />
  22. <result column="station_name" jdbcType="VARCHAR" property="stationName" />
  23. </resultMap>
  24. <!--查询列-->
  25. <sql id="Base_Column_List">
  26. id, wares_type, wares_name, sale_integral, wares_pic,
  27. wares_detail, wares_count, wares_out_count, wares_status,
  28. create_time, create_by, create_name, update_time, update_by, update_name, station_name
  29. </sql>
  30. <!--查询油站商品信息-->
  31. <select id="getIntegralWaresInfoList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.IntegralWares">
  32. SELECT
  33. <include refid="Base_Column_List" />
  34. FROM integral_wares
  35. <where>
  36. wares_status = "1"
  37. <if test="stationId !=null and stationId !=''">
  38. AND station_id = #{stationId}
  39. </if>
  40. <if test="id !=null and id !=''">
  41. AND id = #{id}
  42. </if>
  43. </where>
  44. </select>
  45. <!--查询油站商品信息-->
  46. <select id="getIntegralWaresInfo" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.IntegralWares">
  47. SELECT
  48. <include refid="Base_Column_List" />
  49. FROM integral_wares
  50. <where>
  51. wares_status = "1"
  52. <if test="id !=null and id !=''">
  53. AND id = #{id}
  54. </if>
  55. </where>
  56. </select>
  57. <!--更新油站商品已售数量-->
  58. <update id="updateIntegralWaresInfo" parameterType="com.platform.yijia.pojo.IntegralWares">
  59. UPDATE
  60. integral_wares
  61. <set>
  62. <if test="waresCount !=null">
  63. wares_count = #{waresCount},
  64. </if>
  65. <if test="waresOutCount !=null">
  66. wares_out_count = #{waresOutCount}
  67. </if>
  68. </set>
  69. <where>
  70. <if test="id !=null and id != ''">
  71. id = #{id}
  72. </if>
  73. </where>
  74. </update>
  75. </mapper>