IntegralWaresMapper.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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, wares_detail, wares_count, wares_out_count, wares_status, create_time,
  27. create_by, create_name, update_time, update_by, update_name, station_name
  28. </sql>
  29. <!--查询油站商品信息-->
  30. <select id="getIntegralWaresInfoList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.IntegralWares">
  31. SELECT
  32. <include refid="Base_Column_List" />
  33. FROM integral_wares
  34. <where>
  35. wares_status = "1"
  36. <if test="stationId !=null and stationId !=''">
  37. AND station_id = #{stationId}
  38. </if>
  39. </where>
  40. </select>
  41. <!--更新油站商品已售数量-->
  42. <update id="updateIntegralWaresInfo" parameterType="com.platform.yijia.pojo.IntegralWares">
  43. UPDATE
  44. integral_wares
  45. <set>
  46. <if test="waresOutCount !=null">
  47. wares_out_count = #{waresOutCount}
  48. </if>
  49. </set>
  50. <where>
  51. <if test="id !=null and id != ''">
  52. id = #{id}
  53. </if>
  54. </where>
  55. </update>
  56. </mapper>