BdglSecretMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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="com.supervision.bdglSecret.mapper.BdglSecretMapper">
  6. <resultMap type="BdglSecret" id="BdglSecretResult">
  7. <result property="id" column="id" />
  8. <result property="secrecyType" column="secrecy_type" />
  9. <result property="number" column="number" />
  10. <result property="name" column="name" />
  11. <result property="kind" column="kind" />
  12. <result property="version" column="version" />
  13. <result property="confidential" column="confidential" />
  14. <result property="peopleId" column="people_id" />
  15. <result property="peopleId1" column="people_id1" />
  16. <result property="peopleId2" column="people_id2" />
  17. <result property="startTime" column="start_time" />
  18. <result property="endTime" column="end_time" />
  19. <result property="hindOverTime" column="hind_over_time" />
  20. <result property="unitId" column="unit_id" />
  21. <result property="peopleName" column="people_name" />
  22. <result property="people1Name" column="people1_name" />
  23. <result property="people2Name" column="people2_name" />
  24. <result property="deptName" column="dept_name" />
  25. <result property="remarks" column="remarks" />
  26. </resultMap>
  27. <sql id="selectBdglSecretVo">
  28. select id, secrecy_type, number, name, kind, version, confidential, people_id, people_id1, people_id2, start_time, end_time, hind_over_time, unit_id, people_name, people1_name, people2_name, dept_name,remarks from bdgl_secret
  29. </sql>
  30. <select id="selectBdglSecretList" parameterType="BdglSecret" resultMap="BdglSecretResult">
  31. <include refid="selectBdglSecretVo"/>
  32. <where>
  33. <if test="secrecyType != null "> and secrecy_type = #{secrecyType}</if>
  34. <if test="number != null and number != ''"> and number = #{number}</if>
  35. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  36. <if test="kind != null and kind != ''"> and kind = #{kind}</if>
  37. <if test="version != null and version != ''"> and version = #{version}</if>
  38. <if test="confidential != null and confidential != ''"> and confidential = #{confidential}</if>
  39. <if test="peopleId != null "> and people_id = #{peopleId}</if>
  40. <if test="peopleId1 != null "> and people_id1 = #{peopleId1}</if>
  41. <if test="peopleId2 != null "> and people_id2 = #{peopleId2}</if>
  42. <if test="startTime != null "> and start_time = #{startTime}</if>
  43. <if test="endTime != null "> and end_time = #{endTime}</if>
  44. <if test="hindOverTime != null "> and hind_over_time = #{hindOverTime}</if>
  45. <if test="unitId != null "> and unit_id = #{unitId}</if>
  46. <if test="peopleName != null and peopleName != ''"> and people_name like concat('%', #{peopleName}, '%')</if>
  47. <if test="people1Name != null and people1Name != ''"> and people1_name like concat('%', #{people1Name}, '%')</if>
  48. <if test="people2Name != null and people2Name != ''"> and people2_name like concat('%', #{people2Name}, '%')</if>
  49. <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
  50. <if test="remarks != null and remarks != ''"> and remarks like concat('%', #{remarks}, '%')</if>
  51. </where>
  52. order by start_time desc
  53. </select>
  54. <select id="selectBdglSecretById" parameterType="Integer" resultMap="BdglSecretResult">
  55. <include refid="selectBdglSecretVo"/>
  56. where id = #{id}
  57. </select>
  58. <select id="selectBdglSecretNumber" resultMap="BdglSecretResult">
  59. SELECT
  60. count(id) as number,
  61. kind
  62. FROM
  63. bdgl_secret
  64. GROUP BY kind
  65. order by kind asc
  66. </select>
  67. <insert id="insertBdglSecret" parameterType="BdglSecret" useGeneratedKeys="true" keyProperty="id">
  68. insert into bdgl_secret
  69. <trim prefix="(" suffix=")" suffixOverrides=",">
  70. <if test="secrecyType != null">secrecy_type,</if>
  71. <if test="number != null">number,</if>
  72. <if test="name != null">name,</if>
  73. <if test="kind != null">kind,</if>
  74. <if test="version != null">version,</if>
  75. <if test="confidential != null">confidential,</if>
  76. <if test="peopleId != null">people_id,</if>
  77. <if test="peopleId1 != null">people_id1,</if>
  78. <if test="peopleId2 != null">people_id2,</if>
  79. <if test="startTime != null">start_time,</if>
  80. <if test="endTime != null">end_time,</if>
  81. <if test="hindOverTime != null">hind_over_time,</if>
  82. <if test="unitId != null">unit_id,</if>
  83. <if test="peopleName != null">people_name,</if>
  84. <if test="people1Name != null">people1_name,</if>
  85. <if test="people2Name != null">people2_name,</if>
  86. <if test="deptName != null">dept_name,</if>
  87. <if test="remarks != null">remarks,</if>
  88. </trim>
  89. <trim prefix="values (" suffix=")" suffixOverrides=",">
  90. <if test="secrecyType != null">#{secrecyType},</if>
  91. <if test="number != null">#{number},</if>
  92. <if test="name != null">#{name},</if>
  93. <if test="kind != null">#{kind},</if>
  94. <if test="version != null">#{version},</if>
  95. <if test="confidential != null">#{confidential},</if>
  96. <if test="peopleId != null">#{peopleId},</if>
  97. <if test="peopleId1 != null">#{peopleId1},</if>
  98. <if test="peopleId2 != null">#{peopleId2},</if>
  99. <if test="startTime != null">#{startTime},</if>
  100. <if test="endTime != null">#{endTime},</if>
  101. <if test="hindOverTime != null">#{hindOverTime},</if>
  102. <if test="unitId != null">#{unitId},</if>
  103. <if test="peopleName != null">#{peopleName},</if>
  104. <if test="people1Name != null">#{people1Name},</if>
  105. <if test="people2Name != null">#{people2Name},</if>
  106. <if test="deptName != null">#{deptName},</if>
  107. <if test="remarks != null">#{remarks},</if>
  108. </trim>
  109. </insert>
  110. <update id="updateBdglSecret" parameterType="BdglSecret">
  111. update bdgl_secret
  112. <trim prefix="SET" suffixOverrides=",">
  113. <if test="secrecyType != null">secrecy_type = #{secrecyType},</if>
  114. <if test="number != null">number = #{number},</if>
  115. <if test="name != null">name = #{name},</if>
  116. <if test="kind != null">kind = #{kind},</if>
  117. <if test="version != null">version = #{version},</if>
  118. <if test="confidential != null">confidential = #{confidential},</if>
  119. <if test="peopleId != null">people_id = #{peopleId},</if>
  120. <if test="peopleId1 != null">people_id1 = #{peopleId1},</if>
  121. <if test="peopleId2 != null">people_id2 = #{peopleId2},</if>
  122. <if test="startTime != null">start_time = #{startTime},</if>
  123. <if test="endTime != null">end_time = #{endTime},</if>
  124. <if test="hindOverTime != null">hind_over_time = #{hindOverTime},</if>
  125. <if test="unitId != null">unit_id = #{unitId},</if>
  126. <if test="peopleName != null">people_name = #{peopleName},</if>
  127. <if test="people1Name != null">people1_name = #{people1Name},</if>
  128. <if test="people2Name != null">people2_name = #{people2Name},</if>
  129. <if test="deptName != null">dept_name = #{deptName},</if>
  130. <if test="remarks != null">remarks = #{deptName},</if>
  131. </trim>
  132. where id = #{id}
  133. </update>
  134. <delete id="deleteBdglSecretById" parameterType="Integer">
  135. delete from bdgl_secret where id = #{id}
  136. </delete>
  137. <delete id="deleteBdglSecretByIds" parameterType="String">
  138. delete from bdgl_secret where id in
  139. <foreach item="id" collection="array" open="(" separator="," close=")">
  140. #{id}
  141. </foreach>
  142. </delete>
  143. </mapper>