OrgCognizanceMapper.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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.OrgCognizanceMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgCognizance" >
  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="contacts" property="contacts" jdbcType="INTEGER" />
  9. <result column="comment" property="comment" jdbcType="VARCHAR" />
  10. <result column="consultant" property="consultant" jdbcType="VARCHAR" />
  11. <result column="technical_field1" property="technicalField1" jdbcType="INTEGER" />
  12. <result column="technical_field2" property="technicalField2" jdbcType="INTEGER" />
  13. <result column="technical_field3" property="technicalField3" jdbcType="INTEGER" />
  14. <result column="basic_research_cost" property="basicResearchCost" jdbcType="DECIMAL" />
  15. <result column="accident" property="accident" jdbcType="INTEGER" />
  16. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  17. <result column="accept_date" property="acceptDate" jdbcType="TIMESTAMP" />
  18. <result column="issuing_date" property="issuingDate" jdbcType="TIMESTAMP" />
  19. <result column="certificate_number" property="certificateNumber" jdbcType="VARCHAR" />
  20. <result column="certificate_url" property="certificateUrl" jdbcType="VARCHAR" />
  21. <result column="state" property="state" jdbcType="INTEGER" />
  22. <result column="year" property="year" jdbcType="INTEGER" />
  23. <result column="record_time" property="recordTime" jdbcType="TIMESTAMP" />
  24. <result column="large_order" property="largeOrder" jdbcType="INTEGER" />
  25. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  26. <result column="founder" property="founder" jdbcType="VARCHAR" />
  27. </resultMap>
  28. <sql id="Base_Column_List" >
  29. id, uid, serial_number, contacts, comment, consultant, technical_field1, technical_field2,
  30. technical_field3, basic_research_cost, accident, create_time, accept_date, issuing_date,
  31. certificate_number, certificate_url, state, year, record_time, large_order, deleted_sign,
  32. founder
  33. </sql>
  34. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  35. select
  36. <include refid="Base_Column_List" />
  37. from org_cognizance
  38. where id = #{id,jdbcType=VARCHAR}
  39. </select>
  40. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  41. delete from org_cognizance
  42. where id = #{id,jdbcType=VARCHAR}
  43. </delete>
  44. <insert id="insert" parameterType="com.goafanti.common.model.OrgCognizance" >
  45. insert into org_cognizance (id, uid, serial_number,
  46. contacts, comment, consultant,
  47. technical_field1, technical_field2, technical_field3,
  48. basic_research_cost, accident, create_time,
  49. accept_date, issuing_date, certificate_number,
  50. certificate_url, state, year, record_time, large_order, deleted_sign, founder
  51. )
  52. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER},
  53. #{contacts,jdbcType=INTEGER}, #{comment,jdbcType=VARCHAR}, #{consultant,jdbcType=VARCHAR},
  54. #{technicalField1,jdbcType=INTEGER}, #{technicalField2,jdbcType=INTEGER}, #{technicalField3,jdbcType=INTEGER},
  55. #{basicResearchCost,jdbcType=DECIMAL}, #{accident,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
  56. #{acceptDate,jdbcType=TIMESTAMP}, #{issuingDate,jdbcType=TIMESTAMP}, #{certificateNumber,jdbcType=VARCHAR},
  57. #{certificateUrl,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, #{year,jdbcType=INTEGER}, #{recordTime,jdbcType=TIMESTAMP},
  58. #{largeOrder,jdbcType=INTEGER}, #{deletedSign,jdbcType=INTEGER}, #{founder,jdbcType=VARCHAR}
  59. )
  60. </insert>
  61. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgCognizance" >
  62. insert into org_cognizance
  63. <trim prefix="(" suffix=")" suffixOverrides="," >
  64. <if test="id != null" >
  65. id,
  66. </if>
  67. <if test="uid != null" >
  68. uid,
  69. </if>
  70. <if test="serialNumber != null" >
  71. serial_number,
  72. </if>
  73. <if test="contacts != null" >
  74. contacts,
  75. </if>
  76. <if test="comment != null" >
  77. comment,
  78. </if>
  79. <if test="consultant != null" >
  80. consultant,
  81. </if>
  82. <if test="technicalField1 != null" >
  83. technical_field1,
  84. </if>
  85. <if test="technicalField2 != null" >
  86. technical_field2,
  87. </if>
  88. <if test="technicalField3 != null" >
  89. technical_field3,
  90. </if>
  91. <if test="basicResearchCost != null" >
  92. basic_research_cost,
  93. </if>
  94. <if test="accident != null" >
  95. accident,
  96. </if>
  97. <if test="createTime != null" >
  98. create_time,
  99. </if>
  100. <if test="acceptDate != null" >
  101. accept_date,
  102. </if>
  103. <if test="issuingDate != null" >
  104. issuing_date,
  105. </if>
  106. <if test="certificateNumber != null" >
  107. certificate_number,
  108. </if>
  109. <if test="certificateUrl != null" >
  110. certificate_url,
  111. </if>
  112. <if test="state != null" >
  113. state,
  114. </if>
  115. <if test="year != null" >
  116. year,
  117. </if>
  118. <if test="recordTime != null" >
  119. record_time,
  120. </if>
  121. <if test="largeOrder != null" >
  122. large_order,
  123. </if>
  124. <if test="deletedSign != null" >
  125. deleted_sign,
  126. </if>
  127. <if test="founder != null" >
  128. founder,
  129. </if>
  130. </trim>
  131. <trim prefix="values (" suffix=")" suffixOverrides="," >
  132. <if test="id != null" >
  133. #{id,jdbcType=VARCHAR},
  134. </if>
  135. <if test="uid != null" >
  136. #{uid,jdbcType=VARCHAR},
  137. </if>
  138. <if test="serialNumber != null" >
  139. #{serialNumber,jdbcType=INTEGER},
  140. </if>
  141. <if test="contacts != null" >
  142. #{contacts,jdbcType=INTEGER},
  143. </if>
  144. <if test="comment != null" >
  145. #{comment,jdbcType=VARCHAR},
  146. </if>
  147. <if test="consultant != null" >
  148. #{consultant,jdbcType=VARCHAR},
  149. </if>
  150. <if test="technicalField1 != null" >
  151. #{technicalField1,jdbcType=INTEGER},
  152. </if>
  153. <if test="technicalField2 != null" >
  154. #{technicalField2,jdbcType=INTEGER},
  155. </if>
  156. <if test="technicalField3 != null" >
  157. #{technicalField3,jdbcType=INTEGER},
  158. </if>
  159. <if test="basicResearchCost != null" >
  160. #{basicResearchCost,jdbcType=DECIMAL},
  161. </if>
  162. <if test="accident != null" >
  163. #{accident,jdbcType=INTEGER},
  164. </if>
  165. <if test="createTime != null" >
  166. #{createTime,jdbcType=TIMESTAMP},
  167. </if>
  168. <if test="acceptDate != null" >
  169. #{acceptDate,jdbcType=TIMESTAMP},
  170. </if>
  171. <if test="issuingDate != null" >
  172. #{issuingDate,jdbcType=TIMESTAMP},
  173. </if>
  174. <if test="certificateNumber != null" >
  175. #{certificateNumber,jdbcType=VARCHAR},
  176. </if>
  177. <if test="certificateUrl != null" >
  178. #{certificateUrl,jdbcType=VARCHAR},
  179. </if>
  180. <if test="state != null" >
  181. #{state,jdbcType=INTEGER},
  182. </if>
  183. <if test="year != null" >
  184. #{year,jdbcType=INTEGER},
  185. </if>
  186. <if test="recordTime != null" >
  187. #{recordTime,jdbcType=TIMESTAMP},
  188. </if>
  189. <if test="largeOrder != null" >
  190. #{largeOrder,jdbcType=INTEGER},
  191. </if>
  192. <if test="deletedSign != null" >
  193. #{deletedSign,jdbcType=INTEGER},
  194. </if>
  195. <if test="founder != null" >
  196. #{founder,jdbcType=VARCHAR},
  197. </if>
  198. </trim>
  199. </insert>
  200. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgCognizance" >
  201. update org_cognizance
  202. <set >
  203. <if test="uid != null" >
  204. uid = #{uid,jdbcType=VARCHAR},
  205. </if>
  206. <if test="serialNumber != null" >
  207. serial_number = #{serialNumber,jdbcType=INTEGER},
  208. </if>
  209. <if test="contacts != null" >
  210. contacts = #{contacts,jdbcType=INTEGER},
  211. </if>
  212. <if test="comment != null" >
  213. comment = #{comment,jdbcType=VARCHAR},
  214. </if>
  215. <if test="consultant != null" >
  216. consultant = #{consultant,jdbcType=VARCHAR},
  217. </if>
  218. <if test="technicalField1 != null" >
  219. technical_field1 = #{technicalField1,jdbcType=INTEGER},
  220. </if>
  221. <if test="technicalField2 != null" >
  222. technical_field2 = #{technicalField2,jdbcType=INTEGER},
  223. </if>
  224. <if test="technicalField3 != null" >
  225. technical_field3 = #{technicalField3,jdbcType=INTEGER},
  226. </if>
  227. <if test="basicResearchCost != null" >
  228. basic_research_cost = #{basicResearchCost,jdbcType=DECIMAL},
  229. </if>
  230. <if test="accident != null" >
  231. accident = #{accident,jdbcType=INTEGER},
  232. </if>
  233. <if test="createTime != null" >
  234. create_time = #{createTime,jdbcType=TIMESTAMP},
  235. </if>
  236. <if test="acceptDate != null" >
  237. accept_date = #{acceptDate,jdbcType=TIMESTAMP},
  238. </if>
  239. <if test="issuingDate != null" >
  240. issuing_date = #{issuingDate,jdbcType=TIMESTAMP},
  241. </if>
  242. <if test="certificateNumber != null" >
  243. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  244. </if>
  245. <if test="certificateUrl != null" >
  246. certificate_url = #{certificateUrl,jdbcType=VARCHAR},
  247. </if>
  248. <if test="state != null" >
  249. state = #{state,jdbcType=INTEGER},
  250. </if>
  251. <if test="year != null" >
  252. year = #{year,jdbcType=INTEGER},
  253. </if>
  254. <if test="recordTime != null" >
  255. record_time = #{recordTime,jdbcType=TIMESTAMP},
  256. </if>
  257. <if test="largeOrder != null" >
  258. large_order = #{largeOrder,jdbcType=INTEGER},
  259. </if>
  260. <if test="deletedSign != null" >
  261. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  262. </if>
  263. <if test="founder != null" >
  264. founder = #{founder,jdbcType=VARCHAR},
  265. </if>
  266. </set>
  267. where id = #{id,jdbcType=VARCHAR}
  268. </update>
  269. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrgCognizance" >
  270. update org_cognizance
  271. set uid = #{uid,jdbcType=VARCHAR},
  272. serial_number = #{serialNumber,jdbcType=INTEGER},
  273. contacts = #{contacts,jdbcType=INTEGER},
  274. comment = #{comment,jdbcType=VARCHAR},
  275. consultant = #{consultant,jdbcType=VARCHAR},
  276. technical_field1 = #{technicalField1,jdbcType=INTEGER},
  277. technical_field2 = #{technicalField2,jdbcType=INTEGER},
  278. technical_field3 = #{technicalField3,jdbcType=INTEGER},
  279. basic_research_cost = #{basicResearchCost,jdbcType=DECIMAL},
  280. accident = #{accident,jdbcType=INTEGER},
  281. create_time = #{createTime,jdbcType=TIMESTAMP},
  282. accept_date = #{acceptDate,jdbcType=TIMESTAMP},
  283. issuing_date = #{issuingDate,jdbcType=TIMESTAMP},
  284. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  285. certificate_url = #{certificateUrl,jdbcType=VARCHAR},
  286. state = #{state,jdbcType=INTEGER},
  287. year = #{year,jdbcType=INTEGER},
  288. record_time = #{recordTime,jdbcType=TIMESTAMP},
  289. large_order = #{largeOrder,jdbcType=INTEGER},
  290. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  291. founder = #{founder,jdbcType=VARCHAR}
  292. where id = #{id,jdbcType=VARCHAR}
  293. </update>
  294. <select id="findCognizanceBoByPage" parameterType="String" resultType="com.goafanti.cognizance.bo.CognizanceBo">
  295. select c.id as cid, c.uid as uid, c.serial_number as serialNumber, i.licence_province as locationProvince,
  296. i.unit_name as unitName, c.contacts, c.create_time as createTime,
  297. c.comment, c.state, c.certificate_number as certificateNumber, c.large_order as largeOrder,
  298. c.issuing_date as issuingDate, c.year, a.name as consultant,
  299. CONCAT(i.first_contacts,' ', i.first_mobile) as firstContacts,
  300. CONCAT(i.second_contacts,' ', i.second_mobile) as secondContacts,
  301. CONCAT(i.third_contacts,' ', i.third_mobile) as thirdContacts,
  302. ad.name as founder
  303. from org_cognizance c
  304. LEFT JOIN organization_identity i on c.uid = i.uid
  305. LEFT JOIN admin a on c.consultant = a.id
  306. LEFT JOIN admin ad on c.founder = ad.id
  307. <if test="principal != null">
  308. left join org_cognizance_log l on c.id=l.cid
  309. </if>
  310. where c.deleted_sign = 0
  311. <if test="principal != null">
  312. and l.principal = #{principal,jdbcType=VARCHAR}
  313. </if>
  314. <if test="unitName != null">
  315. and i.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
  316. </if>
  317. <if test="uid != null">
  318. and c.uid = #{uid,jdbcType=VARCHAR}
  319. </if>
  320. <if test="locationProvince != null">
  321. and i.licence_province = #{locationProvince, jdbcType=VARCHAR}
  322. </if>
  323. <if test="principal != null">
  324. group by c.id
  325. </if>
  326. order by c.serial_number desc
  327. <if test="page_sql!=null">
  328. ${page_sql}
  329. </if>
  330. </select>
  331. <select id="findCognizanceBoCount" resultType="java.lang.Integer" parameterType="String">
  332. select count(1)
  333. from org_cognizance c
  334. LEFT JOIN organization_identity i on c.uid = i.uid
  335. <if test="principal != null">
  336. left join org_cognizance_log l on c.id=l.cid
  337. </if>
  338. where c.deleted_sign = 0
  339. <if test="principal != null">
  340. and l.principal = #{principal,jdbcType=VARCHAR}
  341. </if>
  342. <if test="uid != null">
  343. and c.uid = #{uid,jdbcType=VARCHAR}
  344. </if>
  345. <if test="unitName != null">
  346. and i.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
  347. </if>
  348. <if test="locationProvince != null">
  349. and i.licence_province = #{locationProvince, jdbcType=VARCHAR}
  350. </if>
  351. <if test="principal != null">
  352. group by c.id
  353. </if>
  354. </select>
  355. <select id="selectCognizanceOrgInfoBoByUidAndCid" resultType="com.goafanti.cognizance.bo.CognizanceOrgInfoBo">
  356. select u.id as uid, c.id as cid, o.unit_name as unitName, o.org_code as orgCode, o.postal_address as postalAddress,
  357. c.contacts, c.technical_field1 as technicalField1, c.technical_field2 as technicalField2, c.technical_field3 as technicalField3,
  358. c.basic_research_cost as basicResearchCost, c.accident, c.large_order as largeOrder, c.year
  359. from (select id from user where id = #{0}) u
  360. LEFT JOIN organization_identity o on u.id = o.uid
  361. INNER JOIN org_cognizance c on c.uid = u.id and c.deleted_sign = 0 and c.id = #{1}
  362. </select>
  363. <select id="selectCognizanceResearchCostBoByUidAndYear" resultType="com.goafanti.cognizance.bo.CognizanceResearchCostBo">
  364. select m.uid, sum(m.cost1) as researchCost, sum(m.territory) as territory from(
  365. select uid, (internal_labor_cost + internal_direct_cost + internal_depreciation_cost + internal_amortization_cost
  366. + internal_design_cost + internal_equipment_cost + internal_other_cost +external_total_cost) as cost1,
  367. external_abroad_cost as territory
  368. from org_activity_cost
  369. where (start_date >= (select str_to_date(CONCAT(#{0}-3,'-01-01'), '%Y-%m-%d %H'))
  370. and start_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H')))
  371. or (end_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H')) and
  372. end_date >= (select str_to_date(CONCAT(#{0}-3,'-01-01'), '%Y-%m-%d %H')))
  373. and deleted_sign = 0
  374. ) m where m.uid = #{1} GROUP BY m.uid
  375. </select>
  376. <select id="selectCognizanceManageCostBoByUidAndYear" resultType="com.goafanti.cognizance.bo.CognizanceManageCostBo">
  377. select u.id as uid, a.netAsset1, a.salesRevenue1, a.grossProfit1, b.netAsset2, b.salesRevenue2, b.grossProfit2,
  378. c.netAsset3, c.salesRevenue3, c.grossProfit3 from
  379. (select id from user where id = #{1}) u
  380. LEFT JOIN
  381. (
  382. select uid, net_asset as netAsset1, gross_profit as grossProfit1, sales_revenue as salesRevenue1 from org_finance where uid = #{1} and year =
  383. #{0}-1 and deleted_sign = 0
  384. ) a ON a.uid = u.id
  385. LEFT JOIN
  386. (
  387. select uid, net_asset as netAsset2, gross_profit as grossProfit2, sales_revenue as salesRevenue2 from org_finance where uid = #{1} and year =
  388. #{0}-2 and deleted_sign = 0
  389. ) b on b.uid = u. id
  390. LEFT JOIN
  391. (
  392. select uid, net_asset as netAsset3, gross_profit as grossProfit3, sales_revenue as salesRevenue3 from org_finance where uid = #{1} and year =
  393. #{0}-3 and deleted_sign = 0
  394. ) c on c.uid = u.id
  395. </select>
  396. <select id="selectCognizanceCatagoryBoByUidAndYear" resultType="com.goafanti.cognizance.bo.CognizanceCatagoryBo">
  397. select u.id as uid, a.firstCatagory, b.secondCatagory, c.firmTotal, c.techTotal, d.totalRevenue FROM
  398. (select id from user where id = #{1}) u
  399. LEFT JOIN
  400. (select uid, count(1) as firstCatagory from org_intellectual_property
  401. where uid = #{1} and evaluation_category= 0 and deleted_sign = 0 GROUP BY uid
  402. ) a on a.uid = u.id
  403. LEFT JOIN
  404. (
  405. select uid, count(1) as secondCatagory from org_intellectual_property
  406. where uid = #{1} and evaluation_category = 1 and deleted_sign = 0 GROUP BY uid
  407. ) b on b.uid = u.id
  408. LEFT JOIN
  409. (
  410. select uid, firm_total as firmTotal, tech_total as techTotal from org_human_resource where uid = #{1} and year =
  411. #{0}-1 and deleted_sign = 0
  412. ) c on c.uid = u.id
  413. LEFT JOIN
  414. (
  415. SELECT uid,(operating_income + non_operating_income - non_taxable_income) as totalRevenue
  416. from org_ratepay where uid = #{1}
  417. and year = #{0}-1 and deleted_sign = 0
  418. ) d on d.uid = u.id
  419. </select>
  420. <select id="selectLastYearRevenueByUidAndYear" resultType="java.math.BigDecimal">
  421. SELECT sum(last_year_revenue) as lastYearRevenue
  422. from org_tech_product where uid = #{1}
  423. and year = #{0} and deleted_sign = 0
  424. </select>
  425. <select id="selectCognizanceByUidAndYear" resultMap="BaseResultMap" >
  426. select
  427. <include refid="Base_Column_List" />
  428. from org_cognizance
  429. where year = #{0} and uid = #{1} and deleted_sign = 0
  430. </select>
  431. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  432. update org_cognizance set deleted_sign = 1
  433. where id in
  434. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  435. #{item}
  436. </foreach>
  437. </update>
  438. <select id="findCultivationListByPage" parameterType="java.lang.String" resultType="com.goafanti.cognizance.bo.CultivationListBo">
  439. select u.id as uid, i.licence_province as province, i.unit_name as unitName, i.cog_contacts as cogContacts,
  440. i.certificate_number as certificateNumber, i.issuing_date as issuingDate, a.name as consultant,
  441. CONCAT(i.first_contacts,' ', i.first_mobile) as firstContacts,
  442. CONCAT(i.second_contacts,' ', i.second_mobile) as secondContacts,
  443. CONCAT(i.third_contacts,' ', i.third_mobile) as thirdContacts
  444. from organization_identity i
  445. RIGHT JOIN user u on u.id = i.uid
  446. LEFT JOIN admin a on a.id = i.consultant
  447. where u.type = 1 and u.lvl = 1
  448. <if test="unitName != null">
  449. and i.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
  450. </if>
  451. <if test="uid != null">
  452. and u.id = #{uid,jdbcType=VARCHAR}
  453. </if>
  454. <if test="province != null">
  455. and i.licence_province = #{province,jdbcType=VARCHAR}
  456. </if>
  457. <if test="page_sql!=null">
  458. ${page_sql}
  459. </if>
  460. </select>
  461. <select id="findCultivationCount" resultType="java.lang.Integer" parameterType="java.lang.String">
  462. select count(1)
  463. from organization_identity i
  464. RIGHT JOIN user u on u.id = i.uid
  465. LEFT JOIN admin a on a.id = i.consultant
  466. where u.type = 1 and u.lvl = 1
  467. <if test="unitName != null">
  468. and i.unit_name = #{unitName,jdbcType=VARCHAR}
  469. </if>
  470. <if test="uid != null">
  471. and u.id = #{uid,jdbcType=VARCHAR}
  472. </if>
  473. <if test="province != null">
  474. and i.licence_province = #{province,jdbcType=VARCHAR}
  475. </if>
  476. </select>
  477. <select id="selectLatelyRecord" resultType="com.goafanti.cognizance.bo.LatelyCogRecord" parameterType="java.lang.String" >
  478. select c.id, c.issuing_date as issuingDate, l.state, MAX(l.record_time) as recordTime
  479. from org_cognizance c LEFT JOIN org_cognizance_log l on
  480. c.id = l.cid where c.uid = #{uid,jdbcType=VARCHAR}
  481. </select>
  482. </mapper>