StockForecastMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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.huojutech.dao.StockForecastMapper" >
  4. <resultMap id="BaseResultMap" type="com.huojutech.entity.StockForecast" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="uid" property="uid" jdbcType="INTEGER" />
  7. <result column="stock_name" property="stockName" jdbcType="VARCHAR" />
  8. <result column="stock_code" property="stockCode" jdbcType="VARCHAR" />
  9. <result column="expect" property="expect" jdbcType="INTEGER" />
  10. <result column="bet" property="bet" jdbcType="DECIMAL" />
  11. <result column="current_price" property="currentPrice" jdbcType="DECIMAL" />
  12. <result column="target_price" property="targetPrice" jdbcType="DECIMAL" />
  13. <result column="cycle" property="cycle" jdbcType="INTEGER" />
  14. <result column="start_date" property="startDate" jdbcType="DATE" />
  15. <result column="end_date" property="endDate" jdbcType="DATE" />
  16. <result column="status" property="status" jdbcType="INTEGER" />
  17. <result column="crt_time" property="crtTime" jdbcType="TIMESTAMP" />
  18. <result column="upd_time" property="updTime" jdbcType="TIMESTAMP" />
  19. </resultMap>
  20. <resultMap id="ResultMapWithBLOBs" type="com.huojutech.entity.StockForecast" extends="BaseResultMap" >
  21. <result column="reason" property="reason" jdbcType="LONGVARCHAR" />
  22. </resultMap>
  23. <sql id="Example_Where_Clause" >
  24. <where >
  25. <foreach collection="oredCriteria" item="criteria" separator="or" >
  26. <if test="criteria.valid" >
  27. <trim prefix="(" suffix=")" prefixOverrides="and" >
  28. <foreach collection="criteria.criteria" item="criterion" >
  29. <choose >
  30. <when test="criterion.noValue" >
  31. and ${criterion.condition}
  32. </when>
  33. <when test="criterion.singleValue" >
  34. and ${criterion.condition} #{criterion.value}
  35. </when>
  36. <when test="criterion.betweenValue" >
  37. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  38. </when>
  39. <when test="criterion.listValue" >
  40. and ${criterion.condition}
  41. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  42. #{listItem}
  43. </foreach>
  44. </when>
  45. </choose>
  46. </foreach>
  47. </trim>
  48. </if>
  49. </foreach>
  50. </where>
  51. </sql>
  52. <sql id="Base_Column_List" >
  53. id, uid, stock_name, stock_code, expect, bet, current_price, target_price, cycle,
  54. start_date, end_date, status, crt_time, upd_time
  55. </sql>
  56. <sql id="Blob_Column_List" >
  57. reason
  58. </sql>
  59. <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.huojutech.entity.StockForecastExample" >
  60. select
  61. <if test="distinct" >
  62. distinct
  63. </if>
  64. 'true' as QUERYID,
  65. <include refid="Base_Column_List" />
  66. ,
  67. <include refid="Blob_Column_List" />
  68. from stock_forecast
  69. <if test="_parameter != null" >
  70. <include refid="Example_Where_Clause" />
  71. </if>
  72. <if test="orderByClause != null" >
  73. order by ${orderByClause}
  74. </if>
  75. </select>
  76. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.huojutech.entity.StockForecastExample" >
  77. select
  78. <if test="distinct" >
  79. distinct
  80. </if>
  81. 'true' as QUERYID,
  82. <include refid="Base_Column_List" />
  83. from stock_forecast
  84. <if test="_parameter != null" >
  85. <include refid="Example_Where_Clause" />
  86. </if>
  87. <if test="orderByClause != null" >
  88. order by ${orderByClause}
  89. </if>
  90. </select>
  91. <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
  92. select
  93. <include refid="Base_Column_List" />
  94. ,
  95. <include refid="Blob_Column_List" />
  96. from stock_forecast
  97. where id = #{id,jdbcType=INTEGER}
  98. </select>
  99. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  100. delete from stock_forecast
  101. where id = #{id,jdbcType=INTEGER}
  102. </delete>
  103. <insert id="insert" parameterType="com.huojutech.entity.StockForecast" useGeneratedKeys="true" keyProperty="id" >
  104. insert into stock_forecast (uid, stock_name, stock_code,
  105. expect, bet, current_price,
  106. target_price, cycle, start_date,
  107. end_date, status, crt_time,
  108. upd_time, reason)
  109. values (#{uid,jdbcType=INTEGER}, #{stockName,jdbcType=VARCHAR}, #{stockCode,jdbcType=VARCHAR},
  110. #{expect,jdbcType=INTEGER}, #{bet,jdbcType=DECIMAL}, #{currentPrice,jdbcType=DECIMAL},
  111. #{targetPrice,jdbcType=DECIMAL}, #{cycle,jdbcType=INTEGER}, #{startDate,jdbcType=DATE},
  112. #{endDate,jdbcType=DATE}, #{status,jdbcType=INTEGER}, #{crtTime,jdbcType=TIMESTAMP},
  113. #{updTime,jdbcType=TIMESTAMP}, #{reason,jdbcType=LONGVARCHAR})
  114. </insert>
  115. <insert id="insertSelective" parameterType="com.huojutech.entity.StockForecast" useGeneratedKeys="true" keyProperty="id" >
  116. insert into stock_forecast
  117. <trim prefix="(" suffix=")" suffixOverrides="," >
  118. <if test="uid != null" >
  119. uid,
  120. </if>
  121. <if test="stockName != null" >
  122. stock_name,
  123. </if>
  124. <if test="stockCode != null" >
  125. stock_code,
  126. </if>
  127. <if test="expect != null" >
  128. expect,
  129. </if>
  130. <if test="bet != null" >
  131. bet,
  132. </if>
  133. <if test="currentPrice != null" >
  134. current_price,
  135. </if>
  136. <if test="targetPrice != null" >
  137. target_price,
  138. </if>
  139. <if test="cycle != null" >
  140. cycle,
  141. </if>
  142. <if test="startDate != null" >
  143. start_date,
  144. </if>
  145. <if test="endDate != null" >
  146. end_date,
  147. </if>
  148. <if test="status != null" >
  149. status,
  150. </if>
  151. <if test="crtTime != null" >
  152. crt_time,
  153. </if>
  154. <if test="updTime != null" >
  155. upd_time,
  156. </if>
  157. <if test="reason != null" >
  158. reason,
  159. </if>
  160. </trim>
  161. <trim prefix="values (" suffix=")" suffixOverrides="," >
  162. <if test="uid != null" >
  163. #{uid,jdbcType=INTEGER},
  164. </if>
  165. <if test="stockName != null" >
  166. #{stockName,jdbcType=VARCHAR},
  167. </if>
  168. <if test="stockCode != null" >
  169. #{stockCode,jdbcType=VARCHAR},
  170. </if>
  171. <if test="expect != null" >
  172. #{expect,jdbcType=INTEGER},
  173. </if>
  174. <if test="bet != null" >
  175. #{bet,jdbcType=DECIMAL},
  176. </if>
  177. <if test="currentPrice != null" >
  178. #{currentPrice,jdbcType=DECIMAL},
  179. </if>
  180. <if test="targetPrice != null" >
  181. #{targetPrice,jdbcType=DECIMAL},
  182. </if>
  183. <if test="cycle != null" >
  184. #{cycle,jdbcType=INTEGER},
  185. </if>
  186. <if test="startDate != null" >
  187. #{startDate,jdbcType=DATE},
  188. </if>
  189. <if test="endDate != null" >
  190. #{endDate,jdbcType=DATE},
  191. </if>
  192. <if test="status != null" >
  193. #{status,jdbcType=INTEGER},
  194. </if>
  195. <if test="crtTime != null" >
  196. #{crtTime,jdbcType=TIMESTAMP},
  197. </if>
  198. <if test="updTime != null" >
  199. #{updTime,jdbcType=TIMESTAMP},
  200. </if>
  201. <if test="reason != null" >
  202. #{reason,jdbcType=LONGVARCHAR},
  203. </if>
  204. </trim>
  205. </insert>
  206. <select id="countByExample" parameterType="com.huojutech.entity.StockForecastExample" resultType="java.lang.Integer" >
  207. select count(*) from stock_forecast
  208. <if test="_parameter != null" >
  209. <include refid="Example_Where_Clause" />
  210. </if>
  211. </select>
  212. <update id="updateByPrimaryKeySelective" parameterType="com.huojutech.entity.StockForecast" >
  213. update stock_forecast
  214. <set >
  215. <if test="uid != null" >
  216. uid = #{uid,jdbcType=INTEGER},
  217. </if>
  218. <if test="stockName != null" >
  219. stock_name = #{stockName,jdbcType=VARCHAR},
  220. </if>
  221. <if test="stockCode != null" >
  222. stock_code = #{stockCode,jdbcType=VARCHAR},
  223. </if>
  224. <if test="expect != null" >
  225. expect = #{expect,jdbcType=INTEGER},
  226. </if>
  227. <if test="bet != null" >
  228. bet = #{bet,jdbcType=DECIMAL},
  229. </if>
  230. <if test="currentPrice != null" >
  231. current_price = #{currentPrice,jdbcType=DECIMAL},
  232. </if>
  233. <if test="targetPrice != null" >
  234. target_price = #{targetPrice,jdbcType=DECIMAL},
  235. </if>
  236. <if test="cycle != null" >
  237. cycle = #{cycle,jdbcType=INTEGER},
  238. </if>
  239. <if test="startDate != null" >
  240. start_date = #{startDate,jdbcType=DATE},
  241. </if>
  242. <if test="endDate != null" >
  243. end_date = #{endDate,jdbcType=DATE},
  244. </if>
  245. <if test="status != null" >
  246. status = #{status,jdbcType=INTEGER},
  247. </if>
  248. <if test="crtTime != null" >
  249. crt_time = #{crtTime,jdbcType=TIMESTAMP},
  250. </if>
  251. <if test="updTime != null" >
  252. upd_time = #{updTime,jdbcType=TIMESTAMP},
  253. </if>
  254. <if test="reason != null" >
  255. reason = #{reason,jdbcType=LONGVARCHAR},
  256. </if>
  257. </set>
  258. where id = #{id,jdbcType=INTEGER}
  259. </update>
  260. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.huojutech.entity.StockForecast" >
  261. update stock_forecast
  262. set uid = #{uid,jdbcType=INTEGER},
  263. stock_name = #{stockName,jdbcType=VARCHAR},
  264. stock_code = #{stockCode,jdbcType=VARCHAR},
  265. expect = #{expect,jdbcType=INTEGER},
  266. bet = #{bet,jdbcType=DECIMAL},
  267. current_price = #{currentPrice,jdbcType=DECIMAL},
  268. target_price = #{targetPrice,jdbcType=DECIMAL},
  269. cycle = #{cycle,jdbcType=INTEGER},
  270. start_date = #{startDate,jdbcType=DATE},
  271. end_date = #{endDate,jdbcType=DATE},
  272. status = #{status,jdbcType=INTEGER},
  273. crt_time = #{crtTime,jdbcType=TIMESTAMP},
  274. upd_time = #{updTime,jdbcType=TIMESTAMP},
  275. reason = #{reason,jdbcType=LONGVARCHAR}
  276. where id = #{id,jdbcType=INTEGER}
  277. </update>
  278. <update id="updateByPrimaryKey" parameterType="com.huojutech.entity.StockForecast" >
  279. update stock_forecast
  280. set uid = #{uid,jdbcType=INTEGER},
  281. stock_name = #{stockName,jdbcType=VARCHAR},
  282. stock_code = #{stockCode,jdbcType=VARCHAR},
  283. expect = #{expect,jdbcType=INTEGER},
  284. bet = #{bet,jdbcType=DECIMAL},
  285. current_price = #{currentPrice,jdbcType=DECIMAL},
  286. target_price = #{targetPrice,jdbcType=DECIMAL},
  287. cycle = #{cycle,jdbcType=INTEGER},
  288. start_date = #{startDate,jdbcType=DATE},
  289. end_date = #{endDate,jdbcType=DATE},
  290. status = #{status,jdbcType=INTEGER},
  291. crt_time = #{crtTime,jdbcType=TIMESTAMP},
  292. upd_time = #{updTime,jdbcType=TIMESTAMP}
  293. where id = #{id,jdbcType=INTEGER}
  294. </update>
  295. </mapper>