|
@@ -0,0 +1,94 @@
|
|
|
+<?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.slibra.business.mapper.CHumanServiceMapMapper">
|
|
|
+
|
|
|
+ <resultMap type="CHumanServiceMap" id="CHumanServiceMapResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="saasId" column="saas_id" />
|
|
|
+ <result property="serviceId" column="service_id" />
|
|
|
+ <result property="serviceType" column="service_type" />
|
|
|
+ <result property="agentId" column="agent_id" />
|
|
|
+ <result property="state" column="state" />
|
|
|
+ <result property="isDelete" column="is_delete" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCHumanServiceMapVo">
|
|
|
+ select id, saas_id, service_id, service_type, agent_id, state, is_delete, update_time, create_time from c_human_service_map
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCHumanServiceMapList" parameterType="CHumanServiceMap" resultMap="CHumanServiceMapResult">
|
|
|
+ <include refid="selectCHumanServiceMapVo"/>
|
|
|
+ <where>
|
|
|
+ 1 = 1
|
|
|
+ <if test="saasId != null and saasId != ''"> and saas_id = #{saasId}</if>
|
|
|
+ <if test="serviceId != null and serviceId != ''"> and service_id = #{serviceId}</if>
|
|
|
+ <if test="serviceType != null and serviceType != ''"> and service_type = #{serviceType}</if>
|
|
|
+ <if test="agentId != null and agentId != ''"> and agent_id = #{agentId}</if>
|
|
|
+ <if test="state != null "> and state = #{state}</if>
|
|
|
+ <if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
+ </where>
|
|
|
+ and del_flag = 0 order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCHumanServiceMapById" parameterType="String" resultMap="CHumanServiceMapResult">
|
|
|
+ <include refid="selectCHumanServiceMapVo"/>
|
|
|
+ where id = #{id} and del_flag = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCHumanServiceMap" parameterType="CHumanServiceMap" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into c_human_service_map
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="saasId != null and saasId != ''">saas_id,</if>
|
|
|
+ <if test="serviceId != null and serviceId != ''">service_id,</if>
|
|
|
+ <if test="serviceType != null and serviceType != ''">service_type,</if>
|
|
|
+ <if test="agentId != null and agentId != ''">agent_id,</if>
|
|
|
+ <if test="state != null">state,</if>
|
|
|
+ <if test="isDelete != null">is_delete,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="saasId != null and saasId != ''">#{saasId},</if>
|
|
|
+ <if test="serviceId != null and serviceId != ''">#{serviceId},</if>
|
|
|
+ <if test="serviceType != null and serviceType != ''">#{serviceType},</if>
|
|
|
+ <if test="agentId != null and agentId != ''">#{agentId},</if>
|
|
|
+ <if test="state != null">#{state},</if>
|
|
|
+ <if test="isDelete != null">#{isDelete},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCHumanServiceMap" parameterType="CHumanServiceMap">
|
|
|
+ update c_human_service_map
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="saasId != null and saasId != ''">saas_id = #{saasId},</if>
|
|
|
+ <if test="serviceId != null and serviceId != ''">service_id = #{serviceId},</if>
|
|
|
+ <if test="serviceType != null and serviceType != ''">service_type = #{serviceType},</if>
|
|
|
+ <if test="agentId != null and agentId != ''">agent_id = #{agentId},</if>
|
|
|
+ <if test="state != null">state = #{state},</if>
|
|
|
+ <if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ ,revision = revision + 1
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <delete id="deleteCHumanServiceMapById" parameterType="String">
|
|
|
+ update c_human_service_map set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCHumanServiceMapByIds" parameterType="String">
|
|
|
+ update c_human_service_map set del_flag = 2,revision = revision + 1 where del_flag = 0 and id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|