Просмотр исходного кода

新增最大公出审核配置表

anderx 1 год назад
Родитель
Сommit
2acb3cd3be

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

@@ -0,0 +1,85 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.PublicConfig;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.util.List;
+
+/**
+ * 公出神最大审核配置(PublicConfig)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-09-24 13:58:25
+ */
+public interface PublicConfigMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    PublicConfig queryById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param publicConfig 查询条件
+     * @param pageable     分页对象
+     * @return 对象列表
+     */
+    List<PublicConfig> findPublicConfigList(PublicConfig publicConfig, @Param("pageable") Pageable pageable);
+
+    /**
+     * 统计总行数
+     *
+     * @param publicConfig 查询条件
+     * @return 总行数
+     */
+    int findPublicConfigCount(PublicConfig publicConfig);
+
+    /**
+     * 新增数据
+     *
+     * @param publicConfig 实例对象
+     * @return 影响行数
+     */
+    int insert(PublicConfig publicConfig);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<PublicConfig> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<PublicConfig> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<PublicConfig> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<PublicConfig> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param publicConfig 实例对象
+     * @return 影响行数
+     */
+    int update(PublicConfig publicConfig);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+}
+

+ 168 - 0
src/main/java/com/goafanti/common/mapper/PublicConfigMapper.xml

@@ -0,0 +1,168 @@
+<?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.PublicConfigMapper">
+    <resultMap type="com.goafanti.common.model.PublicConfig" id="PublicConfigMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="techAuditorStauts" column="tech_auditor_stauts" jdbcType="INTEGER"/>
+        <result property="techAuditor" column="tech_auditor" jdbcType="VARCHAR"/>
+        <result property="financeAuditorStauts" column="finance_auditor_stauts" jdbcType="INTEGER"/>
+        <result property="financeAuditor" column="finance_auditor" jdbcType="VARCHAR"/>
+        <result property="otherAuditorStauts" column="other_auditor_stauts" jdbcType="INTEGER"/>
+        <result property="otherAuditor" column="other_auditor" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="PublicConfigAllSql">
+        id, tech_auditor_stauts, tech_auditor, finance_auditor_stauts, finance_auditor, other_auditor_stauts, other_auditor, create_time
+    </sql>
+
+    <!--查询单个-->
+    <select id="queryById" resultMap="PublicConfigMap">
+        select
+        <include refid="PublicConfigAllSql"/>
+        from public_config
+        where id = #{id}
+    </select>
+
+    <!--查询指定行数据-->
+    <select id="findPublicConfigList" resultMap="PublicConfigMap">
+        select
+        <include refid="PublicConfigAllSql"/>
+
+        from public_config
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="techAuditorStauts != null">
+                and tech_auditor_stauts = #{techAuditorStauts}
+            </if>
+            <if test="techAuditor != null and techAuditor != ''">
+                and tech_auditor = #{techAuditor}
+            </if>
+            <if test="financeAuditorStauts != null">
+                and finance_auditor_stauts = #{financeAuditorStauts}
+            </if>
+            <if test="financeAuditor != null and financeAuditor != ''">
+                and finance_auditor = #{financeAuditor}
+            </if>
+            <if test="otherAuditorStauts != null">
+                and other_auditor_stauts = #{otherAuditorStauts}
+            </if>
+            <if test="otherAuditor != null and otherAuditor != ''">
+                and other_auditor = #{otherAuditor}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <!--统计总行数-->
+    <select id="findPublicConfigCount" resultType="java.lang.Integer">
+        select count(1)
+        from public_config
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="techAuditorStauts != null">
+                and tech_auditor_stauts = #{techAuditorStauts}
+            </if>
+            <if test="techAuditor != null and techAuditor != ''">
+                and tech_auditor = #{techAuditor}
+            </if>
+            <if test="financeAuditorStauts != null">
+                and finance_auditor_stauts = #{financeAuditorStauts}
+            </if>
+            <if test="financeAuditor != null and financeAuditor != ''">
+                and finance_auditor = #{financeAuditor}
+            </if>
+            <if test="otherAuditorStauts != null">
+                and other_auditor_stauts = #{otherAuditorStauts}
+            </if>
+            <if test="otherAuditor != null and otherAuditor != ''">
+                and other_auditor = #{otherAuditor}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into public_config(tech_auditor_stauts, tech_auditor, finance_auditor_stauts, finance_auditor,
+                                  other_auditor_stauts, other_auditor, create_time)
+        values (#{techAuditorStauts}, #{techAuditor}, #{financeAuditorStauts}, #{financeAuditor}, #{otherAuditorStauts},
+                #{otherAuditor}, #{createTime})
+    </insert>
+
+    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into public_config(tech_auditor_stauts, tech_auditor, finance_auditor_stauts, finance_auditor,
+        other_auditor_stauts, other_auditor, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.techAuditorStauts}, #{entity.techAuditor}, #{entity.financeAuditorStauts},
+            #{entity.financeAuditor}, #{entity.otherAuditorStauts}, #{entity.otherAuditor}, #{entity.createTime})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into public_config(tech_auditor_stauts, tech_auditor, finance_auditor_stauts, finance_auditor,
+        other_auditor_stauts, other_auditor, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.techAuditorStauts}, #{entity.techAuditor}, #{entity.financeAuditorStauts},
+            #{entity.financeAuditor}, #{entity.otherAuditorStauts}, #{entity.otherAuditor}, #{entity.createTime})
+        </foreach>
+        on duplicate key update
+        tech_auditor_stauts = values(tech_auditor_stauts),
+        tech_auditor = values(tech_auditor),
+        finance_auditor_stauts = values(finance_auditor_stauts),
+        finance_auditor = values(finance_auditor),
+        other_auditor_stauts = values(other_auditor_stauts),
+        other_auditor = values(other_auditor),
+        create_time = values(create_time)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update public_config
+        <set>
+            <if test="techAuditorStauts != null">
+                tech_auditor_stauts = #{techAuditorStauts},
+            </if>
+            <if test="techAuditor != null and techAuditor != ''">
+                tech_auditor = #{techAuditor},
+            </if>
+            <if test="financeAuditorStauts != null">
+                finance_auditor_stauts = #{financeAuditorStauts},
+            </if>
+            <if test="financeAuditor != null and financeAuditor != ''">
+                finance_auditor = #{financeAuditor},
+            </if>
+            <if test="otherAuditorStauts != null">
+                other_auditor_stauts = #{otherAuditorStauts},
+            </if>
+            <if test="otherAuditor != null and otherAuditor != ''">
+                other_auditor = #{otherAuditor},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from public_config
+        where id = #{id}
+    </delete>
+</mapper>
+

+ 114 - 0
src/main/java/com/goafanti/common/model/PublicConfig.java

@@ -0,0 +1,114 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 公出神最大审核配置(PublicConfig)实体类
+ *
+ * @author makejava
+ * @since 2024-09-24 13:58:25
+ */
+public class PublicConfig implements Serializable {
+    private static final long serialVersionUID = -26692614773381371L;
+    /**
+     * id
+     */
+    private Integer id;
+    /**
+     * 技术总监审核开关 0=关,1=开
+     */
+    private Integer techAuditorStauts;
+    /**
+     * 技术总监审核人
+     */
+    private String techAuditor;
+    /**
+     * 财务技术总监审核开关 0=关,1=开
+     */
+    private Integer financeAuditorStauts;
+    /**
+     * 财务总监审核人
+     */
+    private String financeAuditor;
+    /**
+     * 其他审核开关 0=关,1=开
+     */
+    private Integer otherAuditorStauts;
+    /**
+     * 其他审核人
+     */
+    private String otherAuditor;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getTechAuditorStauts() {
+        return techAuditorStauts;
+    }
+
+    public void setTechAuditorStauts(Integer techAuditorStauts) {
+        this.techAuditorStauts = techAuditorStauts;
+    }
+
+    public String getTechAuditor() {
+        return techAuditor;
+    }
+
+    public void setTechAuditor(String techAuditor) {
+        this.techAuditor = techAuditor;
+    }
+
+    public Integer getFinanceAuditorStauts() {
+        return financeAuditorStauts;
+    }
+
+    public void setFinanceAuditorStauts(Integer financeAuditorStauts) {
+        this.financeAuditorStauts = financeAuditorStauts;
+    }
+
+    public String getFinanceAuditor() {
+        return financeAuditor;
+    }
+
+    public void setFinanceAuditor(String financeAuditor) {
+        this.financeAuditor = financeAuditor;
+    }
+
+    public Integer getOtherAuditorStauts() {
+        return otherAuditorStauts;
+    }
+
+    public void setOtherAuditorStauts(Integer otherAuditorStauts) {
+        this.otherAuditorStauts = otherAuditorStauts;
+    }
+
+    public String getOtherAuditor() {
+        return otherAuditor;
+    }
+
+    public void setOtherAuditor(String otherAuditor) {
+        this.otherAuditor = otherAuditor;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+}
+