| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <?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.fs.company.mapper.CompanyVoiceRoboticCalleesMapper">
-
- <resultMap type="CompanyVoiceRoboticCallees" id="CompanyVoiceRoboticCalleesResult">
- <result property="id" column="id" />
- <result property="userId" column="user_id" />
- <result property="userName" column="user_name" />
- <result property="phone" column="phone" />
- <result property="roboticId" column="robotic_id" />
- <result property="params" column="params" />
- </resultMap>
- <sql id="selectCompanyVoiceRoboticCalleesVo">
- select * from company_voice_robotic_callees
- </sql>
- <select id="selectCompanyVoiceRoboticCalleesList" parameterType="CompanyVoiceRoboticCallees" resultType="CompanyVoiceRoboticCallees">
- <include refid="selectCompanyVoiceRoboticCalleesVo"/>
- <where>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="userName != null and userName != ''"> and user_name = #{userName}</if>
- <if test="phone != null and phone != ''"> and phone = #{phone}</if>
- <if test="roboticId != null "> and robotic_id = #{roboticId}</if>
- <if test="params != null and params != ''"> and params = #{params}</if>
- </where>
- </select>
-
- <select id="selectCompanyVoiceRoboticCalleesById" parameterType="Long" resultMap="CompanyVoiceRoboticCalleesResult">
- <include refid="selectCompanyVoiceRoboticCalleesVo"/>
- where id = #{id}
- </select>
- <select id="selectByRoboticId" resultType="com.fs.company.domain.CompanyVoiceRoboticCallees">
- select * from company_voice_robotic_callees where robotic_id = #{id}
- </select>
- <insert id="insertCompanyVoiceRoboticCallees" parameterType="CompanyVoiceRoboticCallees" useGeneratedKeys="true" keyProperty="id">
- insert into company_voice_robotic_callees
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userId != null">user_id,</if>
- <if test="userName != null">user_name,</if>
- <if test="phone != null">phone,</if>
- <if test="roboticId != null">robotic_id,</if>
- <if test="params != null">params,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userId != null">#{userId},</if>
- <if test="userName != null">#{userName},</if>
- <if test="phone != null">#{phone},</if>
- <if test="roboticId != null">#{roboticId},</if>
- <if test="params != null">#{params},</if>
- </trim>
- </insert>
- <insert id="insertCompanyVoiceRoboticCalleesList" keyProperty="id">
- insert into company_voice_robotic_callees (user_id, user_name, phone, robotic_id, params) values
- <foreach collection="list" item="item" index="index" separator=",">
- (#{item.userId},#{item.userName},#{item.phone},#{item.roboticId},#{item.params})
- </foreach>
- </insert>
- <update id="updateCompanyVoiceRoboticCallees" parameterType="CompanyVoiceRoboticCallees">
- update company_voice_robotic_callees
- <trim prefix="SET" suffixOverrides=",">
- <if test="userId != null">user_id = #{userId},</if>
- <if test="userName != null">user_name = #{userName},</if>
- <if test="phone != null">phone = #{phone},</if>
- <if test="roboticId != null">robotic_id = #{roboticId},</if>
- <if test="params != null">params = #{params},</if>
- <if test="uuid != null">uuid = #{uuid},</if>
- <if test="result != null">result = #{result},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteCompanyVoiceRoboticCalleesById" parameterType="Long">
- delete from company_voice_robotic_callees where id = #{id}
- </delete>
- <delete id="deleteCompanyVoiceRoboticCalleesByIds" parameterType="String">
- delete from company_voice_robotic_callees where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <delete id="deleteByRoboticId">
- delete from company_voice_robotic_callees where robotic_id = #{id}
- </delete>
- <select id="countByRoboticIdNotUuid" resultType="long">
- select count(*) from company_voice_robotic_callees where robotic_id = #{roboticId} and result = 0
- </select>
- <select id="selectDataByCalleesId" resultType="CompanyVoiceRoboticCallees" >
- select * from company_voice_robotic_callees where id = #{calleesId}
- </select>
- <select id="getCalleesByUserIdAndTaskId" resultType="CompanyVoiceRoboticCallees" >
- select * from company_voice_robotic_callees where user_id = #{userId} and robotic_id = #{taskId}
- </select>
- <select id="selectCalleesListByRoboticIdsAndUserIds" resultType="CompanyVoiceRoboticCallees">
- select * from company_voice_robotic_callees
- where
- robotic_id in
- <foreach item="id" collection="taskIds" open="(" separator="," close=")">
- #{id}
- </foreach>
- and user_id in
- <foreach item="id" collection="userIds" open="(" separator="," close=")">
- #{id}
- </foreach>
- </select>
- <select id="getRoboticIsDoneByRoboticIdAndTaskFlow" resultType="java.lang.Integer">
- SELECT count(*) FROM company_voice_robotic_callees where robotic_id = #{roboticId} and (FIND_IN_SET(#{taskFlow},run_task_flow) =0 or FIND_IN_SET(#{taskFlow},run_task_flow) is null)
- </select>
- </mapper>
|