ProjectcontentinfoDao.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  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.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao">
  4. <sql id="projectcontentinfoColumns">
  5. a.id AS "id",
  6. a.create_by AS "createBy.id",
  7. a.create_date AS "createDate",
  8. a.update_by AS "updateBy.id",
  9. a.update_date AS "updateDate",
  10. a.remarks AS "remarks",
  11. a.del_flag AS "delFlag",
  12. a.parent_id AS "parent.id",
  13. a.parent_ids AS "parentIds",
  14. a.sort AS "sort",
  15. a.project_id AS "project.id",
  16. a.company_id AS "companyId",
  17. a.office_id AS "officeId",
  18. a.type AS "type",
  19. a.info_id AS "infoId",
  20. a.dict_type AS "dictType",
  21. a.name AS "name",
  22. a.link_id AS "linkId"
  23. </sql>
  24. <sql id="projectcontentinfoJoins">
  25. </sql>
  26. <delete id="deleteConsultant">
  27. delete from rural_report_consultant where projectId = #{projectId}
  28. </delete>
  29. <select id="get" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  30. SELECT
  31. <include refid="projectcontentinfoColumns"/>
  32. FROM project_content_info a
  33. <include refid="projectcontentinfoJoins"/>
  34. WHERE a.id = #{id}
  35. </select>
  36. <select id="getByProjectId" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  37. SELECT
  38. <include refid="projectcontentinfoColumns"/>
  39. FROM project_content_info a
  40. <include refid="projectcontentinfoJoins"/>
  41. WHERE a.project_id = #{projectId}
  42. order by update_date desc
  43. limit 1
  44. </select>
  45. <select id="getByInfoId" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  46. SELECT
  47. <include refid="projectcontentinfoColumns"/>
  48. FROM project_content_info a
  49. <include refid="projectcontentinfoJoins"/>
  50. WHERE a.info_id = #{infoId} AND (a.link_id is null or a.link_id='')
  51. </select>
  52. <select id="findList" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  53. SELECT
  54. <include refid="projectcontentinfoColumns"/>
  55. FROM project_content_info a
  56. <include refid="projectcontentinfoJoins"/>
  57. <where>
  58. a.del_flag = #{DEL_FLAG_NORMAL}
  59. <if test="name != null and name != ''">
  60. AND a.name = #{name}
  61. </if>
  62. <if test="type != null and type != ''">
  63. AND a.type = #{type}
  64. </if>
  65. <if test="parentIds != null and parentIds != ''">
  66. AND a.parent_ids = #{parentIds}
  67. </if>
  68. <if test="project != null and project.id != null and project.id != ''">
  69. AND a.project_id = #{project.id}
  70. </if>
  71. </where>
  72. <choose>
  73. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  74. ORDER BY ${page.orderBy}
  75. </when>
  76. <otherwise>
  77. ORDER BY a.sort ASC
  78. </otherwise>
  79. </choose>
  80. </select>
  81. <select id="findByParentIds" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  82. SELECT
  83. <include refid="projectcontentinfoColumns"/>
  84. FROM project_content_info a
  85. <include refid="projectcontentinfoJoins"/>
  86. <where>
  87. a.del_flag = '0'
  88. AND a.project_id = #{projectId}
  89. AND a.parent_ids LIKE concat('%',#{parentId},'%')
  90. </where>
  91. ORDER BY a.sort ASC
  92. </select>
  93. <select id="findListByProject" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  94. SELECT
  95. <include refid="projectcontentinfoColumns"/>
  96. FROM project_content_info a
  97. <include refid="projectcontentinfoJoins"/>
  98. <where>
  99. a.del_flag = #{DEL_FLAG_NORMAL}
  100. AND a.parent_ids = #{parentIds}
  101. AND a.project_id = #{project.id}
  102. </where>
  103. <choose>
  104. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  105. ORDER BY ${page.orderBy}
  106. </when>
  107. <otherwise>
  108. ORDER BY a.sort DESC
  109. </otherwise>
  110. </choose>
  111. </select>
  112. <select id="findListByProjectOnRural" resultType="com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo" >
  113. SELECT
  114. <include refid="projectcontentinfoColumns"/>
  115. FROM project_content_info a
  116. <include refid="projectcontentinfoJoins"/>
  117. <where>
  118. a.del_flag = #{DEL_FLAG_NORMAL}
  119. AND a.parent_ids = #{parentIds}
  120. AND a.project_id = #{project.id}
  121. </where>
  122. <choose>
  123. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  124. ORDER BY ${page.orderBy}
  125. </when>
  126. <otherwise>
  127. ORDER BY a.sort DESC
  128. </otherwise>
  129. </choose>
  130. </select>
  131. <select id="getProjectContentData" resultType="com.jeeplus.modules.projectcontentinfo.entity.ProjectContentTreeData" >
  132. select DISTINCT a.type as "type"
  133. from project_content_data a
  134. <where>
  135. a.del_flag = 0
  136. AND a.project_id = #{projectId}
  137. </where>
  138. </select>
  139. <select id="getProjectContentTreeDataOnLeft" resultType="com.jeeplus.modules.projectcontentinfo.entity.ProjectContentTreeData" >
  140. select distinct a.type as "type"
  141. from project_content_data a
  142. left join work_content_type wct on a.type = wct.type_id
  143. <where>
  144. a.del_flag = 0
  145. and a.project_id = #{projectId}
  146. and wct.parent_id =#{workContentType}
  147. <if test="dictType != null and dictType != ''">
  148. AND a.type = #{dictType}
  149. </if>
  150. </where>
  151. </select>
  152. <select id="getProjectContentTreeData" resultType="com.jeeplus.modules.projectcontentinfo.entity.ProjectContentTreeData" >
  153. select a.id as "id",
  154. a.create_date as "createDate",a.create_by as "createId",
  155. a.name as "name", a.number as "number", a.type as "type",a.type as "pid", su.name as "masterName"
  156. from project_content_data a
  157. left join sys_user su on su.id = a.master
  158. <where>
  159. a.del_flag = 0
  160. AND a.project_id = #{projectId}
  161. and a.type = #{type}
  162. </where>
  163. order by a.update_date desc
  164. </select>
  165. <select id="findByType" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  166. SELECT
  167. <include refid="projectcontentinfoColumns"/>
  168. FROM project_content_info a
  169. <include refid="projectcontentinfoJoins"/>
  170. <where>
  171. a.del_flag = #{DEL_FLAG_NORMAL}
  172. AND a.project_id = #{project.id}
  173. AND a.type = #{type}
  174. AND a.dict_type = #{dictType}
  175. </where>
  176. ORDER BY a.create_date DESC
  177. limit 1
  178. </select>
  179. <select id="findByInfoId" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  180. SELECT
  181. <include refid="projectcontentinfoColumns"/>
  182. FROM project_content_info a
  183. <include refid="projectcontentinfoJoins"/>
  184. <where>
  185. a.del_flag = #{DEL_FLAG_NORMAL}
  186. AND a.info_id = #{infoId}
  187. AND (a.link_id is null or a.link_id='')
  188. </where>
  189. ORDER BY a.create_date DESC
  190. </select>
  191. <select id="findListByProjectAndType" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  192. SELECT
  193. <include refid="projectcontentinfoColumns"/>
  194. FROM project_content_info a
  195. <include refid="projectcontentinfoJoins"/>
  196. <where>
  197. a.del_flag = #{DEL_FLAG_NORMAL}
  198. AND a.type = #{type}
  199. AND a.parent_ids = #{parentIds}
  200. AND a.project_id = #{project.id}
  201. AND a.dict_type is NULL
  202. </where>
  203. <choose>
  204. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  205. ORDER BY ${page.orderBy}
  206. </when>
  207. <otherwise>
  208. ORDER BY a.sort DESC
  209. </otherwise>
  210. </choose>
  211. </select>
  212. <select id="findListByProjectAndTypes" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  213. SELECT
  214. <include refid="projectcontentinfoColumns"/>
  215. FROM project_content_info a
  216. <include refid="projectcontentinfoJoins"/>
  217. <where>
  218. a.del_flag = #{DEL_FLAG_NORMAL}
  219. AND a.type = #{type}
  220. AND a.parent_ids = #{parentIds}
  221. AND a.project_id = #{project.id}
  222. AND a.dict_type is NOT NULL
  223. </where>
  224. <choose>
  225. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  226. ORDER BY ${page.orderBy}
  227. </when>
  228. <otherwise>
  229. ORDER BY a.sort DESC
  230. </otherwise>
  231. </choose>
  232. </select>
  233. <select id="findListByProjectAndDictType" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  234. SELECT
  235. <include refid="projectcontentinfoColumns"/>
  236. FROM project_content_info a
  237. <include refid="projectcontentinfoJoins"/>
  238. <where>
  239. a.del_flag = #{DEL_FLAG_NORMAL}
  240. AND a.type = #{type}
  241. AND a.dict_type = #{dictType}
  242. AND a.parent_ids = #{parentIds}
  243. AND a.project_id = #{project.id}
  244. </where>
  245. <choose>
  246. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  247. ORDER BY ${page.orderBy}
  248. </when>
  249. <otherwise>
  250. ORDER BY a.sort DESC
  251. </otherwise>
  252. </choose>
  253. </select>
  254. <select id="findListByProjectType" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  255. SELECT
  256. <include refid="projectcontentinfoColumns"/>
  257. FROM project_content_info a
  258. <include refid="projectcontentinfoJoins"/>
  259. <where>
  260. a.del_flag = #{DEL_FLAG_NORMAL}
  261. AND a.type = #{type}
  262. AND a.parent_ids = #{parentIds}
  263. AND a.project_id = #{project.id}
  264. </where>
  265. <choose>
  266. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  267. ORDER BY ${page.orderBy}
  268. </when>
  269. <otherwise>
  270. ORDER BY a.sort DESC
  271. </otherwise>
  272. </choose>
  273. </select>
  274. <select id="findAllList" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  275. SELECT
  276. <include refid="projectcontentinfoColumns"/>
  277. FROM project_content_info a
  278. <include refid="projectcontentinfoJoins"/>
  279. <where>
  280. a.del_flag = #{DEL_FLAG_NORMAL}
  281. </where>
  282. <choose>
  283. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  284. ORDER BY ${page.orderBy}
  285. </when>
  286. <otherwise>
  287. ORDER BY a.update_date DESC
  288. </otherwise>
  289. </choose>
  290. </select>
  291. <insert id="insert">
  292. INSERT INTO project_content_info(
  293. id,
  294. create_by,
  295. create_date,
  296. update_by,
  297. update_date,
  298. remarks,
  299. del_flag,
  300. parent_id,
  301. parent_ids,
  302. sort,
  303. project_id,
  304. company_id,
  305. office_id,
  306. type,
  307. info_id,
  308. dict_type,
  309. name,
  310. link_id
  311. ) VALUES (
  312. #{id},
  313. #{createBy.id},
  314. #{createDate},
  315. #{updateBy.id},
  316. #{updateDate},
  317. #{remarks},
  318. #{delFlag},
  319. #{parent.id},
  320. #{parentIds},
  321. #{sort},
  322. #{project.id},
  323. #{companyId},
  324. #{officeId},
  325. #{type},
  326. #{infoId},
  327. #{dictType},
  328. #{name},
  329. #{linkId}
  330. )
  331. </insert>
  332. <insert id="insertOnRural">
  333. INSERT INTO project_content_info(
  334. id,
  335. create_by,
  336. create_date,
  337. update_by,
  338. update_date,
  339. remarks,
  340. del_flag,
  341. parent_id,
  342. parent_ids,
  343. sort,
  344. project_id,
  345. company_id,
  346. office_id,
  347. type,
  348. info_id,
  349. dict_type,
  350. name,
  351. link_id
  352. ) VALUES (
  353. #{id},
  354. #{createBy.id},
  355. #{createDate},
  356. #{updateBy.id},
  357. #{updateDate},
  358. #{remarks},
  359. #{delFlag},
  360. #{parent.id},
  361. #{parentIds},
  362. #{sort},
  363. #{projectOnRural.id},
  364. #{companyId},
  365. #{officeId},
  366. #{type},
  367. #{infoId},
  368. #{dictType},
  369. #{name},
  370. #{linkId}
  371. )
  372. </insert>
  373. <update id="update">
  374. UPDATE project_content_info SET
  375. update_by = #{updateBy.id},
  376. update_date = #{updateDate},
  377. remarks = #{remarks},
  378. type = #{type},
  379. info_id = #{infoId},
  380. dict_type = #{dictType},
  381. parent_id = #{parent.id},
  382. parent_ids = #{parentIds},
  383. sort = #{sort},
  384. project_id = #{project.id},
  385. name = #{name},
  386. link_id = #{linkId}
  387. WHERE id = #{id}
  388. </update>
  389. <update id="updateInfoId">
  390. UPDATE project_content_info SET
  391. info_id = #{infoId},
  392. dict_type = #{dictType}
  393. WHERE id = #{id}
  394. </update>
  395. <update id="updateByLinkId">
  396. UPDATE project_content_info SET
  397. name = #{dataName}
  398. WHERE link_id = #{linkId}
  399. </update>
  400. <!--物理删除-->
  401. <update id="delete">
  402. DELETE FROM project_content_info
  403. WHERE id = #{id}
  404. </update>
  405. <!--物理删除-->
  406. <update id="deleteInfoId">
  407. DELETE FROM project_content_info
  408. WHERE info_id = #{infoId}
  409. </update>
  410. <!--逻辑删除-->
  411. <update id="deleteByLogic">
  412. UPDATE project_content_info SET
  413. del_flag = #{DEL_FLAG_DELETE}
  414. WHERE id = #{id}
  415. </update>
  416. <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
  417. <select id="findUniqueByProperty" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" statementType="STATEMENT">
  418. select * FROM project_content_info where ${propertyName} = '${value}'
  419. </select>
  420. <select id="queryMaxSort" resultType="Integer">
  421. SELECT MAX(sort) FROM project_content_info a
  422. <where>
  423. a.del_flag = #{DEL_FLAG_NORMAL}
  424. <if test="parent!=null and parent.id!=null and parent.id!=''">
  425. AND a.parent_id = #{parent.id}
  426. </if>
  427. </where>
  428. </select>
  429. <select id="findListByParentSelective" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo" >
  430. SELECT
  431. <include refid="projectcontentinfoColumns"/>
  432. FROM project_content_info a
  433. <include refid="projectcontentinfoJoins"/>
  434. <where>
  435. <if test="project!=null and project.id!=null and project.id!=''">
  436. AND a.project_id = #{project.id}
  437. </if>
  438. <if test="parent!=null and parent.id!=null and parent.id!=''">
  439. AND a.parent_id = #{parent.id}
  440. </if>
  441. <if test="name!=null and name!=''">
  442. AND a.name = #{name}
  443. </if>
  444. <if test="infoId!=null and infoId!=''">
  445. AND a.info_id = #{infoId}
  446. </if>
  447. <if test="linkId!=null and linkId!=''">
  448. AND a.link_id = #{linkId}
  449. </if>
  450. AND a.del_flag = #{DEL_FLAG_NORMAL}
  451. </where>
  452. </select>
  453. <update id="deleteByParentAndLinkId">
  454. DELETE FROM project_content_info
  455. <where>
  456. <if test="project!=null and project.id!=null and project.id!=''">
  457. AND project_id = #{project.id}
  458. </if>
  459. <if test="parent!=null and parent.id!=null and parent.id!=''">
  460. AND parent_id = #{parent.id}
  461. </if>
  462. <if test="name!=null and name!=''">
  463. AND name = #{name}
  464. </if>
  465. <if test="infoId!=null and infoId!=''">
  466. AND info_id = #{infoId}
  467. </if>
  468. <if test="linkId!=null and linkId!=''">
  469. AND link_id = #{linkId}
  470. </if>
  471. </where>
  472. </update>
  473. <update id="deleteInfosByParent">
  474. DELETE FROM project_content_info WHERE parent_ids LIKE concat(#{parentIds},'%');
  475. </update>
  476. <select id="findType" resultType="com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo">
  477. SELECT id from project_content_info
  478. <where>
  479. project_id = #{projectId}
  480. and name = #{type} and info_id is null
  481. </where>
  482. </select>
  483. <insert id="saveBasedDataWorkAttachment">
  484. insert into based_data_and_work_attachment_info
  485. (
  486. based_data_id,
  487. work_attachment_id,
  488. create_date,
  489. create_by
  490. )
  491. values
  492. (
  493. #{attachmentId},
  494. #{quoteId},
  495. #{updateDate},
  496. #{updateBy.id}
  497. )
  498. </insert>
  499. <insert id="insertConsultant">
  500. insert into rural_report_consultant (
  501. id,
  502. create_by,
  503. create_date,
  504. update_by,
  505. update_date,
  506. del_flag,
  507. zixunyuan,
  508. zhucezigezhID,
  509. major,
  510. wordnr,
  511. projectId,
  512. auditOpinion
  513. )
  514. values
  515. (
  516. #{id},
  517. #{createBy.id},
  518. #{createDate},
  519. #{updateBy.id},
  520. #{updateDate},
  521. #{delFlag},
  522. #{zixunyuan},
  523. #{zhucezigezhKey},
  524. #{major},
  525. #{wordnr},
  526. #{projectId},
  527. #{auditOpinion}
  528. ) ;
  529. </insert>
  530. <select id="getWorkContentTypeByTypeId" resultType="java.lang.String">
  531. select type_name as typeName from work_content_type where type_id = #{typeId}
  532. </select>
  533. <select id="getTypeByProjectIdAndContentId" resultType="com.jeeplus.modules.workcontent.entity.WorkContentClaim">
  534. select wcc.project_id as projectId, wcc.review_amt as 'reviewAmt',wcc.set_amt as 'setAmt',wcc.content_id as 'contentId',pcd2.name as 'proConTentName',
  535. wcc.cont_id as 'contract.id',
  536. wct.type_name as 'typeName',wcc.create_date as 'createDate',wcc.update_date as 'updateDate', pcd.name as 'name',
  537. wct.type_name as 'typeName',su.name as 'createName'
  538. from (
  539. select id,create_by,create_date,update_by,update_date,remarks,del_flag,project_id,content_id,cont_id,alter_type,alter_date,review_amt,set_amt from work_content_altermanage
  540. union all
  541. select id,create_by,create_date,update_by,update_date,remarks,del_flag,project_id,content_id,cont_id,price_type,price_date,review_amt,set_amt from work_content_pricemanage
  542. union all
  543. select id,create_by,create_date,update_by,update_date,remarks,del_flag,project_id,content_id,contract_id,claim_type,claim_date,review_amt,set_amt from work_content_claim
  544. union all
  545. select id,create_by,create_date,update_by,update_date,remarks,del_flag,project_id,content_id,cont_id,visa_type,
  546. visa_date,review_amt,set_amt from work_content_visamanage) as wcc
  547. left join project_content_data pcd on wcc.cont_id = pcd.id
  548. left join project_content_data pcd2 on pcd2.id =wcc.content_id
  549. left join project_content_info pci on pci.info_id = wcc.content_id
  550. left join work_content_type wct on wct.type_id = pci.dict_type
  551. left join sys_user su on su.id = wcc.create_by
  552. where wcc.project_id = #{projectId} and wcc.content_id =#{contentId}
  553. order by wcc.update_date asc
  554. </select>
  555. <select id="findByProjectId"
  556. resultType="com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant">
  557. select id
  558. ,zixunyuan
  559. ,zhucezigezhID as 'zhucezigezhKey'
  560. ,major
  561. ,wordnr
  562. ,projectId
  563. ,auditOpinion
  564. from rural_report_consultant where projectId=#{projectId}
  565. order by major
  566. </select>
  567. <select id="getReportedConsultantsList"
  568. resultType="com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant">
  569. select id
  570. ,zixunyuan
  571. ,zhucezigezhID as 'zhucezigezhKey'
  572. ,wordnr
  573. ,wcyysrbl
  574. ,wcyysr
  575. ,reportedId
  576. ,role_flag as "roleFlag"
  577. from rural_reported_consultant where reportedId=#{reportedId}
  578. order by zixunyuan
  579. </select>
  580. <select id="getCertificateByUser" resultType="com.jeeplus.modules.workstaff.entity.WorkStaffCertificate">
  581. select a.name,a.num,a.major from work_staff_certificate a
  582. left join work_staff_achives wsa on a.staff_id = wsa.id
  583. where wsa.user_id = #{userId} and a.del_flag=0
  584. </select>
  585. <insert id="insertContentBasedInfo">
  586. insert into over_all_content_based_info (content_id, based_id)
  587. values
  588. (#{contentId}, #{basedId})
  589. </insert>
  590. <select id="getContentBasedCount" resultType="java.lang.Integer">
  591. select count(1) from over_all_content_based_info
  592. where content_id = #{contentId}
  593. and based_id = #{basedId}
  594. </select>
  595. <insert id="insertContentAchievementInfo">
  596. insert into over_all_content_achievement_info (content_id, achievement_id)
  597. values
  598. (#{contentId}, #{achievementId})
  599. </insert>
  600. <select id="getContentAchievementInfo" resultType="java.lang.Integer">
  601. select count(1) from over_all_content_achievement_info
  602. where content_id = #{contentId}
  603. and achievement_id = #{achievementId}
  604. </select>
  605. </mapper>