QuestionAnswerTitleServiceDaoImplMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="questionAnswerTitleServiceDaoImpl">
  6. <!-- 保存答卷信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveQuestionAnswerTitleInfo" parameterType="Map">
  8. insert into question_answer_title(
  9. title_type,title_id,obj_id,obj_type,seq,qa_id,qa_title
  10. ) values (
  11. #{titleType},#{titleId},#{objId},#{objType},#{seq},#{qaId},#{qaTitle}
  12. )
  13. </insert>
  14. <!-- 查询答卷信息 add by wuxw 2018-07-03 -->
  15. <select id="getQuestionAnswerTitleInfo" parameterType="Map" resultType="Map">
  16. select t.title_type,t.title_type titleType,t.title_id,t.title_id titleId,t.obj_id,t.obj_id
  17. objId,t.status_cd,t.status_cd statusCd,t.obj_type,t.obj_type objType,t.seq,t.qa_id,t.qa_id
  18. qaId,t.qa_title,t.qa_title qaTitle
  19. from question_answer_title t
  20. where 1 =1
  21. <if test="titleType !=null and titleType != ''">
  22. and t.title_type= #{titleType}
  23. </if>
  24. <if test="titleId !=null and titleId != ''">
  25. and t.title_id= #{titleId}
  26. </if>
  27. <if test="objId !=null and objId != ''">
  28. and t.obj_id= #{objId}
  29. </if>
  30. <if test="objIds !=null ">
  31. and t.obj_id in
  32. <foreach collection="objIds" item="item" open="(" close=")" separator=",">
  33. #{item}
  34. </foreach>
  35. </if>
  36. <if test="statusCd !=null and statusCd != ''">
  37. and t.status_cd= #{statusCd}
  38. </if>
  39. <if test="objType !=null and objType != ''">
  40. and t.obj_type= #{objType}
  41. </if>
  42. <if test="seq !=null and seq != ''">
  43. and t.seq= #{seq}
  44. </if>
  45. <if test="qaId !=null and qaId != ''">
  46. and t.qa_id= #{qaId}
  47. </if>
  48. <if test="qaTitle !=null and qaTitle != ''">
  49. and t.qa_title like '%${qaTitle}%'
  50. </if>
  51. order by t.seq
  52. <if test="page != -1 and page != null ">
  53. limit #{page}, #{row}
  54. </if>
  55. </select>
  56. <!-- 修改答卷信息 add by wuxw 2018-07-03 -->
  57. <update id="updateQuestionAnswerTitleInfo" parameterType="Map">
  58. update question_answer_title t set t.status_cd = #{statusCd}
  59. <if test="newBId != null and newBId != ''">
  60. ,t.b_id = #{newBId}
  61. </if>
  62. <if test="titleType !=null and titleType != ''">
  63. , t.title_type= #{titleType}
  64. </if>
  65. <if test="objId !=null and objId != ''">
  66. , t.obj_id= #{objId}
  67. </if>
  68. <if test="objType !=null and objType != ''">
  69. , t.obj_type= #{objType}
  70. </if>
  71. <if test="seq !=null and seq != ''">
  72. , t.seq= #{seq}
  73. </if>
  74. <if test="qaId !=null and qaId != ''">
  75. , t.qa_id= #{qaId}
  76. </if>
  77. <if test="qaTitle !=null and qaTitle != ''">
  78. , t.qa_title= #{qaTitle}
  79. </if>
  80. where 1=1
  81. <if test="titleId !=null and titleId != ''">
  82. and t.title_id= #{titleId}
  83. </if>
  84. </update>
  85. <!-- 查询答卷数量 add by wuxw 2018-07-03 -->
  86. <select id="queryQuestionAnswerTitlesCount" parameterType="Map" resultType="Map">
  87. select count(1) count
  88. from question_answer_title t
  89. where 1 =1
  90. <if test="titleType !=null and titleType != ''">
  91. and t.title_type= #{titleType}
  92. </if>
  93. <if test="titleId !=null and titleId != ''">
  94. and t.title_id= #{titleId}
  95. </if>
  96. <if test="objId !=null and objId != ''">
  97. and t.obj_id= #{objId}
  98. </if>
  99. <if test="objIds !=null ">
  100. and t.obj_id in
  101. <foreach collection="objIds" item="item" open="(" close=")" separator=",">
  102. #{item}
  103. </foreach>
  104. </if>
  105. <if test="statusCd !=null and statusCd != ''">
  106. and t.status_cd= #{statusCd}
  107. </if>
  108. <if test="objType !=null and objType != ''">
  109. and t.obj_type= #{objType}
  110. </if>
  111. <if test="seq !=null and seq != ''">
  112. and t.seq= #{seq}
  113. </if>
  114. <if test="qaId !=null and qaId != ''">
  115. and t.qa_id= #{qaId}
  116. </if>
  117. <if test="qaTitle !=null and qaTitle != ''">
  118. and t.qa_title like '%${qaTitle}%'
  119. </if>
  120. </select>
  121. </mapper>