ContractMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  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.ContractMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.Contract" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="serial_number" property="serialNumber" jdbcType="INTEGER" />
  8. <result column="name" property="name" jdbcType="VARCHAR" />
  9. <result column="type" property="type" jdbcType="INTEGER" />
  10. <result column="sign_date" property="signDate" jdbcType="TIMESTAMP" />
  11. <result column="founder" property="founder" jdbcType="VARCHAR" />
  12. <result column="depict" property="depict" jdbcType="VARCHAR" />
  13. <result column="status" property="status" jdbcType="INTEGER" />
  14. <result column="patent_num" property="patentNum" jdbcType="INTEGER" />
  15. <result column="patent_status" property="patentStatus" jdbcType="INTEGER" />
  16. <result column="copyright_num" property="copyrightNum" jdbcType="INTEGER" />
  17. <result column="copyright_status" property="copyrightStatus" jdbcType="INTEGER" />
  18. <result column="cognizance_year" property="cognizanceYear" jdbcType="INTEGER" />
  19. <result column="cognizance_status" property="cognizanceStatus" jdbcType="INTEGER" />
  20. <result column="tech_project_num" property="techProjectNum" jdbcType="INTEGER" />
  21. <result column="tech_project_status" property="techProjectStatus" jdbcType="INTEGER" />
  22. <result column="comment" property="comment" jdbcType="VARCHAR" />
  23. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  24. <result column="complete_date" property="completeDate" jdbcType="TIMESTAMP" />
  25. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  26. <result column="contacts" property="contacts" jdbcType="INTEGER" />
  27. <result column="previous_fee" property="previousFee" jdbcType="VARCHAR" />
  28. </resultMap>
  29. <sql id="Base_Column_List" >
  30. id, uid, serial_number, name, type, sign_date, founder, depict, status, patent_num,
  31. patent_status, copyright_num, copyright_status, cognizance_year, cognizance_status,
  32. tech_project_num, tech_project_status, comment, create_time, complete_date, deleted_sign,
  33. contacts, previous_fee
  34. </sql>
  35. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  36. select
  37. <include refid="Base_Column_List" />
  38. from contract
  39. where id = #{id,jdbcType=VARCHAR}
  40. </select>
  41. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  42. delete from contract
  43. where id = #{id,jdbcType=VARCHAR}
  44. </delete>
  45. <insert id="insert" parameterType="com.goafanti.common.model.Contract" >
  46. insert into contract (id, uid, serial_number,
  47. name, type, sign_date,
  48. founder, depict, status,
  49. patent_num, patent_status, copyright_num,
  50. copyright_status, cognizance_year, cognizance_status,
  51. tech_project_num, tech_project_status, comment,
  52. create_time, complete_date, deleted_sign, contacts, previous_fee
  53. )
  54. values (
  55. #{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER},
  56. #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{signDate,jdbcType=TIMESTAMP},
  57. #{founder,jdbcType=VARCHAR}, #{depict,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
  58. #{patentNum,jdbcType=INTEGER}, #{patentStatus,jdbcType=INTEGER}, #{copyrightNum,jdbcType=INTEGER},
  59. #{copyrightStatus,jdbcType=INTEGER}, #{cognizanceYear,jdbcType=INTEGER}, #{cognizanceStatus,jdbcType=INTEGER},
  60. #{techProjectNum,jdbcType=INTEGER}, #{techProjectStatus,jdbcType=INTEGER}, #{comment,jdbcType=VARCHAR},
  61. #{createTime,jdbcType=TIMESTAMP}, #{completeDate,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=INTEGER},
  62. #{contacts,jdbcType=INTEGER}, #{previousFee,jdbcType=VARCHAR}
  63. )
  64. </insert>
  65. <insert id="insertSelective" parameterType="com.goafanti.common.model.Contract" >
  66. insert into contract
  67. <trim prefix="(" suffix=")" suffixOverrides="," >
  68. <if test="id != null" >
  69. id,
  70. </if>
  71. <if test="uid != null" >
  72. uid,
  73. </if>
  74. <if test="serialNumber != null" >
  75. serial_number,
  76. </if>
  77. <if test="name != null" >
  78. name,
  79. </if>
  80. <if test="type != null" >
  81. type,
  82. </if>
  83. <if test="signDate != null" >
  84. sign_date,
  85. </if>
  86. <if test="founder != null" >
  87. founder,
  88. </if>
  89. <if test="depict != null" >
  90. depict,
  91. </if>
  92. <if test="status != null" >
  93. status,
  94. </if>
  95. <if test="patentNum != null" >
  96. patent_num,
  97. </if>
  98. <if test="patentStatus != null" >
  99. patent_status,
  100. </if>
  101. <if test="copyrightNum != null" >
  102. copyright_num,
  103. </if>
  104. <if test="copyrightStatus != null" >
  105. copyright_status,
  106. </if>
  107. <if test="cognizanceYear != null" >
  108. cognizance_year,
  109. </if>
  110. <if test="cognizanceStatus != null" >
  111. cognizance_status,
  112. </if>
  113. <if test="techProjectNum != null" >
  114. tech_project_num,
  115. </if>
  116. <if test="techProjectStatus != null" >
  117. tech_project_status,
  118. </if>
  119. <if test="comment != null" >
  120. comment,
  121. </if>
  122. <if test="createTime != null" >
  123. create_time,
  124. </if>
  125. <if test="completeDate != null" >
  126. complete_date,
  127. </if>
  128. <if test="deletedSign != null" >
  129. deleted_sign,
  130. </if>
  131. <if test="contacts != null" >
  132. contacts,
  133. </if>
  134. <if test="previousFee != null" >
  135. previous_fee,
  136. </if>
  137. </trim>
  138. <trim prefix="values (" suffix=")" suffixOverrides="," >
  139. <if test="id != null" >
  140. #{id,jdbcType=VARCHAR},
  141. </if>
  142. <if test="uid != null" >
  143. #{uid,jdbcType=VARCHAR},
  144. </if>
  145. <if test="serialNumber != null" >
  146. #{serialNumber,jdbcType=INTEGER},
  147. </if>
  148. <if test="name != null" >
  149. #{name,jdbcType=VARCHAR},
  150. </if>
  151. <if test="type != null" >
  152. #{type,jdbcType=INTEGER},
  153. </if>
  154. <if test="signDate != null" >
  155. #{signDate,jdbcType=TIMESTAMP},
  156. </if>
  157. <if test="founder != null" >
  158. #{founder,jdbcType=VARCHAR},
  159. </if>
  160. <if test="depict != null" >
  161. #{depict,jdbcType=VARCHAR},
  162. </if>
  163. <if test="status != null" >
  164. #{status,jdbcType=INTEGER},
  165. </if>
  166. <if test="patentNum != null" >
  167. #{patentNum,jdbcType=INTEGER},
  168. </if>
  169. <if test="patentStatus != null" >
  170. #{patentStatus,jdbcType=INTEGER},
  171. </if>
  172. <if test="copyrightNum != null" >
  173. #{copyrightNum,jdbcType=INTEGER},
  174. </if>
  175. <if test="copyrightStatus != null" >
  176. #{copyrightStatus,jdbcType=INTEGER},
  177. </if>
  178. <if test="cognizanceYear != null" >
  179. #{cognizanceYear,jdbcType=INTEGER},
  180. </if>
  181. <if test="cognizanceStatus != null" >
  182. #{cognizanceStatus,jdbcType=INTEGER},
  183. </if>
  184. <if test="techProjectNum != null" >
  185. #{techProjectNum,jdbcType=INTEGER},
  186. </if>
  187. <if test="techProjectStatus != null" >
  188. #{techProjectStatus,jdbcType=INTEGER},
  189. </if>
  190. <if test="comment != null" >
  191. #{comment,jdbcType=VARCHAR},
  192. </if>
  193. <if test="createTime != null" >
  194. #{createTime,jdbcType=TIMESTAMP},
  195. </if>
  196. <if test="completeDate != null" >
  197. #{completeDate,jdbcType=TIMESTAMP},
  198. </if>
  199. <if test="deletedSign != null" >
  200. #{deletedSign,jdbcType=INTEGER},
  201. </if>
  202. <if test="contacts != null" >
  203. #{contacts,jdbcType=INTEGER},
  204. </if>
  205. <if test="previousFee != null" >
  206. #{previousFee,jdbcType=VARCHAR},
  207. </if>
  208. </trim>
  209. </insert>
  210. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Contract" >
  211. update contract
  212. <set >
  213. <if test="uid != null" >
  214. uid = #{uid,jdbcType=VARCHAR},
  215. </if>
  216. <if test="serialNumber != null" >
  217. serial_number = #{serialNumber,jdbcType=INTEGER},
  218. </if>
  219. <if test="name != null" >
  220. name = #{name,jdbcType=VARCHAR},
  221. </if>
  222. <if test="type != null" >
  223. type = #{type,jdbcType=INTEGER},
  224. </if>
  225. <if test="signDate != null" >
  226. sign_date = #{signDate,jdbcType=TIMESTAMP},
  227. </if>
  228. <if test="founder != null" >
  229. founder = #{founder,jdbcType=VARCHAR},
  230. </if>
  231. <if test="depict != null" >
  232. depict = #{depict,jdbcType=VARCHAR},
  233. </if>
  234. <if test="status != null" >
  235. status = #{status,jdbcType=INTEGER},
  236. </if>
  237. <if test="patentNum != null" >
  238. patent_num = #{patentNum,jdbcType=INTEGER},
  239. </if>
  240. <if test="patentStatus != null" >
  241. patent_status = #{patentStatus,jdbcType=INTEGER},
  242. </if>
  243. <if test="copyrightNum != null" >
  244. copyright_num = #{copyrightNum,jdbcType=INTEGER},
  245. </if>
  246. <if test="copyrightStatus != null" >
  247. copyright_status = #{copyrightStatus,jdbcType=INTEGER},
  248. </if>
  249. <if test="cognizanceYear != null" >
  250. cognizance_year = #{cognizanceYear,jdbcType=INTEGER},
  251. </if>
  252. <if test="cognizanceStatus != null" >
  253. cognizance_status = #{cognizanceStatus,jdbcType=INTEGER},
  254. </if>
  255. <if test="techProjectNum != null" >
  256. tech_project_num = #{techProjectNum,jdbcType=INTEGER},
  257. </if>
  258. <if test="techProjectStatus != null" >
  259. tech_project_status = #{techProjectStatus,jdbcType=INTEGER},
  260. </if>
  261. <if test="comment != null" >
  262. comment = #{comment,jdbcType=VARCHAR},
  263. </if>
  264. <if test="createTime != null" >
  265. create_time = #{createTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="completeDate != null" >
  268. complete_date = #{completeDate,jdbcType=TIMESTAMP},
  269. </if>
  270. <if test="deletedSign != null" >
  271. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  272. </if>
  273. <if test="contacts != null" >
  274. contacts = #{contacts,jdbcType=INTEGER},
  275. </if>
  276. <if test="previousFee != null" >
  277. previous_fee = #{previousFee,jdbcType=VARCHAR},
  278. </if>
  279. </set>
  280. where id = #{id,jdbcType=VARCHAR}
  281. </update>
  282. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Contract" >
  283. update contract
  284. set uid = #{uid,jdbcType=VARCHAR},
  285. serial_number = #{serialNumber,jdbcType=INTEGER},
  286. name = #{name,jdbcType=VARCHAR},
  287. type = #{type,jdbcType=INTEGER},
  288. sign_date = #{signDate,jdbcType=TIMESTAMP},
  289. founder = #{founder,jdbcType=VARCHAR},
  290. depict = #{depict,jdbcType=VARCHAR},
  291. status = #{status,jdbcType=INTEGER},
  292. patent_num = #{patentNum,jdbcType=INTEGER},
  293. patent_status = #{patentStatus,jdbcType=INTEGER},
  294. copyright_num = #{copyrightNum,jdbcType=INTEGER},
  295. copyright_status = #{copyrightStatus,jdbcType=INTEGER},
  296. cognizance_year = #{cognizanceYear,jdbcType=INTEGER},
  297. cognizance_status = #{cognizanceStatus,jdbcType=INTEGER},
  298. tech_project_num = #{techProjectNum,jdbcType=INTEGER},
  299. tech_project_status = #{techProjectStatus,jdbcType=INTEGER},
  300. comment = #{comment,jdbcType=VARCHAR},
  301. create_time = #{createTime,jdbcType=TIMESTAMP},
  302. complete_date = #{completeDate,jdbcType=TIMESTAMP},
  303. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  304. contacts = #{contacts,jdbcType=INTEGER},
  305. previous_fee = #{previousFee,jdbcType=VARCHAR}
  306. where id = #{id,jdbcType=VARCHAR}
  307. </update>
  308. <select id="findManageContractListByPage" parameterType="String" resultType="com.goafanti.contract.bo.ContractManageListBo">
  309. select c.id, c.uid, oi.unit_name as unitName,
  310. oi.licence_province as province, c.serial_number as serialNumber, c.type,
  311. c.sign_date as signDate, a.name as founder,
  312. c.depict, c.status, c.complete_date as completeDate, c.contacts
  313. from contract c
  314. LEFT JOIN organization_identity oi on oi.uid = c.uid
  315. LEFT JOIN admin a on a.id = c.founder
  316. <if test="principal != null">
  317. LEFT JOIN contract_log cl on cl.cid = c.id
  318. </if>
  319. where c.deleted_sign = 0
  320. <if test="principal != null">
  321. and cl.principal = #{principal,jdbcType=VARCHAR}
  322. </if>
  323. <if test="serialNumber !=null">
  324. and c.serialNumber = #{serialNumber,jdbcType=INTEGER}
  325. </if>
  326. <if test="id !=null">
  327. and c.id = #{id,jdbcType=VARCHAR}
  328. </if>
  329. <if test="type !=null">
  330. and c.type = #{type,jdbcType=INTEGER}
  331. </if>
  332. <if test="uid !=null">
  333. and c.uid = #{uid,jdbcType=INTEGER}
  334. </if>
  335. <if test="status !=null">
  336. and c.status= #{status ,jdbcType=INTEGER}
  337. </if>
  338. <if test="cStart !=null">
  339. and c.sign_date <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  340. </if>
  341. <if test="cEnd !=null">
  342. and c.sign_date <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  343. </if>
  344. <if test="province !=null">
  345. and oi.licence_province= #{province,jdbcType=INTEGER}
  346. </if>
  347. <if test="unitName !=null">
  348. and oi.unit_name= #{unitName,jdbcType=VARCAHR}
  349. </if>
  350. <if test="principal != null">
  351. group by c.id
  352. </if>
  353. order by c.serial_number DESC
  354. <if test="page_sql!=null">
  355. ${page_sql}
  356. </if>
  357. </select>
  358. <select id="findManageContractCount" resultType="java.lang.Integer"
  359. parameterType="String">
  360. select count(1)
  361. from contract c
  362. LEFT JOIN organization_identity oi on oi.uid = c.uid
  363. LEFT JOIN admin a on a.id = c.founder
  364. <if test="principal != null">
  365. LEFT JOIN contract_log cl on cl.cid = c.id
  366. </if>
  367. where c.deleted_sign = 0
  368. <if test="principal != null">
  369. and cl.principal = #{principal,jdbcType=VARCHAR}
  370. </if>
  371. <if test="id !=null">
  372. and c.id = #{id,jdbcType=VARCHAR}
  373. </if>
  374. <if test="serialNumber !=null">
  375. and c.serialNumber = #{serialNumber,jdbcType=INTEGER}
  376. </if>
  377. <if test="type !=null">
  378. and c.type = #{type,jdbcType=INTEGER}
  379. </if>
  380. <if test="uid !=null">ContractDetail
  381. and c.uid = #{uid,jdbcType=INTEGER}
  382. </if>
  383. <if test="status !=null">
  384. and c.status= #{status ,jdbcType=INTEGER}
  385. </if>
  386. <if test="cStart !=null">
  387. and c.sign_date <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  388. </if>
  389. <if test="cEnd !=null">
  390. and c.sign_date <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  391. </if>
  392. <if test="province !=null">
  393. and oi.licence_province= #{province,jdbcType=INTEGER}
  394. </if>
  395. <if test="unitName !=null">
  396. and oi.unit_name= #{unitName,jdbcType=VARCAHR}
  397. </if>
  398. <if test="principal != null">
  399. group by c.id
  400. </if>
  401. </select>
  402. <select id="selectContractDetail" parameterType="java.lang.String" resultType="com.goafanti.contract.bo.ContractDetail">
  403. select
  404. c.id, c.uid, c.serial_number as serialNumber,
  405. oi.unit_name as unitName, oi.org_code as orgCode, oi.postal_address as address,
  406. c.type, c.sign_date as signDate, a.name as founder,
  407. c.depict, c.status, c.patent_num as patentNum,
  408. c.patent_status as patentStatus, c.copyright_num as copyrightNum, c.copyright_status as copyrightStatus,
  409. c.cognizance_year as cognizanceYear, c.cognizance_status as cognizanceStatus, c.tech_project_num as techProjectNum,
  410. c.tech_project_status as techProjectStatus, c.comment, c.complete_date as completeDate,
  411. c.contacts, c.previous_fee as previousFee
  412. from contract c
  413. LEFT JOIN organization_identity oi on oi.uid = c.uid
  414. LEFT JOIN admin a on a.id = c.founder
  415. where c.deleted_sign = 0 and c.id = #{id,jdbcType=VARCHAR}
  416. </select>
  417. <select id="selectContractSerialNumber" resultType="com.goafanti.contract.bo.ContractSerialNumber" parameterType="java.lang.String">
  418. select c.id as contractId, c.serial_number as serialNumber
  419. from contract c
  420. <if test="_parameter != null">
  421. LEFT JOIN contract_log cl on cl.cid = c.id
  422. </if>
  423. where c.deleted_sign = 0
  424. <if test="_parameter !=null">
  425. and cl.principal = #{_parameter,jdbcType=VARCHAR}
  426. </if>
  427. <if test="_parameter != null">
  428. group by c.id
  429. </if>
  430. order by c.serial_number desc
  431. </select>
  432. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  433. update contract set deleted_sign = 1
  434. where id in
  435. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  436. #{item}
  437. </foreach>
  438. </update>
  439. <select id="findClientContractListByPage" parameterType="String" resultType="com.goafanti.contract.bo.ContractClientListBo">
  440. select c.id, c.uid, c.serial_number as serialNumber, c.type,
  441. c.sign_date as signDate,
  442. c.depict, c.status, c.complete_date as completeDate, c.contacts
  443. from contract c
  444. where c.deleted_sign = 0
  445. <if test="serialNumber !=null">
  446. and c.serial_number = #{serialNumber,jdbcType=INTEGER}
  447. </if>
  448. <if test="id !=null">
  449. and c.id = #{id,jdbcType=VARCHAR}
  450. </if>
  451. <if test="type !=null">
  452. and c.type = #{type,jdbcType=INTEGER}
  453. </if>
  454. <if test="uid !=null">
  455. and c.uid = #{uid,jdbcType=INTEGER}
  456. </if>
  457. <if test="status !=null">
  458. and c.status= #{status ,jdbcType=INTEGER}
  459. </if>
  460. <if test="cStart !=null">
  461. and c.sign_date <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
  462. </if>
  463. <if test="cEnd !=null">
  464. and c.sign_date <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  465. </if>
  466. <if test="lStart !=null">
  467. and c.complete_date <![CDATA[ >= ]]> #{lStart,jdbcType=TIMESTAMP}
  468. </if>
  469. <if test="lEnd !=null">
  470. and c.complete_date <![CDATA[ < ]]> #{lEnd,jdbcType=TIMESTAMP}
  471. </if>
  472. order by c.serial_number DESC
  473. <if test="page_sql!=null">
  474. ${page_sql}
  475. </if>
  476. </select>
  477. <select id="findClientContractCount" resultType="java.lang.Integer"
  478. parameterType="String">
  479. select count(1)
  480. from contract c
  481. where c.deleted_sign = 0
  482. <if test="serialNumber !=null">
  483. and c.serial_number = #{serialNumber,jdbcType=INTEGER}
  484. </if>
  485. <if test="id !=null">
  486. and c.id = #{id,jdbcType=VARCHAR}
  487. </if>
  488. <if test="type !=null">
  489. and c.type = #{type,jdbcType=INTEGER}
  490. </if>
  491. <if test="uid !=null">
  492. and c.uid = #{uid,jdbcType=INTEGER}
  493. </if>
  494. <if test="status !=null">
  495. and c.status= #{status ,jdbcType=INTEGER}
  496. </if>
  497. <if test="cStart !=null">
  498. and c.sign_date <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
  499. </if>
  500. <if test="cEnd !=null">
  501. and c.sign_date <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
  502. </if>
  503. <if test="lStart !=null">
  504. and c.complete_date <![CDATA[ >= ]]> #{lStart,jdbcType=TIMESTAMP}
  505. </if>
  506. <if test="lEnd !=null">
  507. and c.complete_date <![CDATA[ < ]]> #{lEnd,jdbcType=TIMESTAMP}
  508. </if>
  509. </select>
  510. <select id="findByUidAndYear" resultMap="BaseResultMap">
  511. select
  512. <include refid="Base_Column_List" />
  513. from contract
  514. where uid = #{uid,jdbcType=VARCHAR}
  515. and cognizance_year = #{year,jdbcType=INTEGER}
  516. and deleted_sign = 0
  517. </select>
  518. <select id="findLatelyRecordByUid" parameterType="java.lang.String" resultMap="BaseResultMap">
  519. select
  520. <include refid="Base_Column_List" />
  521. from contract
  522. where cognizance_year =
  523. (select
  524. Max(cognizance_year)
  525. from contract
  526. where uid = #{uid,jdbcType=VARCHAR}
  527. and deleted_sign = 0
  528. )
  529. </select>
  530. </mapper>