Browse Source

咨询客户详情开发

anderx 1 year ago
parent
commit
4f85207970

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

@@ -0,0 +1,85 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.TaskAnnualReport;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.util.List;
+
+/**
+ * 项目年报(TaskAnnualReport)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-12-26 10:53:48
+ */
+public interface TaskAnnualReportMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    TaskAnnualReport queryById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param taskAnnualReport 查询条件
+     * @param pageable         分页对象
+     * @return 对象列表
+     */
+    List<TaskAnnualReport> findTaskAnnualReportList(TaskAnnualReport taskAnnualReport, @Param("pageable") Pageable pageable);
+
+    /**
+     * 统计总行数
+     *
+     * @param taskAnnualReport 查询条件
+     * @return 总行数
+     */
+    int findTaskAnnualReportCount(TaskAnnualReport taskAnnualReport);
+
+    /**
+     * 新增数据
+     *
+     * @param taskAnnualReport 实例对象
+     * @return 影响行数
+     */
+    int insert(TaskAnnualReport taskAnnualReport);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<TaskAnnualReport> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<TaskAnnualReport> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<TaskAnnualReport> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<TaskAnnualReport> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param taskAnnualReport 实例对象
+     * @return 影响行数
+     */
+    int update(TaskAnnualReport taskAnnualReport);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+}
+

+ 177 - 0
src/main/java/com/goafanti/common/mapper/TaskAnnualReportMapper.xml

@@ -0,0 +1,177 @@
+<?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.TaskAnnualReportMapper">
+
+    <resultMap type="com.goafanti.common.model.TaskAnnualReport" id="TaskAnnualReportMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="uid" column="uid" jdbcType="VARCHAR"/>
+        <result property="tid" column="tid" jdbcType="INTEGER"/>
+        <result property="year" column="year" jdbcType="INTEGER"/>
+        <result property="salesAmount" column="sales_amount" jdbcType="VARCHAR"/>
+        <result property="researchAmount" column="research_amount" jdbcType="VARCHAR"/>
+        <result property="assets" column="assets" jdbcType="VARCHAR"/>
+        <result property="aid" column="aid" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="TaskAnnualReportAllSql">
+        id, uid, tid, year, sales_amount, research_amount, assets, aid, create_time
+    </sql>
+
+    <!--查询单个-->
+    <select id="queryById" resultMap="TaskAnnualReportMap">
+        select
+        <include refid="TaskAnnualReportAllSql"/>
+        from task_annual_report
+        where id = #{id}
+    </select>
+
+    <!--查询指定行数据-->
+    <select id="findTaskAnnualReportList" resultMap="TaskAnnualReportMap">
+        select
+        <include refid="TaskAnnualReportAllSql"/>
+
+        from task_annual_report
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="uid != null and uid != ''">
+                and uid = #{uid}
+            </if>
+            <if test="tid != null">
+                and tid = #{tid}
+            </if>
+            <if test="year != null">
+                and year = #{year}
+            </if>
+            <if test="salesAmount != null and salesAmount != ''">
+                and sales_amount = #{salesAmount}
+            </if>
+            <if test="researchAmount != null and researchAmount != ''">
+                and research_amount = #{researchAmount}
+            </if>
+            <if test="assets != null and assets != ''">
+                and assets = #{assets}
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <!--统计总行数-->
+    <select id="findTaskAnnualReportCount" resultType="java.lang.Integer">
+        select count(1)
+        from task_annual_report
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="uid != null and uid != ''">
+                and uid = #{uid}
+            </if>
+            <if test="tid != null">
+                and tid = #{tid}
+            </if>
+            <if test="year != null">
+                and year = #{year}
+            </if>
+            <if test="salesAmount != null and salesAmount != ''">
+                and sales_amount = #{salesAmount}
+            </if>
+            <if test="researchAmount != null and researchAmount != ''">
+                and research_amount = #{researchAmount}
+            </if>
+            <if test="assets != null and assets != ''">
+                and assets = #{assets}
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into task_annual_report(uid, tid, year, sales_amount, research_amount, assets, aid, create_time)
+        values (#{uid}, #{tid}, #{year}, #{salesAmount}, #{researchAmount}, #{assets}, #{aid}, #{createTime})
+    </insert>
+
+    <insert id="insertBatch">
+        insert into task_annual_report(uid, tid, year, sales_amount, research_amount, assets, aid, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.uid}, #{entity.tid}, #{entity.year}, #{entity.salesAmount}, #{entity.researchAmount},
+            #{entity.assets}, #{entity.aid}, #{entity.createTime})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into task_annual_report(uid, tid, year, sales_amount, research_amount, assets, aid, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.uid}, #{entity.tid}, #{entity.year}, #{entity.salesAmount}, #{entity.researchAmount},
+            #{entity.assets}, #{entity.aid}, #{entity.createTime})
+        </foreach>
+        on duplicate key update
+        uid = values(uid),
+        tid = values(tid),
+        year = values(year),
+        sales_amount = values(sales_amount),
+        research_amount = values(research_amount),
+        assets = values(assets),
+        aid = values(aid),
+        create_time = values(create_time)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update task_annual_report
+        <set>
+            <if test="uid != null and uid != ''">
+                uid = #{uid},
+            </if>
+            <if test="tid != null">
+                tid = #{tid},
+            </if>
+            <if test="year != null">
+                year = #{year},
+            </if>
+            <if test="salesAmount != null and salesAmount != ''">
+                sales_amount = #{salesAmount},
+            </if>
+            <if test="researchAmount != null and researchAmount != ''">
+                research_amount = #{researchAmount},
+            </if>
+            <if test="assets != null and assets != ''">
+                assets = #{assets},
+            </if>
+            <if test="aid != null and aid != ''">
+                aid = #{aid},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from task_annual_report
+        where id = #{id}
+    </delete>
+
+</mapper>
+

+ 124 - 0
src/main/java/com/goafanti/common/model/TaskAnnualReport.java

@@ -0,0 +1,124 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 项目年报(TaskAnnualReport)实体类
+ *
+ * @author makejava
+ * @since 2024-12-26 10:53:48
+ */
+public class TaskAnnualReport implements Serializable {
+    private static final long serialVersionUID = -98384195143360440L;
+
+    private Integer id;
+    /**
+     * 用户ID
+     */
+    private String uid;
+    /**
+     * 项目编号
+     */
+    private Integer tid;
+    /**
+     * 年份
+     */
+    private Integer year;
+    /**
+     * 销售额
+     */
+    private String salesAmount;
+    /**
+     * 研发费用
+     */
+    private String researchAmount;
+    /**
+     * 总资产
+     */
+    private String assets;
+    /**
+     * 录入人
+     */
+    private String aid;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+
+    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 Integer getTid() {
+        return tid;
+    }
+
+    public void setTid(Integer tid) {
+        this.tid = tid;
+    }
+
+    public Integer getYear() {
+        return year;
+    }
+
+    public void setYear(Integer year) {
+        this.year = year;
+    }
+
+    public String getSalesAmount() {
+        return salesAmount;
+    }
+
+    public void setSalesAmount(String salesAmount) {
+        this.salesAmount = salesAmount;
+    }
+
+    public String getResearchAmount() {
+        return researchAmount;
+    }
+
+    public void setResearchAmount(String researchAmount) {
+        this.researchAmount = researchAmount;
+    }
+
+    public String getAssets() {
+        return assets;
+    }
+
+    public void setAssets(String assets) {
+        this.assets = assets;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+}
+

+ 12 - 0
src/main/java/com/goafanti/techproject/controller/AdminTaskDetailsController.java

@@ -0,0 +1,12 @@
+package com.goafanti.techproject.controller;
+
+import com.goafanti.common.controller.CertifyApiController;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping(value = "/api/admin/taskDetails")
+public class AdminTaskDetailsController extends CertifyApiController {
+
+
+}