| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <?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.CompanyVoiceRoboticMapper">
-
- <resultMap type="CompanyVoiceRobotic" id="CompanyVoiceRoboticResult">
- <result property="id" column="id" />
- <result property="name" column="name" />
- <result property="taskName" column="task_name" />
- <result property="taskId" column="task_id" />
- <result property="robot" column="robot" />
- <result property="dialogId" column="dialog_id" />
- <result property="mode" column="mode" />
- <result property="addType" column="add_type" />
- <result property="multiplier" column="multiplier" />
- <result property="autoRecall" column="auto_recall" />
- <result property="recallTimes" column="recall_times" />
- <result property="cidGroupId" column="cid_group_id" />
- <result property="weekDay1" column="week_day1" />
- <result property="startTime1" column="start_time1" />
- <result property="endTime1" column="end_time1" />
- <result property="weekDay2" column="week_day2" />
- <result property="startTime2" column="start_time2" />
- <result property="endTime2" column="end_time2" />
- <result property="createTime" column="create_time" />
- <result property="companyAiWorkflowId" column="company_ai_workflow_id" />
- </resultMap>
- <sql id="selectCompanyVoiceRoboticVo">
- select * from company_voice_robotic
- </sql>
- <select id="selectCompanyVoiceRoboticList" parameterType="CompanyVoiceRobotic" resultMap="CompanyVoiceRoboticResult">
- <include refid="selectCompanyVoiceRoboticVo"/>
- <where>
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
- <if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
- <if test="taskId != null "> and task_id = #{taskId}</if>
- <if test="robot != null "> and robot = #{robot}</if>
- <if test="dialogId != null "> and dialog_id = #{dialogId}</if>
- <if test="mode != null "> and mode = #{mode}</if>
- <if test="addType != null "> and add_type = #{addType}</if>
- <if test="multiplier != null "> and multiplier = #{multiplier}</if>
- <if test="autoRecall != null "> and auto_recall = #{autoRecall}</if>
- <if test="recallTimes != null "> and recall_times = #{recallTimes}</if>
- <if test="cidGroupId != null "> and cid_group_id = #{cidGroupId}</if>
- <if test="weekDay1 != null and weekDay1 != ''"> and week_day1 = #{weekDay1}</if>
- <if test="startTime1 != null and startTime1 != ''"> and start_time1 = #{startTime1}</if>
- <if test="endTime1 != null and endTime1 != ''"> and end_time1 = #{endTime1}</if>
- <if test="weekDay2 != null and weekDay2 != ''"> and week_day2 = #{weekDay2}</if>
- <if test="startTime2 != null and startTime2 != ''"> and start_time2 = #{startTime2}</if>
- <if test="endTime2 != null and endTime2 != ''"> and end_time2 = #{endTime2}</if>
- <if test="createUser != null "> and create_user = #{createUser}</if>
- <if test="companyAiWorkflowId != null "> and company_ai_workflow_id = #{companyAiWorkflowId}</if>
- </where>
- order by id desc
- </select>
- <select id="selectCompanyVoiceRoboticListCompany" parameterType="CompanyVoiceRobotic" resultMap="CompanyVoiceRoboticResult">
- select a.* from company_voice_robotic a
- inner join company_user u on a.create_user = u.user_id
- inner join company_dept d on u.dept_id = d.dept_id
- <where>
- <if test="companyId != null"> and a.company_id = #{companyId}</if>
- <if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
- <if test="taskName != null and taskName != ''"> and a.task_name like concat('%', #{taskName}, '%')</if>
- <if test="taskId != null "> and a.task_id = #{taskId}</if>
- <if test="robot != null "> and a.robot = #{robot}</if>
- <if test="dialogId != null "> and a.dialog_id = #{dialogId}</if>
- <if test="mode != null "> and a.mode = #{mode}</if>
- <if test="addType != null "> and a.add_type = #{addType}</if>
- <if test="multiplier != null "> and a.multiplier = #{multiplier}</if>
- <if test="autoRecall != null "> and a.auto_recall = #{autoRecall}</if>
- <if test="recallTimes != null "> and a.recall_times = #{recallTimes}</if>
- <if test="cidGroupId != null "> and a.cid_group_id = #{cidGroupId}</if>
- <if test="weekDay1 != null and weekDay1 != ''"> and a.week_day1 = #{weekDay1}</if>
- <if test="startTime1 != null and startTime1 != ''"> and a.start_time1 = #{startTime1}</if>
- <if test="endTime1 != null and endTime1 != ''"> and a.end_time1 = #{endTime1}</if>
- <if test="weekDay2 != null and weekDay2 != ''"> and a.week_day2 = #{weekDay2}</if>
- <if test="startTime2 != null and startTime2 != ''"> and a.start_time2 = #{startTime2}</if>
- <if test="endTime2 != null and endTime2 != ''"> and a.end_time2 = #{endTime2}</if>
- <if test="createUser != null "> and a.create_user = #{createUser}</if>
- <if test="companyAiWorkflowId != null "> and a.company_ai_workflow_id = #{companyAiWorkflowId}</if>
- <if test="params != null">
- ${params.dataScope}
- </if>
- </where>
- </select>
-
- <select id="selectCompanyVoiceRoboticById" parameterType="Long" resultMap="CompanyVoiceRoboticResult">
- <include refid="selectCompanyVoiceRoboticVo"/>
- where id = #{id}
- </select>
- <select id="qwUserList" resultType="com.fs.company.vo.CompanyVoiceRoboticQwUserListVo">
- select a.id, a.wx_nick_name, a.wx_no, b.nick_name as companyUserName from company_wx_account a
- inner join company_user b on a.company_user_id = b.user_id
- </select>
- <select id="qwUserListCompany" resultType="com.fs.company.vo.CompanyVoiceRoboticQwUserListVo">
- select a.id, a.wx_nick_name, a.wx_no, u.nick_name as companyUserName
- from company_wx_account a
- inner join company_user u on a.company_user_id = u.user_id
- inner join company_dept d on u.dept_id = d.dept_id
- <where>
- <if test="params != null">${params.dataScope}</if>
- </where>
- </select>
- <insert id="insertCompanyVoiceRobotic" parameterType="CompanyVoiceRobotic" useGeneratedKeys="true" keyProperty="id">
- insert into company_voice_robotic
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="name != null">name,</if>
- <if test="taskName != null">task_name,</if>
- <if test="addType != null">add_type,</if>
- <if test="taskId != null">task_id,</if>
- <if test="robot != null">robot,</if>
- <if test="dialogId != null">dialog_id,</if>
- <if test="mode != null">mode,</if>
- <if test="multiplier != null">multiplier,</if>
- <if test="autoRecall != null">auto_recall,</if>
- <if test="recallTimes != null">recall_times,</if>
- <if test="cidGroupId != null">cid_group_id,</if>
- <if test="weekDay1 != null">week_day1,</if>
- <if test="startTime1 != null">start_time1,</if>
- <if test="endTime1 != null">end_time1,</if>
- <if test="weekDay2 != null">week_day2,</if>
- <if test="startTime2 != null">start_time2,</if>
- <if test="endTime2 != null">end_time2,</if>
- <if test="createTime != null">create_time,</if>
- <if test="createUser != null">create_user,</if>
- <if test="companyAiWorkflowId != null">company_ai_workflow_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="name != null">#{name},</if>
- <if test="taskName != null">#{taskName},</if>
- <if test="addType != null">#{addType},</if>
- <if test="taskId != null">#{taskId},</if>
- <if test="robot != null">#{robot},</if>
- <if test="dialogId != null">#{dialogId},</if>
- <if test="mode != null">#{mode},</if>
- <if test="multiplier != null">#{multiplier},</if>
- <if test="autoRecall != null">#{autoRecall},</if>
- <if test="recallTimes != null">#{recallTimes},</if>
- <if test="cidGroupId != null">#{cidGroupId},</if>
- <if test="weekDay1 != null">#{weekDay1},</if>
- <if test="startTime1 != null">#{startTime1},</if>
- <if test="endTime1 != null">#{endTime1},</if>
- <if test="weekDay2 != null">#{weekDay2},</if>
- <if test="startTime2 != null">#{startTime2},</if>
- <if test="endTime2 != null">#{endTime2},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="createUser != null">#{createUser},</if>
- <if test="companyAiWorkflowId != null">#{companyAiWorkflowId},</if>
- </trim>
- </insert>
- <update id="updateCompanyVoiceRobotic" parameterType="CompanyVoiceRobotic">
- update company_voice_robotic
- <trim prefix="SET" suffixOverrides=",">
- <if test="name != null">name = #{name},</if>
- <if test="taskName != null">task_name = #{taskName},</if>
- <if test="taskId != null">task_id = #{taskId},</if>
- <if test="addType != null">add_type = #{addType},</if>
- <if test="robot != null">robot = #{robot},</if>
- <if test="dialogId != null">dialog_id = #{dialogId},</if>
- <if test="mode != null">mode = #{mode},</if>
- <if test="multiplier != null">multiplier = #{multiplier},</if>
- <if test="autoRecall != null">auto_recall = #{autoRecall},</if>
- <if test="recallTimes != null">recall_times = #{recallTimes},</if>
- <if test="cidGroupId != null">cid_group_id = #{cidGroupId},</if>
- <if test="weekDay1 != null">week_day1 = #{weekDay1},</if>
- <if test="startTime1 != null">start_time1 = #{startTime1},</if>
- <if test="endTime1 != null">end_time1 = #{endTime1},</if>
- <if test="weekDay2 != null">week_day2 = #{weekDay2},</if>
- <if test="startTime2 != null">start_time2 = #{startTime2},</if>
- <if test="endTime2 != null">end_time2 = #{endTime2},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="createUser != null">create_user = #{createUser},</if>
- <if test="companyAiWorkflowId != null">company_ai_workflow_id = #{companyAiWorkflowId},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteCompanyVoiceRoboticById" parameterType="Long">
- delete from company_voice_robotic where id = #{id}
- </delete>
- <delete id="deleteCompanyVoiceRoboticByIds" parameterType="String">
- delete from company_voice_robotic where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <update id="finishRobotic" parameterType="java.lang.Long">
- update company_voice_robotic set task_status = 3 where id = #{id} and task_flow = run_task_flow
- </update>
- <update id="finishAddWxRobotic" >
- update company_voice_robotic
- set run_task_flow = CASE
- WHEN run_task_flow is null or run_task_flow = '' THEN
- 'addWx'
- ELSE
- CONCAT(run_task_flow,',','addWx')
- END
- where id in
- <foreach item="id" collection="collect" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- </mapper>
|