EntCtrlLevelMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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.zhyc.xps.aqpt.mapper.EntCtrlLevelMapper">
  4. <resultMap id="BaseResultMap" type="com.zhyc.xps.aqpt.entity.EntCtrlLevel">
  5. <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
  6. <result column="ctrl_level_id" property="ctrlLevelId" jdbcType="BIGINT"/>
  7. <result column="ctrl_level_title" property="ctrlLevelTitle" jdbcType="VARCHAR"/>
  8. <result column="ctrl_level_value" property="ctrlLevelValue" jdbcType="BIGINT"/>
  9. <result column="ctrl_level_desc" property="ctrlLevelDesc" jdbcType="VARCHAR"/>
  10. <result column="is_enabled" property="isEnabled" jdbcType="BIGINT"/>
  11. </resultMap>
  12. <sql id="Base_Column_List">
  13. oc_id,
  14. ctrl_level_id,
  15. ctrl_level_title,
  16. ctrl_level_value,
  17. ctrl_level_desc,
  18. is_enabled
  19. </sql>
  20. <!--基于ID查询-->
  21. <select id="getById" resultMap="BaseResultMap">
  22. SELECT
  23. <include refid="Base_Column_List"/>
  24. FROM ent_ctrl_level
  25. WHERE 1 = 1
  26. <if test="ocId != null">
  27. AND oc_id = #{ocId ,jdbcType=BIGINT}
  28. </if>
  29. <if test="ctrlLevelId != null">
  30. AND ctrl_level_id = #{ctrlLevelId ,jdbcType=BIGINT}
  31. </if>
  32. </select>
  33. <!--分页查询信息-->
  34. <select id="getByPage" parameterType="java.util.Map" resultMap="BaseResultMap">
  35. SELECT
  36. <include refid="Base_Column_List"/>
  37. FROM ent_ctrl_level
  38. WHERE 1 = 1 AND deleted_flag = 0
  39. <if test="ocId != null">
  40. AND oc_id = #{ocId ,jdbcType=BIGINT}
  41. </if>
  42. <if test="keywords != null and keywords != ''">
  43. and ctrl_level_title like "%"#{keywords}"%"
  44. </if>
  45. ORDER BY ctrl_level_id ASC
  46. </select>
  47. <select id="getByList" parameterType="java.util.Map" resultMap="BaseResultMap">
  48. SELECT
  49. <include refid="Base_Column_List"/>
  50. FROM ent_ctrl_level
  51. WHERE 1 = 1 AND deleted_flag = 0
  52. <if test="ocId != null">
  53. AND oc_id = #{ocId ,jdbcType=BIGINT}
  54. </if>
  55. <if test="isEnabled != null">
  56. AND is_enabled = #{isEnabled ,jdbcType=BIGINT}
  57. </if>
  58. ORDER BY ctrl_level_id ASC
  59. </select>
  60. <insert id="create" parameterType="com.zhyc.xps.aqpt.entity.EntCtrlLevel">
  61. INSERT INTO ent_ctrl_level
  62. <trim prefix="(" suffix=")" suffixOverrides=",">
  63. <if test="ocId != null">
  64. oc_id,
  65. </if>
  66. <if test="ctrlLevelId != null">
  67. ctrl_level_id,
  68. </if>
  69. <if test="ctrlLevelTitle != null">
  70. ctrl_level_title,
  71. </if>
  72. <if test="ctrlLevelValue != null">
  73. ctrl_level_value,
  74. </if>
  75. <if test="ctrlLevelDesc != null">
  76. ctrl_level_desc,
  77. </if>
  78. <if test="isEnabled != null">
  79. is_enabled,
  80. </if>
  81. <if test="createdBy != null">
  82. created_by,
  83. </if>
  84. <if test="createdAt != null">
  85. created_at,
  86. </if>
  87. </trim>
  88. <trim prefix="values (" suffix=")" suffixOverrides=",">
  89. <if test="ocId != null">
  90. #{ocId ,jdbcType=BIGINT},
  91. </if>
  92. <if test="ctrlLevelId != null">
  93. #{ctrlLevelId ,jdbcType=BIGINT},
  94. </if>
  95. <if test="ctrlLevelTitle != null">
  96. #{ctrlLevelTitle ,jdbcType=VARCHAR},
  97. </if>
  98. <if test="ctrlLevelValue != null">
  99. #{ctrlLevelValue ,jdbcType=BIGINT},
  100. </if>
  101. <if test="ctrlLevelDesc != null">
  102. #{ctrlLevelDesc ,jdbcType=VARCHAR},
  103. </if>
  104. <if test="isEnabled != null">
  105. #{isEnabled ,jdbcType=BIGINT},
  106. </if>
  107. <if test="createdBy != null">
  108. #{createdBy ,jdbcType=BIGINT},
  109. </if>
  110. <if test="createdAt != null">
  111. #{createdAt ,jdbcType=TIMESTAMP},
  112. </if>
  113. </trim>
  114. </insert>
  115. <!--更新-->
  116. <update id="update" parameterType="com.zhyc.xps.aqpt.entity.EntCtrlLevel">
  117. UPDATE ent_ctrl_level
  118. <trim suffixOverrides=",">
  119. <set>
  120. <if test="ctrlLevelTitle != null and ctrlLevelTitle != ''">
  121. ctrl_level_title = #{ctrlLevelTitle, jdbcType=VARCHAR},
  122. </if>
  123. <if test="ctrlLevelValue != null">
  124. ctrl_level_value = #{ctrlLevelValue ,jdbcType=BIGINT},
  125. </if>
  126. <if test="ctrlLevelDesc != null">
  127. ctrl_level_desc = #{ctrlLevelDesc, jdbcType=VARCHAR},
  128. </if>
  129. <if test="isEnabled != null ">
  130. is_enabled = #{isEnabled, jdbcType=BIGINT},
  131. </if>
  132. <if test="updatedBy != null ">
  133. updated_by = #{updatedBy ,jdbcType=BIGINT},
  134. </if>
  135. <if test="updatedAt != null">
  136. updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
  137. </if>
  138. </set>
  139. </trim>
  140. WHERE 1 = 1
  141. <if test="ocId != null">
  142. AND oc_id = #{ocId ,jdbcType=BIGINT}
  143. </if>
  144. <if test="ctrlLevelId != null">
  145. AND ctrl_level_id = #{ctrlLevelId ,jdbcType=BIGINT}
  146. </if>
  147. </update>
  148. <!--删除-->
  149. <update id="delete" parameterType="java.util.Map">
  150. UPDATE ent_ctrl_level
  151. <trim suffixOverrides=",">
  152. <set>
  153. <if test="deletedFlag != null">
  154. deleted_flag = #{deletedFlag,jdbcType=BIGINT},
  155. </if>
  156. <if test="deletedTime != null">
  157. deleted_time = #{deletedTime,jdbcType=VARCHAR},
  158. </if>
  159. <if test="deletedBy != null">
  160. deleted_by = #{deletedBy,jdbcType=BIGINT},
  161. </if>
  162. </set>
  163. </trim>
  164. WHERE 1 = 1
  165. <if test="ocId != null">
  166. AND oc_id = #{ocId ,jdbcType=BIGINT}
  167. </if>
  168. <if test="ctrlLevelId != null">
  169. AND ctrl_level_id = #{ctrlLevelId ,jdbcType=BIGINT}
  170. </if>
  171. </update>
  172. </mapper>