|
|
@@ -0,0 +1,189 @@
|
|
|
+<?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.goafanti.common.dao.CallLogMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.goafanti.common.model.CallLog" id="CallLogMap">
|
|
|
+ <result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
+ <result property="uid" column="uid" jdbcType="VARCHAR"/>
|
|
|
+ <result property="aid" column="aid" jdbcType="VARCHAR"/>
|
|
|
+ <result property="adminName" column="admin_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="contacts" column="contacts" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mobileLastDigits" column="mobile_last_digits" jdbcType="VARCHAR"/>
|
|
|
+ <result property="status" column="status" jdbcType="INTEGER"/>
|
|
|
+ <result property="duration" column="duration" jdbcType="INTEGER"/>
|
|
|
+ <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="CallLogAllSql">
|
|
|
+ id, uid, aid, admin_name, contacts, mobile_last_digits, status, duration, remarks, create_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="CallLogMap">
|
|
|
+ select
|
|
|
+ <include refid="CallLogAllSql"/>
|
|
|
+ from call_log
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="findCallLogList" resultMap="CallLogMap">
|
|
|
+ select
|
|
|
+ <include refid="CallLogAllSql"/>
|
|
|
+
|
|
|
+ from call_log
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ and uid = #{uid}
|
|
|
+ </if>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ and aid = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="adminName != null and adminName != ''">
|
|
|
+ and admin_name = #{adminName}
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null and contacts != ''">
|
|
|
+ and contacts = #{contacts}
|
|
|
+ </if>
|
|
|
+ <if test="mobileLastDigits != null and mobileLastDigits != ''">
|
|
|
+ and mobile_last_digits = #{mobileLastDigits}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="duration != null">
|
|
|
+ and duration = #{duration}
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ and remarks = #{remarks}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="findCallLogCount" resultType="java.lang.Integer">
|
|
|
+ select count(1)
|
|
|
+ from call_log
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ and uid = #{uid}
|
|
|
+ </if>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ and aid = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="adminName != null and adminName != ''">
|
|
|
+ and admin_name = #{adminName}
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null and contacts != ''">
|
|
|
+ and contacts = #{contacts}
|
|
|
+ </if>
|
|
|
+ <if test="mobileLastDigits != null and mobileLastDigits != ''">
|
|
|
+ and mobile_last_digits = #{mobileLastDigits}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="duration != null">
|
|
|
+ and duration = #{duration}
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ and remarks = #{remarks}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into call_log(uid, aid, admin_name, contacts, mobile_last_digits, status, duration, remarks, create_time)
|
|
|
+ values (#{uid}, #{aid}, #{adminName}, #{contacts}, #{mobileLastDigits}, #{status}, #{duration}, #{remarks},
|
|
|
+ #{createTime})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch">
|
|
|
+ insert into call_log(uid, aid, admin_name, contacts, mobile_last_digits, status, duration, remarks, create_time)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.uid}, #{entity.aid}, #{entity.adminName}, #{entity.contacts}, #{entity.mobileLastDigits},
|
|
|
+ #{entity.status}, #{entity.duration}, #{entity.remarks}, #{entity.createTime})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into call_log(uid, aid, admin_name, contacts, mobile_last_digits, status, duration, remarks, create_time)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.uid}, #{entity.aid}, #{entity.adminName}, #{entity.contacts}, #{entity.mobileLastDigits},
|
|
|
+ #{entity.status}, #{entity.duration}, #{entity.remarks}, #{entity.createTime})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ uid = values(uid),
|
|
|
+ aid = values(aid),
|
|
|
+ admin_name = values(admin_name),
|
|
|
+ contacts = values(contacts),
|
|
|
+ mobile_last_digits = values(mobile_last_digits),
|
|
|
+ status = values(status),
|
|
|
+ duration = values(duration),
|
|
|
+ remarks = values(remarks),
|
|
|
+ create_time = values(create_time)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update call_log
|
|
|
+ <set>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ uid = #{uid},
|
|
|
+ </if>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ aid = #{aid},
|
|
|
+ </if>
|
|
|
+ <if test="adminName != null and adminName != ''">
|
|
|
+ admin_name = #{adminName},
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null and contacts != ''">
|
|
|
+ contacts = #{contacts},
|
|
|
+ </if>
|
|
|
+ <if test="mobileLastDigits != null and mobileLastDigits != ''">
|
|
|
+ mobile_last_digits = #{mobileLastDigits},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ status = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="duration != null">
|
|
|
+ duration = #{duration},
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ remarks = #{remarks},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete
|
|
|
+ from call_log
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|