SiteIndexSettingMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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.xc.dao.SiteIndexSettingMapper" >
  4. <resultMap id="BaseResultMap" type="com.xc.pojo.SiteIndexSetting" >
  5. <constructor >
  6. <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  7. <arg column="buy_max_percent" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
  8. <arg column="force_sell_percent" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
  9. <arg column="trans_am_begin" jdbcType="VARCHAR" javaType="java.lang.String" />
  10. <arg column="trans_am_end" jdbcType="VARCHAR" javaType="java.lang.String" />
  11. <arg column="trans_pm_begin" jdbcType="VARCHAR" javaType="java.lang.String" />
  12. <arg column="trans_pm_end" jdbcType="VARCHAR" javaType="java.lang.String" />
  13. <arg column="down_limit" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
  14. <arg column="rise_limit" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
  15. </constructor>
  16. </resultMap>
  17. <sql id="Base_Column_List" >
  18. id, buy_max_percent, force_sell_percent, trans_am_begin, trans_am_end, trans_pm_begin,
  19. trans_pm_end, down_limit, rise_limit
  20. </sql>
  21. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  22. select
  23. <include refid="Base_Column_List" />
  24. from site_index_setting
  25. where id = #{id,jdbcType=INTEGER}
  26. </select>
  27. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  28. delete from site_index_setting
  29. where id = #{id,jdbcType=INTEGER}
  30. </delete>
  31. <insert id="insert" parameterType="com.xc.pojo.SiteIndexSetting" >
  32. insert into site_index_setting (id, buy_max_percent, force_sell_percent,
  33. trans_am_begin, trans_am_end, trans_pm_begin,
  34. trans_pm_end, down_limit, rise_limit
  35. )
  36. values (#{id,jdbcType=INTEGER}, #{buyMaxPercent,jdbcType=DECIMAL}, #{forceSellPercent,jdbcType=DECIMAL},
  37. #{transAmBegin,jdbcType=VARCHAR}, #{transAmEnd,jdbcType=VARCHAR}, #{transPmBegin,jdbcType=VARCHAR},
  38. #{transPmEnd,jdbcType=VARCHAR}, #{downLimit,jdbcType=DECIMAL}, #{riseLimit,jdbcType=DECIMAL}
  39. )
  40. </insert>
  41. <insert id="insertSelective" parameterType="com.xc.pojo.SiteIndexSetting" >
  42. insert into site_index_setting
  43. <trim prefix="(" suffix=")" suffixOverrides="," >
  44. <if test="id != null" >
  45. id,
  46. </if>
  47. <if test="buyMaxPercent != null" >
  48. buy_max_percent,
  49. </if>
  50. <if test="forceSellPercent != null" >
  51. force_sell_percent,
  52. </if>
  53. <if test="transAmBegin != null" >
  54. trans_am_begin,
  55. </if>
  56. <if test="transAmEnd != null" >
  57. trans_am_end,
  58. </if>
  59. <if test="transPmBegin != null" >
  60. trans_pm_begin,
  61. </if>
  62. <if test="transPmEnd != null" >
  63. trans_pm_end,
  64. </if>
  65. <if test="downLimit != null" >
  66. down_limit,
  67. </if>
  68. <if test="riseLimit != null" >
  69. rise_limit,
  70. </if>
  71. </trim>
  72. <trim prefix="values (" suffix=")" suffixOverrides="," >
  73. <if test="id != null" >
  74. #{id,jdbcType=INTEGER},
  75. </if>
  76. <if test="buyMaxPercent != null" >
  77. #{buyMaxPercent,jdbcType=DECIMAL},
  78. </if>
  79. <if test="forceSellPercent != null" >
  80. #{forceSellPercent,jdbcType=DECIMAL},
  81. </if>
  82. <if test="transAmBegin != null" >
  83. #{transAmBegin,jdbcType=VARCHAR},
  84. </if>
  85. <if test="transAmEnd != null" >
  86. #{transAmEnd,jdbcType=VARCHAR},
  87. </if>
  88. <if test="transPmBegin != null" >
  89. #{transPmBegin,jdbcType=VARCHAR},
  90. </if>
  91. <if test="transPmEnd != null" >
  92. #{transPmEnd,jdbcType=VARCHAR},
  93. </if>
  94. <if test="downLimit != null" >
  95. #{downLimit,jdbcType=DECIMAL},
  96. </if>
  97. <if test="riseLimit != null" >
  98. #{riseLimit,jdbcType=DECIMAL},
  99. </if>
  100. </trim>
  101. </insert>
  102. <update id="updateByPrimaryKeySelective" parameterType="com.xc.pojo.SiteIndexSetting" >
  103. update site_index_setting
  104. <set >
  105. <if test="buyMaxPercent != null" >
  106. buy_max_percent = #{buyMaxPercent,jdbcType=DECIMAL},
  107. </if>
  108. <if test="forceSellPercent != null" >
  109. force_sell_percent = #{forceSellPercent,jdbcType=DECIMAL},
  110. </if>
  111. <if test="transAmBegin != null" >
  112. trans_am_begin = #{transAmBegin,jdbcType=VARCHAR},
  113. </if>
  114. <if test="transAmEnd != null" >
  115. trans_am_end = #{transAmEnd,jdbcType=VARCHAR},
  116. </if>
  117. <if test="transPmBegin != null" >
  118. trans_pm_begin = #{transPmBegin,jdbcType=VARCHAR},
  119. </if>
  120. <if test="transPmEnd != null" >
  121. trans_pm_end = #{transPmEnd,jdbcType=VARCHAR},
  122. </if>
  123. <if test="downLimit != null" >
  124. down_limit = #{downLimit,jdbcType=DECIMAL},
  125. </if>
  126. <if test="riseLimit != null" >
  127. rise_limit = #{riseLimit,jdbcType=DECIMAL},
  128. </if>
  129. </set>
  130. where id = #{id,jdbcType=INTEGER}
  131. </update>
  132. <update id="updateByPrimaryKey" parameterType="com.xc.pojo.SiteIndexSetting" >
  133. update site_index_setting
  134. set buy_max_percent = #{buyMaxPercent,jdbcType=DECIMAL},
  135. force_sell_percent = #{forceSellPercent,jdbcType=DECIMAL},
  136. trans_am_begin = #{transAmBegin,jdbcType=VARCHAR},
  137. trans_am_end = #{transAmEnd,jdbcType=VARCHAR},
  138. trans_pm_begin = #{transPmBegin,jdbcType=VARCHAR},
  139. trans_pm_end = #{transPmEnd,jdbcType=VARCHAR},
  140. down_limit = #{downLimit,jdbcType=DECIMAL},
  141. rise_limit = #{riseLimit,jdbcType=DECIMAL}
  142. where id = #{id,jdbcType=INTEGER}
  143. </update>
  144. <select id="selectAllSiteIndexSetting" resultMap="BaseResultMap">
  145. SELECT
  146. <include refid="Base_Column_List"/>
  147. FROM site_index_setting
  148. </select>
  149. </mapper>