AskaChannelcouponnosMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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.mofangchuxing.aska.dao.mapper.AskaChannelcouponnosMapper">
  6. <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="channelId" column="channelId" jdbcType="INTEGER"/>
  9. <result property="channelNo" column="channelNo" jdbcType="CHAR"/>
  10. <result property="couponNo" column="couponNo" jdbcType="CHAR"/>
  11. <result property="status" column="status" jdbcType="CHAR"/>
  12. <result property="outDate" column="outDate" jdbcType="DATE"/>
  13. <result property="value" column="value" jdbcType="INTEGER"/>
  14. <result property="price" column="price" jdbcType="INTEGER"/>
  15. </resultMap>
  16. <sql id="Base_Column_List">
  17. id,channelId,channelNo,
  18. couponNo,status,outDate,
  19. value,price
  20. </sql>
  21. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  22. select
  23. <include refid="Base_Column_List" />
  24. from aska_channelcouponnos
  25. where id = #{id,jdbcType=INTEGER}
  26. </select>
  27. <select id="searchAllByCouponNo" resultType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
  28. select
  29. <include refid="Base_Column_List" />
  30. from aska_channelcouponnos
  31. where couponNo = #{couponNo} limit 1
  32. </select>
  33. <select id="searchAll" resultType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
  34. select
  35. <include refid="Base_Column_List" />
  36. from aska_channelcouponnos
  37. where 1=1
  38. <if test="channelId != null and channelId != ''">
  39. and channelId = #{channelId}
  40. </if>
  41. <if test="couponNo != null and couponNo != ''">
  42. and couponNo = #{couponNo}
  43. </if>
  44. <if test="status != null and status != '' and status != '全部'">
  45. and status = #{status}
  46. </if>
  47. order by id desc
  48. </select>
  49. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  50. delete from aska_channelcouponnos
  51. where id = #{id,jdbcType=INTEGER}
  52. </delete>
  53. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos" useGeneratedKeys="true">
  54. insert into aska_channelcouponnos
  55. ( id,channelId,channelNo
  56. ,couponNo,status,outDate
  57. ,value,price)
  58. values (#{id,jdbcType=INTEGER},#{channelId,jdbcType=INTEGER},#{channelNo,jdbcType=CHAR}
  59. ,#{couponNo,jdbcType=CHAR},#{status,jdbcType=CHAR},#{outDate,jdbcType=DATE}
  60. ,#{value,jdbcType=INTEGER},#{price,jdbcType=INTEGER})
  61. </insert>
  62. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos" useGeneratedKeys="true">
  63. insert into aska_channelcouponnos
  64. <trim prefix="(" suffix=")" suffixOverrides=",">
  65. <if test="id != null">id,</if>
  66. <if test="channelId != null">channelId,</if>
  67. <if test="channelNo != null">channelNo,</if>
  68. <if test="couponNo != null">couponNo,</if>
  69. <if test="status != null">status,</if>
  70. <if test="outDate != null">outDate,</if>
  71. <if test="value != null">value,</if>
  72. <if test="price != null">price,</if>
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides=",">
  75. <if test="id != null">#{id,jdbcType=INTEGER},</if>
  76. <if test="channelId != null">#{channelId,jdbcType=INTEGER},</if>
  77. <if test="channelNo != null">#{channelNo,jdbcType=CHAR},</if>
  78. <if test="couponNo != null">#{couponNo,jdbcType=CHAR},</if>
  79. <if test="status != null">#{status,jdbcType=CHAR},</if>
  80. <if test="outDate != null">#{outDate,jdbcType=DATE},</if>
  81. <if test="value != null">#{value,jdbcType=INTEGER},</if>
  82. <if test="price != null">#{price,jdbcType=INTEGER},</if>
  83. </trim>
  84. </insert>
  85. <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
  86. update aska_channelcouponnos
  87. <set>
  88. <if test="channelId != null">
  89. channelId = #{channelId,jdbcType=INTEGER},
  90. </if>
  91. <if test="channelNo != null">
  92. channelNo = #{channelNo,jdbcType=CHAR},
  93. </if>
  94. <if test="couponNo != null">
  95. couponNo = #{couponNo,jdbcType=CHAR},
  96. </if>
  97. <if test="status != null">
  98. status = #{status,jdbcType=CHAR},
  99. </if>
  100. <if test="outDate != null">
  101. outDate = #{outDate,jdbcType=DATE},
  102. </if>
  103. <if test="value != null">
  104. value = #{value,jdbcType=INTEGER},
  105. </if>
  106. <if test="price != null">
  107. price = #{price,jdbcType=INTEGER},
  108. </if>
  109. </set>
  110. where id = #{id,jdbcType=INTEGER}
  111. </update>
  112. <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
  113. update aska_channelcouponnos
  114. set
  115. channelId = #{channelId,jdbcType=INTEGER},
  116. channelNo = #{channelNo,jdbcType=CHAR},
  117. couponNo = #{couponNo,jdbcType=CHAR},
  118. status = #{status,jdbcType=CHAR},
  119. outDate = #{outDate,jdbcType=DATE},
  120. value = #{value,jdbcType=INTEGER},
  121. price = #{price,jdbcType=INTEGER}
  122. where id = #{id,jdbcType=INTEGER}
  123. </update>
  124. </mapper>