anderx месяцев назад: 9
Родитель
Сommit
0b675f155e

+ 85 - 0
src/main/java/com/goafanti/common/dao/UserFirstInterviewMapper.java

@@ -0,0 +1,85 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.UserFirstInterview;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.util.List;
+
+/**
+ * 客户首次面谈表(UserFirstInterview)表数据库访问层
+ *
+ * @author makejava
+ * @since 2025-04-11 14:04:36
+ */
+public interface UserFirstInterviewMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    UserFirstInterview selectById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param userFirstInterview 查询条件
+     * @param pageable           分页对象
+     * @return 对象列表
+     */
+    List<UserFirstInterview> findUserFirstInterviewList(UserFirstInterview userFirstInterview, @Param("pageable") Pageable pageable);
+
+    /**
+     * 统计总行数
+     *
+     * @param userFirstInterview 查询条件
+     * @return 总行数
+     */
+    int findUserFirstInterviewCount(UserFirstInterview userFirstInterview);
+
+    /**
+     * 新增数据
+     *
+     * @param userFirstInterview 实例对象
+     * @return 影响行数
+     */
+    int insert(UserFirstInterview userFirstInterview);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<UserFirstInterview> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<UserFirstInterview> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<UserFirstInterview> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<UserFirstInterview> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param userFirstInterview 实例对象
+     * @return 影响行数
+     */
+    int update(UserFirstInterview userFirstInterview);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+}
+

+ 120 - 0
src/main/java/com/goafanti/common/mapper/UserFirstInterviewMapper.xml

@@ -0,0 +1,120 @@
+<?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.UserFirstInterviewMapper">
+
+    <resultMap type="com.goafanti.common.model.UserFirstInterview" id="UserFirstInterviewMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="uid" column="uid" jdbcType="VARCHAR"/>
+        <result property="aid" column="aid" jdbcType="VARCHAR"/>
+        <result property="firstTime" column="first_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="UserFirstInterviewAllSql">
+        id, uid, aid, first_time
+    </sql>
+
+    <!--查询单个-->
+    <select id="selectById" resultMap="UserFirstInterviewMap">
+        select
+        <include refid="UserFirstInterviewAllSql"/>
+        from user_first_interview
+        where id = #{id}
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into user_first_interview(uid, aid, first_time)
+        values (#{uid}, #{aid}, #{firstTime})
+    </insert>
+
+    <insert id="insertBatch">
+        insert into user_first_interview(uid, aid, first_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.uid}, #{entity.aid}, #{entity.firstTime})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into user_first_interview(uid, aid, first_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.uid}, #{entity.aid}, #{entity.firstTime})
+        </foreach>
+        on duplicate key update
+        uid = values(uid),
+        aid = values(aid),
+        first_time = values(first_time)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update user_first_interview
+        <set>
+            <if test="uid != null and uid != ''">
+                uid = #{uid},
+            </if>
+            <if test="aid != null and aid != ''">
+                aid = #{aid},
+            </if>
+            <if test="firstTime != null">
+                first_time = #{firstTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+    <!--查询指定行数据-->
+    <select id="findUserFirstInterviewList" resultMap="UserFirstInterviewMap">
+        select
+        <include refid="UserFirstInterviewAllSql"/>
+
+        from user_first_interview
+        <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="firstTime != null">
+                and first_time = #{firstTime}
+            </if>
+        </where>
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <!--统计总行数-->
+    <select id="findUserFirstInterviewCount" resultType="java.lang.Integer">
+        select count(1)
+        from user_first_interview
+        <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="firstTime != null">
+                and first_time = #{firstTime}
+            </if>
+        </where>
+    </select>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from user_first_interview
+        where id = #{id}
+    </delete>
+
+</mapper>
+

+ 64 - 0
src/main/java/com/goafanti/common/model/UserFirstInterview.java

@@ -0,0 +1,64 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 客户首次面谈表(UserFirstInterview)实体类
+ *
+ * @author makejava
+ * @since 2025-04-11 14:04:36
+ */
+public class UserFirstInterview implements Serializable {
+    private static final long serialVersionUID = 901985596989280759L;
+
+    private Integer id;
+    /**
+     * 客户编号
+     */
+    private String uid;
+    /**
+     * 跟进人编号
+     */
+    private String aid;
+    /**
+     * 首次面谈时间
+     */
+    private Date firstTime;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Date getFirstTime() {
+        return firstTime;
+    }
+
+    public void setFirstTime(Date firstTime) {
+        this.firstTime = firstTime;
+    }
+
+}
+