EntRiskPointCatMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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.EntRiskPointCatMapper">
  4. <resultMap id="BaseResultMap" type="com.zhyc.xps.aqpt.entity.EntRiskPointCat">
  5. <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
  6. <result column="risk_point_cat_id" property="riskPointCatId" jdbcType="BIGINT"/>
  7. <result column="risk_point_cat_title" property="riskPointCatTitle" jdbcType="VARCHAR"/>
  8. <result column="risk_point_cat_desc" property="riskPointCatDesc" jdbcType="VARCHAR"/>
  9. </resultMap>
  10. <sql id="Base_Column_List">
  11. oc_id,
  12. risk_point_cat_id,
  13. risk_point_cat_title,
  14. risk_point_cat_desc,
  15. created_by,
  16. created_at,
  17. updated_by,
  18. updated_at
  19. </sql>
  20. <!--根据ID获取角色信息-->
  21. <select id="getById" resultMap="BaseResultMap">
  22. SELECT
  23. <include refid="Base_Column_List"/>
  24. FROM ent_risk_point_cat
  25. WHERE 1 = 1
  26. <if test="ocId != null">
  27. AND oc_id = #{ocId ,jdbcType=BIGINT}
  28. </if>
  29. <if test="riskPointCatId != null">
  30. AND risk_point_cat_id = #{riskPointCatId ,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_risk_point_cat
  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 risk_point_cat_title like "%"#{keywords}"%"
  44. </if>
  45. ORDER BY risk_point_cat_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_risk_point_cat
  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="keywords != null and keywords != ''">
  56. AND risk_point_cat_title like "%"#{keywords}"%"
  57. </if>
  58. ORDER BY risk_point_cat_id ASC
  59. </select>
  60. <insert id="create" parameterType="com.zhyc.xps.aqpt.entity.EntRiskPointCat">
  61. INSERT INTO ent_risk_point_cat
  62. <trim prefix="(" suffix=")" suffixOverrides=",">
  63. <if test="ocId != null">
  64. oc_id,
  65. </if>
  66. <if test="riskPointCatId != null">
  67. risk_point_cat_id,
  68. </if>
  69. <if test="riskPointCatTitle != null">
  70. risk_point_cat_title,
  71. </if>
  72. <if test="riskPointCatDesc != null">
  73. risk_point_cat_desc,
  74. </if>
  75. <if test="createdBy != null">
  76. created_by,
  77. </if>
  78. <if test="createdAt != null">
  79. created_at,
  80. </if>
  81. </trim>
  82. <trim prefix="values (" suffix=")" suffixOverrides=",">
  83. <if test="ocId != null">
  84. #{ocId ,jdbcType=BIGINT},
  85. </if>
  86. <if test="riskPointCatId != null">
  87. #{riskPointCatId ,jdbcType=BIGINT},
  88. </if>
  89. <if test="riskPointCatTitle != null">
  90. #{riskPointCatTitle ,jdbcType=VARCHAR},
  91. </if>
  92. <if test="riskPointCatDesc != null">
  93. #{riskPointCatDesc ,jdbcType=VARCHAR},
  94. </if>
  95. <if test="createdBy != null">
  96. #{createdBy ,jdbcType=BIGINT},
  97. </if>
  98. <if test="createdAt != null">
  99. #{createdAt ,jdbcType=TIMESTAMP},
  100. </if>
  101. </trim>
  102. </insert>
  103. <!--更新-->
  104. <update id="update" parameterType="com.zhyc.xps.aqpt.entity.EntRiskPointCat">
  105. UPDATE ent_risk_point_cat
  106. <trim suffixOverrides=",">
  107. <set>
  108. <if test="riskPointCatTitle != null and riskPointCatTitle != ''">
  109. risk_point_cat_title = #{riskPointCatTitle, jdbcType=VARCHAR},
  110. </if>
  111. <if test="riskPointCatDesc != null and riskPointCatDesc != ''">
  112. risk_point_cat_desc = #{riskPointCatDesc, jdbcType=VARCHAR},
  113. </if>
  114. <if test="updatedBy != null ">
  115. updated_by = #{updatedBy ,jdbcType=BIGINT},
  116. </if>
  117. <if test="updatedAt != null">
  118. updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
  119. </if>
  120. </set>
  121. </trim>
  122. WHERE 1 = 1
  123. <if test="ocId != null">
  124. AND oc_id = #{ocId ,jdbcType=BIGINT}
  125. </if>
  126. <if test="riskPointCatId != null">
  127. AND risk_point_cat_id = #{riskPointCatId ,jdbcType=BIGINT}
  128. </if>
  129. </update>
  130. <!--删除-->
  131. <update id="delete" parameterType="java.util.Map">
  132. UPDATE ent_risk_point_cat
  133. <trim suffixOverrides=",">
  134. <set>
  135. <if test="deletedFlag != null">
  136. deleted_flag = #{deletedFlag,jdbcType=BIGINT},
  137. </if>
  138. <if test="deletedTime != null">
  139. deleted_time = #{deletedTime,jdbcType=VARCHAR},
  140. </if>
  141. <if test="deletedBy != null">
  142. deleted_by = #{deletedBy,jdbcType=BIGINT},
  143. </if>
  144. </set>
  145. </trim>
  146. WHERE 1 = 1
  147. <if test="ocId != null">
  148. AND oc_id = #{ocId ,jdbcType=BIGINT}
  149. </if>
  150. <if test="riskPointCatId != null">
  151. AND risk_point_cat_id = #{riskPointCatId ,jdbcType=BIGINT}
  152. </if>
  153. </update>
  154. </mapper>