123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.zhyc.xps.aqpt.mapper.EntRiskPointCatMapper">
- <resultMap id="BaseResultMap" type="com.zhyc.xps.aqpt.entity.EntRiskPointCat">
- <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
- <result column="risk_point_cat_id" property="riskPointCatId" jdbcType="BIGINT"/>
- <result column="risk_point_cat_title" property="riskPointCatTitle" jdbcType="VARCHAR"/>
- <result column="risk_point_cat_desc" property="riskPointCatDesc" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List">
- oc_id,
- risk_point_cat_id,
- risk_point_cat_title,
- risk_point_cat_desc,
- created_by,
- created_at,
- updated_by,
- updated_at
- </sql>
- <!--根据ID获取角色信息-->
- <select id="getById" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM ent_risk_point_cat
- WHERE 1 = 1
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="riskPointCatId != null">
- AND risk_point_cat_id = #{riskPointCatId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询角色信息-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM ent_risk_point_cat
- WHERE 1 = 1 AND deleted_flag = 0
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND risk_point_cat_title like "%"#{keywords}"%"
- </if>
- ORDER BY risk_point_cat_id ASC
- </select>
- <select id="getByList" parameterType="java.util.Map" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM ent_risk_point_cat
- WHERE 1 = 1 AND deleted_flag = 0
- <if test="ocId != null">
- AND oc_id = #{ocId,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND risk_point_cat_title like "%"#{keywords}"%"
- </if>
- ORDER BY risk_point_cat_id ASC
- </select>
- <insert id="create" parameterType="com.zhyc.xps.aqpt.entity.EntRiskPointCat">
- INSERT INTO ent_risk_point_cat
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="riskPointCatId != null">
- risk_point_cat_id,
- </if>
- <if test="riskPointCatTitle != null">
- risk_point_cat_title,
- </if>
- <if test="riskPointCatDesc != null">
- risk_point_cat_desc,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- #{ocId ,jdbcType=BIGINT},
- </if>
- <if test="riskPointCatId != null">
- #{riskPointCatId ,jdbcType=BIGINT},
- </if>
- <if test="riskPointCatTitle != null">
- #{riskPointCatTitle ,jdbcType=VARCHAR},
- </if>
- <if test="riskPointCatDesc != null">
- #{riskPointCatDesc ,jdbcType=VARCHAR},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.aqpt.entity.EntRiskPointCat">
- UPDATE ent_risk_point_cat
- <trim suffixOverrides=",">
- <set>
- <if test="riskPointCatTitle != null and riskPointCatTitle != ''">
- risk_point_cat_title = #{riskPointCatTitle, jdbcType=VARCHAR},
- </if>
- <if test="riskPointCatDesc != null and riskPointCatDesc != ''">
- risk_point_cat_desc = #{riskPointCatDesc, jdbcType=VARCHAR},
- </if>
- <if test="updatedBy != null ">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="riskPointCatId != null">
- AND risk_point_cat_id = #{riskPointCatId ,jdbcType=BIGINT}
- </if>
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE ent_risk_point_cat
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime,jdbcType=VARCHAR},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="riskPointCatId != null">
- AND risk_point_cat_id = #{riskPointCatId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|