FncBookMapper.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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.ydtech.modules.fnc.dao.FncBookMapper">
  4. <resultMap id="BaseResultMap" type="com.ydtech.modules.fnc.model.FncBook">
  5. <id column="book_code" jdbcType="VARCHAR" property="bookCode"/>
  6. <result column="book_name" jdbcType="VARCHAR" property="bookName"/>
  7. <result column="city" jdbcType="VARCHAR" property="city"/>
  8. <result column="currency" jdbcType="VARCHAR" property="currency"/>
  9. <result column="status" jdbcType="VARCHAR" property="status"/>
  10. <result column="createtime" jdbcType="DATE" property="createtime"/>
  11. <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
  12. <result column="shop_id" jdbcType="VARCHAR" property="shopId"/>
  13. <result column="feerate" jdbcType="DOUBLE" property="feerate"/>
  14. </resultMap>
  15. <sql id="Base_Column_List">
  16. book_code, book_name, city, currency, status, createtime, create_by, shop_id, feerate
  17. </sql>
  18. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  19. select
  20. <include refid="Base_Column_List"/>
  21. from fnc_book
  22. where book_code = #{bookCode,jdbcType=VARCHAR}
  23. </select>
  24. <select id="selectByBookName" parameterType="java.lang.String" resultMap="BaseResultMap">
  25. select
  26. <include refid="Base_Column_List"/>
  27. from fnc_book
  28. where book_name = #{bookName,jdbcType=VARCHAR}
  29. </select>
  30. <select id="selectByBookNameIsExits" resultType="java.lang.Integer">
  31. select count(1)
  32. from fnc_book
  33. where book_name = #{bookName,jdbcType=VARCHAR}
  34. AND book_code != #{bookCode,jdbcType=VARCHAR}
  35. </select>
  36. <select id="select" resultMap="BaseResultMap">
  37. select
  38. <include refid="Base_Column_List"/>
  39. from fnc_book
  40. where 1=1
  41. <if test="bookCode != null and bookCode != '' ">
  42. and book_code = #{bookCode,jdbcType=VARCHAR}
  43. </if>
  44. <if test="bookName != null and bookName != ''">
  45. and book_name like concat('%', #{bookName,jdbcType=VARCHAR},'%')
  46. </if>
  47. <if test="city != null and city != ''">
  48. and city = #{city,jdbcType=VARCHAR}
  49. </if>
  50. <if test="currency != null and currency != ''">
  51. and currency = #{currency,jdbcType=VARCHAR}
  52. </if>
  53. <if test="status != null and status != ''">
  54. and status = #{status,jdbcType=VARCHAR}
  55. </if>
  56. <if test="createtime != null">
  57. and createtime = #{createtime,jdbcType=DATE}
  58. </if>
  59. <if test="createBy != null and createBy != ''">
  60. and create_by = #{createBy,jdbcType=VARCHAR}
  61. </if>
  62. <if test="shopId != null and shopId != ''">
  63. and shop_id = #{shopId,jdbcType=VARCHAR}
  64. </if>
  65. <if test="feerate != null and feerate != ''">
  66. and feerate = #{feerate,jdbcType=VARCHAR}
  67. </if>
  68. order by book_code
  69. </select>
  70. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  71. delete
  72. from fnc_book
  73. where book_code = #{bookCode,jdbcType=VARCHAR}
  74. </delete>
  75. <insert id="insert" parameterType="com.ydtech.modules.fnc.model.FncBook">
  76. insert into fnc_book (book_code, book_name, city,
  77. currency, status, createtime,
  78. create_by, shop_id, feerate)
  79. values (#{bookCode,jdbcType=VARCHAR}, #{bookName,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR},
  80. #{currency,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createtime,jdbcType=DATE},
  81. #{createBy,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{feerate,jdbcType=DOUBLE})
  82. </insert>
  83. <insert id="insertSelective" parameterType="com.ydtech.modules.fnc.model.FncBook">
  84. insert into fnc_book
  85. <trim prefix="(" suffix=")" suffixOverrides=",">
  86. <if test="bookCode != null">
  87. book_code,
  88. </if>
  89. <if test="bookName != null">
  90. book_name,
  91. </if>
  92. <if test="city != null">
  93. city,
  94. </if>
  95. <if test="currency != null">
  96. currency,
  97. </if>
  98. <if test="status != null">
  99. status,
  100. </if>
  101. <if test="createtime != null">
  102. createtime,
  103. </if>
  104. <if test="createBy != null">
  105. create_by,
  106. </if>
  107. <if test="shopId != null">
  108. shop_id,
  109. </if>
  110. <if test="feerate != null">
  111. feerate,
  112. </if>
  113. </trim>
  114. <trim prefix="values (" suffix=")" suffixOverrides=",">
  115. <if test="bookCode != null">
  116. #{bookCode,jdbcType=VARCHAR},
  117. </if>
  118. <if test="bookName != null">
  119. #{bookName,jdbcType=VARCHAR},
  120. </if>
  121. <if test="city != null">
  122. #{city,jdbcType=VARCHAR},
  123. </if>
  124. <if test="currency != null">
  125. #{currency,jdbcType=VARCHAR},
  126. </if>
  127. <if test="status != null">
  128. #{status,jdbcType=VARCHAR},
  129. </if>
  130. <if test="createtime != null">
  131. #{createtime,jdbcType=DATE},
  132. </if>
  133. <if test="createBy != null">
  134. #{createBy,jdbcType=VARCHAR},
  135. </if>
  136. <if test="shopId != null">
  137. #{shopId,jdbcType=VARCHAR},
  138. </if>
  139. <if test="feerate != null">
  140. #{feerate,jdbcType=DOUBLE},
  141. </if>
  142. </trim>
  143. </insert>
  144. <update id="updateByPrimaryKeySelective" parameterType="com.ydtech.modules.fnc.model.FncBook">
  145. update fnc_book
  146. <set>
  147. <if test="bookName != null">
  148. book_name = #{bookName,jdbcType=VARCHAR},
  149. </if>
  150. <if test="city != null">
  151. city = #{city,jdbcType=VARCHAR},
  152. </if>
  153. <if test="currency != null">
  154. currency = #{currency,jdbcType=VARCHAR},
  155. </if>
  156. <if test="status != null">
  157. status = #{status,jdbcType=VARCHAR},
  158. </if>
  159. <if test="createtime != null">
  160. createtime = #{createtime,jdbcType=DATE},
  161. </if>
  162. <if test="createBy != null">
  163. create_by = #{createBy,jdbcType=VARCHAR},
  164. </if>
  165. <if test="shopId != null">
  166. shop_id = #{shopId,jdbcType=VARCHAR},
  167. </if>
  168. <if test="feerate != null">
  169. feerate = #{feerate,jdbcType=DOUBLE},
  170. </if>
  171. </set>
  172. where book_code = #{bookCode,jdbcType=VARCHAR}
  173. </update>
  174. <update id="updateByPrimaryKey" parameterType="com.ydtech.modules.fnc.model.FncBook">
  175. update fnc_book
  176. set book_name = #{bookName,jdbcType=VARCHAR},
  177. city = #{city,jdbcType=VARCHAR},
  178. currency = #{currency,jdbcType=VARCHAR},
  179. status = #{status,jdbcType=VARCHAR},
  180. createtime = #{createtime,jdbcType=DATE},
  181. create_by = #{createBy,jdbcType=VARCHAR},
  182. shop_id = #{shopId,jdbcType=VARCHAR},
  183. feerate = #{feerate,jdbcType=DOUBLE}
  184. where book_code = #{bookCode,jdbcType=VARCHAR}
  185. </update>
  186. </mapper>