SysPhysicalDefenseConstructionMapper.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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.xunmei.system.mapper.SysPhysicalDefenseConstructionMapper">
  6. <resultMap type="com.xunmei.system.domain.SysPhysicalDefenseConstruction" id="SysOrgPhysicalDefenseConstructionResult">
  7. <result property="id" column="id"/>
  8. <result property="standard" column="standard"/>
  9. <result property="dateOfCompliance" column="date_of_compliance"/>
  10. <result property="certificateEvidence" column="certificate_evidence"/>
  11. <result property="certificate" column="certificate"/>
  12. <result property="evidence" column="evidence"/>
  13. <result property="createTime" column="create_time"/>
  14. <result property="updateTime" column="update_time"/>
  15. <result property="createBy" column="create_by"/>
  16. <result property="updateBy" column="update_by"/>
  17. <result property="orgId" column="org_id"/>
  18. </resultMap>
  19. <sql id="selectSysOrgPhysicalDefenseConstructionVo">
  20. select id, standard, date_of_compliance, certificate_evidence, certificate, evidence, create_time, update_time, create_by, update_by, org_id
  21. from sys_org_physical_defense_construction
  22. </sql>
  23. <select id="selectSysOrgPhysicalDefenseConstructionList" parameterType="com.xunmei.system.domain.SysPhysicalDefenseConstruction"
  24. resultMap="SysOrgPhysicalDefenseConstructionResult">
  25. <include refid="selectSysOrgPhysicalDefenseConstructionVo"/>
  26. <where>
  27. <if test="standard != null and standard != ''">
  28. and standard = #{standard}
  29. </if>
  30. <if test="dateOfCompliance != null ">
  31. and date_of_compliance = #{dateOfCompliance}
  32. </if>
  33. <if test="certificateEvidence != null ">
  34. and certificate_evidence = #{certificateEvidence}
  35. </if>
  36. <if test="certificate != null and certificate != ''">
  37. and certificate = #{certificate}
  38. </if>
  39. <if test="evidence != null and evidence != ''">
  40. and evidence = #{evidence}
  41. </if>
  42. <if test="orgId != null ">
  43. and org_id = #{orgId}
  44. </if>
  45. </where>
  46. </select>
  47. <select id="selectListByPath" resultType="com.xunmei.system.dto.SysPhysicalDefenseConstructionDTO">
  48. select op.*,o.path as orgPath from sys_org o INNER JOIN sys_org_physical_defense_construction op ON o.id = op.org_id
  49. where o.is_lock != 1 and o.deleted = 0
  50. <if test="type != null and type != ''">
  51. and op.type = #{type}
  52. </if>
  53. <if test="orgPath != null and orgPath != ''">
  54. and o.path LIKE concat(#{orgPath}, '%')
  55. </if>
  56. </select>
  57. <select id="selectSysOrgPhysicalDefenseConstructionById" parameterType="Long"
  58. resultMap="SysOrgPhysicalDefenseConstructionResult">
  59. <include refid="selectSysOrgPhysicalDefenseConstructionVo"/>
  60. where id = #{id}
  61. </select>
  62. <insert id="insertSysOrgPhysicalDefenseConstruction" parameterType="com.xunmei.system.domain.SysPhysicalDefenseConstruction">
  63. insert into sys_org_physical_defense_construction
  64. <trim prefix="(" suffix=")" suffixOverrides=",">
  65. <if test="id != null">id,
  66. </if>
  67. <if test="standard != null">standard,
  68. </if>
  69. <if test="dateOfCompliance != null">date_of_compliance,
  70. </if>
  71. <if test="certificateEvidence != null">certificate_evidence,
  72. </if>
  73. <if test="certificate != null">certificate,
  74. </if>
  75. <if test="evidence != null">evidence,
  76. </if>
  77. <if test="createTime != null">create_time,
  78. </if>
  79. <if test="updateTime != null">update_time,
  80. </if>
  81. <if test="createBy != null">create_by,
  82. </if>
  83. <if test="updateBy != null">update_by,
  84. </if>
  85. <if test="orgId != null">org_id,
  86. </if>
  87. </trim>
  88. <trim prefix="values (" suffix=")" suffixOverrides=",">
  89. <if test="id != null">#{id},
  90. </if>
  91. <if test="standard != null">#{standard},
  92. </if>
  93. <if test="dateOfCompliance != null">#{dateOfCompliance},
  94. </if>
  95. <if test="certificateEvidence != null">#{certificateEvidence},
  96. </if>
  97. <if test="certificate != null">#{certificate},
  98. </if>
  99. <if test="evidence != null">#{evidence},
  100. </if>
  101. <if test="createTime != null">#{createTime},
  102. </if>
  103. <if test="updateTime != null">#{updateTime},
  104. </if>
  105. <if test="createBy != null">#{createBy},
  106. </if>
  107. <if test="updateBy != null">#{updateBy},
  108. </if>
  109. <if test="orgId != null">#{orgId},
  110. </if>
  111. </trim>
  112. </insert>
  113. <update id="updateSysOrgPhysicalDefenseConstruction" parameterType="com.xunmei.system.domain.SysPhysicalDefenseConstruction">
  114. update sys_org_physical_defense_construction
  115. <trim prefix="SET" suffixOverrides=",">
  116. <if test="standard != null">standard =
  117. #{standard},
  118. </if>
  119. <if test="dateOfCompliance != null">date_of_compliance =
  120. #{dateOfCompliance},
  121. </if>
  122. <if test="certificateEvidence != null">certificate_evidence =
  123. #{certificateEvidence},
  124. </if>
  125. <if test="certificate != null">certificate =
  126. #{certificate},
  127. </if>
  128. <if test="evidence != null">evidence =
  129. #{evidence},
  130. </if>
  131. <if test="createTime != null">create_time =
  132. #{createTime},
  133. </if>
  134. <if test="updateTime != null">update_time =
  135. #{updateTime},
  136. </if>
  137. <if test="createBy != null">create_by =
  138. #{createBy},
  139. </if>
  140. <if test="updateBy != null">update_by =
  141. #{updateBy},
  142. </if>
  143. <if test="orgId != null">org_id =
  144. #{orgId},
  145. </if>
  146. </trim>
  147. where id = #{id}
  148. </update>
  149. <delete id="deleteSysOrgPhysicalDefenseConstructionById" parameterType="Long">
  150. delete
  151. from sys_org_physical_defense_construction where id = #{id}
  152. </delete>
  153. <delete id="deleteSysOrgPhysicalDefenseConstructionByIds" parameterType="String">
  154. delete from sys_org_physical_defense_construction where id in
  155. <foreach item="id" collection="array" open="(" separator="," close=")">
  156. #{id}
  157. </foreach>
  158. </delete>
  159. </mapper>