PatentCostMapper.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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.goafanti.common.dao.PatentCostMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.PatentCost" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="pid" property="pid" jdbcType="VARCHAR" />
  7. <result column="annual_fee" property="annualFee" jdbcType="INTEGER" />
  8. <result column="annual_fee_state" property="annualFeeState" jdbcType="INTEGER" />
  9. <result column="application_fee" property="applicationFee" jdbcType="INTEGER" />
  10. <result column="trial_fee" property="trialFee" jdbcType="INTEGER" />
  11. <result column="printing_fee" property="printingFee" jdbcType="INTEGER" />
  12. <result column="is_request_funds" property="isRequestFunds" jdbcType="INTEGER" />
  13. <result column="is_reimbursement" property="isReimbursement" jdbcType="INTEGER" />
  14. <result column="payment_state" property="paymentState" jdbcType="INTEGER" />
  15. </resultMap>
  16. <sql id="Base_Column_List" >
  17. id, pid, annual_fee, annual_fee_state, application_fee, trial_fee, printing_fee,
  18. is_request_funds, is_reimbursement, payment_state
  19. </sql>
  20. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  21. select
  22. <include refid="Base_Column_List" />
  23. from patent_cost
  24. where id = #{id,jdbcType=VARCHAR}
  25. </select>
  26. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  27. delete from patent_cost
  28. where id = #{id,jdbcType=VARCHAR}
  29. </delete>
  30. <insert id="insert" parameterType="com.goafanti.common.model.PatentCost" >
  31. insert into patent_cost (id, pid, annual_fee,
  32. annual_fee_state, application_fee, trial_fee,
  33. printing_fee, is_request_funds, is_reimbursement,
  34. payment_state)
  35. values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{annualFee,jdbcType=INTEGER},
  36. #{annualFeeState,jdbcType=INTEGER}, #{applicationFee,jdbcType=INTEGER}, #{trialFee,jdbcType=INTEGER},
  37. #{printingFee,jdbcType=INTEGER}, #{isRequestFunds,jdbcType=INTEGER}, #{isReimbursement,jdbcType=INTEGER},
  38. #{paymentState,jdbcType=INTEGER})
  39. </insert>
  40. <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentCost" >
  41. insert into patent_cost
  42. <trim prefix="(" suffix=")" suffixOverrides="," >
  43. <if test="id != null" >
  44. id,
  45. </if>
  46. <if test="pid != null" >
  47. pid,
  48. </if>
  49. <if test="annualFee != null" >
  50. annual_fee,
  51. </if>
  52. <if test="annualFeeState != null" >
  53. annual_fee_state,
  54. </if>
  55. <if test="applicationFee != null" >
  56. application_fee,
  57. </if>
  58. <if test="trialFee != null" >
  59. trial_fee,
  60. </if>
  61. <if test="printingFee != null" >
  62. printing_fee,
  63. </if>
  64. <if test="isRequestFunds != null" >
  65. is_request_funds,
  66. </if>
  67. <if test="isReimbursement != null" >
  68. is_reimbursement,
  69. </if>
  70. <if test="paymentState != null" >
  71. payment_state,
  72. </if>
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides="," >
  75. <if test="id != null" >
  76. #{id,jdbcType=VARCHAR},
  77. </if>
  78. <if test="pid != null" >
  79. #{pid,jdbcType=VARCHAR},
  80. </if>
  81. <if test="annualFee != null" >
  82. #{annualFee,jdbcType=INTEGER},
  83. </if>
  84. <if test="annualFeeState != null" >
  85. #{annualFeeState,jdbcType=INTEGER},
  86. </if>
  87. <if test="applicationFee != null" >
  88. #{applicationFee,jdbcType=INTEGER},
  89. </if>
  90. <if test="trialFee != null" >
  91. #{trialFee,jdbcType=INTEGER},
  92. </if>
  93. <if test="printingFee != null" >
  94. #{printingFee,jdbcType=INTEGER},
  95. </if>
  96. <if test="isRequestFunds != null" >
  97. #{isRequestFunds,jdbcType=INTEGER},
  98. </if>
  99. <if test="isReimbursement != null" >
  100. #{isReimbursement,jdbcType=INTEGER},
  101. </if>
  102. <if test="paymentState != null" >
  103. #{paymentState,jdbcType=INTEGER},
  104. </if>
  105. </trim>
  106. </insert>
  107. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentCost" >
  108. update patent_cost
  109. <set >
  110. <if test="pid != null" >
  111. pid = #{pid,jdbcType=VARCHAR},
  112. </if>
  113. <if test="annualFee != null" >
  114. annual_fee = #{annualFee,jdbcType=INTEGER},
  115. </if>
  116. <if test="annualFeeState != null" >
  117. annual_fee_state = #{annualFeeState,jdbcType=INTEGER},
  118. </if>
  119. <if test="applicationFee != null" >
  120. application_fee = #{applicationFee,jdbcType=INTEGER},
  121. </if>
  122. <if test="trialFee != null" >
  123. trial_fee = #{trialFee,jdbcType=INTEGER},
  124. </if>
  125. <if test="printingFee != null" >
  126. printing_fee = #{printingFee,jdbcType=INTEGER},
  127. </if>
  128. <if test="is_request_funds != null" >
  129. is_request_funds = #{isRequestFunds,jdbcType=INTEGER},
  130. </if>
  131. <if test="is_reimbursement != null" >
  132. is_reimbursement = #{isReimbursement,jdbcType=INTEGER},
  133. </if>
  134. <if test="paymentState != null" >
  135. payment_state = #{paymentState,jdbcType=INTEGER},
  136. </if>
  137. </set>
  138. where id = #{id,jdbcType=VARCHAR}
  139. </update>
  140. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PatentCost" >
  141. update patent_cost
  142. set pid = #{pid,jdbcType=VARCHAR},
  143. annual_fee = #{annualFee,jdbcType=INTEGER},
  144. annual_fee_state = #{annualFeeState,jdbcType=INTEGER},
  145. application_fee = #{applicationFee,jdbcType=INTEGER},
  146. trial_fee = #{trialFee,jdbcType=INTEGER},
  147. printing_fee = #{printingFee,jdbcType=INTEGER},
  148. is_request_funds = #{isRequestFunds,jdbcType=INTEGER},
  149. is_reimbursement = #{isReimbursement,jdbcType=INTEGER},
  150. payment_state = #{paymentState,jdbcType=INTEGER}
  151. where id = #{id,jdbcType=VARCHAR}
  152. </update>
  153. <select id="findApplicationFeeListByPage" parameterType="String" resultType="com.goafanti.techservice.patent.bo.PatentApplicationFeeBo">
  154. select m.uid as uid , m.pid as pid , m.oid ,
  155. m.serialNumber ,m.patentNumber ,
  156. m.locationProvince , m.unitName ,
  157. m.patentName , m.authorizedDate ,
  158. c.id as cid ,
  159. c.payment_state as paymentState,c.application_fee as applicationFee ,
  160. c.trial_fee as trialFee , c.printing_fee as printingFee ,
  161. c.is_request_funds as isRequestFunds , c.is_reimbursement as isReimbursement
  162. from patent_cost c RIGHT JOIN
  163. (select u.id as uid , p.id as pid ,o.id as oid ,
  164. p.serial_number as serialNumber ,p.patent_number as patentNumber ,
  165. o.location_province as locationProvince , o.unit_name as unitName ,
  166. p.patent_name as patentName , p.authorized_date as authorizedDate
  167. from user u
  168. INNER JOIN patent_info p on u.id =p.uid
  169. INNER JOIN organization_identity o on o.uid = u.id
  170. where 1=1
  171. <if test="locationProvince != null">
  172. and o.location_province = #{locationProvince,jdbcType=VARCHAR}
  173. </if>
  174. <if test="pStart != null">
  175. and p.authorized_date <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
  176. </if>
  177. <if test="pEnd">
  178. and p.authorized_date <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
  179. </if>
  180. order by p.authorized_date DESC) m
  181. on c.pid = m.pid
  182. <if test="page_sql!=null">
  183. ${page_sql}
  184. </if>
  185. </select>
  186. <select id="findApplicationFeeCount" resultType="java.lang.Integer">
  187. select count(1) from (select m.uid as uid , m.pid as pid , m.oid ,
  188. m.serialNumber ,m.patentNumber ,
  189. m.locationProvince , m.unitName ,
  190. m.patentName , m.authorizedDate ,
  191. c.id as cid ,
  192. c.payment_state as paymentState,c.application_fee as applicationFee ,
  193. c.trial_fee as trialFee , c.printing_fee as printingFee ,
  194. c.is_request_funds as isRequestFunds , c.is_reimbursement as isReimbursement
  195. from patent_cost c RIGHT JOIN
  196. (select u.id as uid , p.id as pid ,o.id as oid ,
  197. p.serial_number as serialNumber ,p.patent_number as patentNumber ,
  198. o.location_province as locationProvince , o.unit_name as unitName ,
  199. p.patent_name as patentName , p.authorized_date as authorizedDate
  200. from user u
  201. INNER JOIN patent_info p on u.id =p.uid
  202. INNER JOIN organization_identity o on o.uid = u.id
  203. order by p.authorized_date DESC) m
  204. on c.pid = m.pid) n
  205. </select>
  206. </mapper>