AskaStatMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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.AskaStatMapper">
  6. <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaStat">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="aType" column="aType" jdbcType="CHAR"/>
  9. <result property="aId" column="aId" jdbcType="INTEGER"/>
  10. <result property="cType" column="cType" jdbcType="CHAR"/>
  11. <result property="statDay" column="statDay" jdbcType="DATE"/>
  12. <result property="orders" column="orders" jdbcType="INTEGER"/>
  13. <result property="amount" column="amount" jdbcType="INTEGER"/>
  14. </resultMap>
  15. <sql id="Base_Column_List">
  16. id,aType,aId,
  17. cType,statDay,orders,
  18. amount
  19. </sql>
  20. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  21. select
  22. <include refid="Base_Column_List" />
  23. from aska_stat
  24. where id = #{id,jdbcType=INTEGER}
  25. </select>
  26. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  27. delete from aska_stat
  28. where id = #{id,jdbcType=INTEGER}
  29. </delete>
  30. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaStat" useGeneratedKeys="true">
  31. insert into aska_stat
  32. ( id,aType,aId
  33. ,cType,statDay,orders
  34. ,amount)
  35. values (#{id,jdbcType=INTEGER},#{aType,jdbcType=CHAR},#{aId,jdbcType=INTEGER}
  36. ,#{cType,jdbcType=CHAR},#{statDay,jdbcType=DATE},#{orders,jdbcType=INTEGER}
  37. ,#{amount,jdbcType=INTEGER})
  38. </insert>
  39. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaStat" useGeneratedKeys="true">
  40. insert into aska_stat
  41. <trim prefix="(" suffix=")" suffixOverrides=",">
  42. <if test="id != null">id,</if>
  43. <if test="aType != null">aType,</if>
  44. <if test="aId != null">aId,</if>
  45. <if test="cType != null">cType,</if>
  46. <if test="statDay != null">statDay,</if>
  47. <if test="orders != null">orders,</if>
  48. <if test="amount != null">amount,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="id != null">#{id,jdbcType=INTEGER},</if>
  52. <if test="aType != null">#{aType,jdbcType=CHAR},</if>
  53. <if test="aId != null">#{aId,jdbcType=INTEGER},</if>
  54. <if test="cType != null">#{cType,jdbcType=CHAR},</if>
  55. <if test="statDay != null">#{statDay,jdbcType=DATE},</if>
  56. <if test="orders != null">#{orders,jdbcType=INTEGER},</if>
  57. <if test="amount != null">#{amount,jdbcType=INTEGER},</if>
  58. </trim>
  59. </insert>
  60. <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaStat">
  61. update aska_stat
  62. <set>
  63. <if test="aType != null">
  64. aType = #{aType,jdbcType=CHAR},
  65. </if>
  66. <if test="aId != null">
  67. aId = #{aId,jdbcType=INTEGER},
  68. </if>
  69. <if test="cType != null">
  70. cType = #{cType,jdbcType=CHAR},
  71. </if>
  72. <if test="statDay != null">
  73. statDay = #{statDay,jdbcType=DATE},
  74. </if>
  75. <if test="orders != null">
  76. orders = #{orders,jdbcType=INTEGER},
  77. </if>
  78. <if test="amount != null">
  79. amount = #{amount,jdbcType=INTEGER},
  80. </if>
  81. </set>
  82. where id = #{id,jdbcType=INTEGER}
  83. </update>
  84. <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaStat">
  85. update aska_stat
  86. set
  87. aType = #{aType,jdbcType=CHAR},
  88. aId = #{aId,jdbcType=INTEGER},
  89. cType = #{cType,jdbcType=CHAR},
  90. statDay = #{statDay,jdbcType=DATE},
  91. orders = #{orders,jdbcType=INTEGER},
  92. amount = #{amount,jdbcType=INTEGER}
  93. where id = #{id,jdbcType=INTEGER}
  94. </update>
  95. </mapper>