3 changed files with 227 additions and 0 deletions
-
81src/main/java/com/gaotao/modules/oss/dao/FileAssociateDao.java
-
28src/main/java/com/gaotao/modules/oss/vo/FileAssociateData.java
-
118src/main/resources/mapper/oss/FileAssociateDao.xml
@ -0,0 +1,81 @@ |
|||||
|
package com.gaotao.modules.oss.dao; |
||||
|
|
||||
|
import com.gaotao.modules.oss.vo.FileAssociateData; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface FileAssociateDao { |
||||
|
|
||||
|
/** |
||||
|
* @Method deleteFileAssociate |
||||
|
* @Description: 删除文件关联信息 |
||||
|
* @author zuowenwen |
||||
|
* @Version 1.0 |
||||
|
* @param fileAssociateData |
||||
|
* @return int |
||||
|
* @throws |
||||
|
* @date 2021/11/2 14:24 |
||||
|
*/ |
||||
|
int deleteFileAssociate(FileAssociateData fileAssociateData); |
||||
|
|
||||
|
/** |
||||
|
* @Method insert |
||||
|
* @Description: 新增文件关联信息 |
||||
|
* @author zuowenwen |
||||
|
* @Version 1.0 |
||||
|
* @param fileAssociateData |
||||
|
* @return int |
||||
|
* @throws |
||||
|
* @date 2021/11/2 14:27 |
||||
|
*/ |
||||
|
int insert(FileAssociateData fileAssociateData); |
||||
|
|
||||
|
/** |
||||
|
* @Method insertSelective |
||||
|
* @Description: 新增文件关联信息 |
||||
|
* @author zuowenwen |
||||
|
* @Version 1.0 |
||||
|
* @param fileAssociateData |
||||
|
* @return int |
||||
|
* @throws |
||||
|
* @date 2021/11/2 14:27 |
||||
|
*/ |
||||
|
int insertSelective(FileAssociateData fileAssociateData); |
||||
|
|
||||
|
/** |
||||
|
* @Method getFileAssociateData |
||||
|
* @Description: 获取文件关联信息 |
||||
|
* @author zuowenwen |
||||
|
* @Version 1.0 |
||||
|
* @param fileAssociateData |
||||
|
* @return FileAssociateData |
||||
|
* @throws |
||||
|
* @date 2021/11/2 14:28 |
||||
|
*/ |
||||
|
FileAssociateData getFileAssociateData(FileAssociateData fileAssociateData); |
||||
|
|
||||
|
/** |
||||
|
* @Method updateSelective |
||||
|
* @Description: 更改文件关联信息 |
||||
|
* @author zuowenwen |
||||
|
* @Version 1.0 |
||||
|
* @param fileAssociateData |
||||
|
* @return int |
||||
|
* @throws |
||||
|
* @date 2021/11/2 14:30 |
||||
|
*/ |
||||
|
int updateSelective(FileAssociateData fileAssociateData); |
||||
|
|
||||
|
/** |
||||
|
* @Method update |
||||
|
* @Description: 更改文件关联信息 |
||||
|
* @author zuowenwen |
||||
|
* @Version 1.0 |
||||
|
* @param fileAssociateData |
||||
|
* @return int |
||||
|
* @throws |
||||
|
* @date 2021/11/2 14:30 |
||||
|
*/ |
||||
|
int update(FileAssociateData fileAssociateData); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.gaotao.modules.oss.vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author ZuoWen |
||||
|
* @Date 2021-11-02 |
||||
|
*/ |
||||
|
|
||||
|
@Data |
||||
|
public class FileAssociateData { |
||||
|
|
||||
|
|
||||
|
/** 主键id */ |
||||
|
private Integer id; |
||||
|
/** 工厂编码 */ |
||||
|
private String site; |
||||
|
/** 文件记录id */ |
||||
|
private Integer sysOssId; |
||||
|
/** 类型 */ |
||||
|
private String type; |
||||
|
/** 关联字段1 */ |
||||
|
private String associatedField1; |
||||
|
/** 关联字段2 */ |
||||
|
private String associatedField2; |
||||
|
/** 关联字段3 */ |
||||
|
private String associatedField3; |
||||
|
} |
||||
@ -0,0 +1,118 @@ |
|||||
|
<?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.gaotao.modules.oss.dao.FileAssociateDao"> |
||||
|
<resultMap id="BaseResultMap" type="com.gaotao.modules.oss.vo.FileAssociateData"> |
||||
|
<id column="id" jdbcType="INTEGER" property="id" /> |
||||
|
<result column="site" jdbcType="VARCHAR" property="site" /> |
||||
|
<result column="sys_oss_id" jdbcType="INTEGER" property="sysOssId" /> |
||||
|
<result column="type" jdbcType="VARCHAR" property="type" /> |
||||
|
<result column="associated_field1" jdbcType="VARCHAR" property="associatedField1" /> |
||||
|
<result column="associated_field2" jdbcType="VARCHAR" property="associatedField2" /> |
||||
|
<result column="associated_field3" jdbcType="VARCHAR" property="associatedField3" /> |
||||
|
</resultMap> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, site, sys_oss_id, "type", associated_field1, associated_field2, associated_field3 |
||||
|
</sql> |
||||
|
|
||||
|
<select id="getFileAssociateData" parameterType="java.lang.Integer" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from file_associate |
||||
|
where id = #{id,jdbcType=INTEGER} |
||||
|
</select> |
||||
|
|
||||
|
<delete id="deleteFileAssociate" parameterType="java.lang.Integer"> |
||||
|
delete from file_associate |
||||
|
where id = #{id,jdbcType=INTEGER} |
||||
|
</delete> |
||||
|
|
||||
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.gaotao.modules.oss.vo.FileAssociateData" useGeneratedKeys="true"> |
||||
|
insert into file_associate (site, sys_oss_id, "type", |
||||
|
associated_field1, associated_field2, associated_field3 |
||||
|
) |
||||
|
values (#{site,jdbcType=VARCHAR}, #{sysOssId,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, |
||||
|
#{associatedField1,jdbcType=VARCHAR}, #{associatedField2,jdbcType=VARCHAR}, #{associatedField3,jdbcType=VARCHAR} |
||||
|
) |
||||
|
</insert> |
||||
|
|
||||
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.gaotao.modules.oss.vo.FileAssociateData" useGeneratedKeys="true"> |
||||
|
insert into file_associate |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="site != null"> |
||||
|
site, |
||||
|
</if> |
||||
|
<if test="sysOssId != null"> |
||||
|
sys_oss_id, |
||||
|
</if> |
||||
|
<if test="type != null"> |
||||
|
"type", |
||||
|
</if> |
||||
|
<if test="associatedField1 != null"> |
||||
|
associated_field1, |
||||
|
</if> |
||||
|
<if test="associatedField2 != null"> |
||||
|
associated_field2, |
||||
|
</if> |
||||
|
<if test="associatedField3 != null"> |
||||
|
associated_field3, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="site != null"> |
||||
|
#{site,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="sysOssId != null"> |
||||
|
#{sysOssId,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="type != null"> |
||||
|
#{type,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="associatedField1 != null"> |
||||
|
#{associatedField1,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="associatedField2 != null"> |
||||
|
#{associatedField2,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="associatedField3 != null"> |
||||
|
#{associatedField3,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateSelective" parameterType="com.gaotao.modules.oss.vo.FileAssociateData"> |
||||
|
update file_associate |
||||
|
<set> |
||||
|
<if test="site != null"> |
||||
|
site = #{site,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="sysOssId != null"> |
||||
|
sys_oss_id = #{sysOssId,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="type != null"> |
||||
|
"type" = #{type,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="associatedField1 != null"> |
||||
|
associated_field1 = #{associatedField1,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="associatedField2 != null"> |
||||
|
associated_field2 = #{associatedField2,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="associatedField3 != null"> |
||||
|
associated_field3 = #{associatedField3,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=INTEGER} |
||||
|
</update> |
||||
|
|
||||
|
<update id="update" parameterType="com.gaotao.modules.oss.vo.FileAssociateData"> |
||||
|
update file_associate |
||||
|
set site = #{site,jdbcType=VARCHAR}, |
||||
|
sys_oss_id = #{sysOssId,jdbcType=INTEGER}, |
||||
|
"type" = #{type,jdbcType=VARCHAR}, |
||||
|
associated_field1 = #{associatedField1,jdbcType=VARCHAR}, |
||||
|
associated_field2 = #{associatedField2,jdbcType=VARCHAR}, |
||||
|
associated_field3 = #{associatedField3,jdbcType=VARCHAR} |
||||
|
where id = #{id,jdbcType=INTEGER} |
||||
|
</update> |
||||
|
|
||||
|
</mapper> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue