附件表优化

This commit is contained in:
sxu 2024-11-05 11:04:02 +08:00
parent d8283918da
commit 3034230451
2 changed files with 23 additions and 1 deletions

View File

@ -24,6 +24,11 @@ public class BmFileInfo extends BaseEntity
/** 主键id */
private Long id;
/** 任务类型, 参考数据字典 tm_task_type */
@Excel(name = "任务类型")
@ApiModelProperty(value = "任务类型")
private Long taskType;
/** 任务id */
@Excel(name = "任务id")
@ApiModelProperty(value = "任务id")
@ -44,6 +49,11 @@ public class BmFileInfo extends BaseEntity
@ApiModelProperty(value = "文件路径")
private String url;
/** 文件类型, 参考数据字典 bm_file_type */
@Excel(name = "文件类型")
@ApiModelProperty(value = "文件类型")
private Long fileType;
/** 数据字典 */
@Excel(name = "数据字典")
@ApiModelProperty(value = "数据字典")

View File

@ -5,26 +5,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.bonus.material.basic.mapper.BmFileInfoMapper">
<resultMap type="com.bonus.material.basic.domain.BmFileInfo" id="BmFileInfoResult">
<result property="id" column="id" />
<result property="taskType" column="task_type" />
<result property="taskId" column="task_id" />
<result property="modelId" column="model_id" />
<result property="name" column="name" />
<result property="url" column="url" />
<result property="fileType" column="file_type" />
<result property="dicId" column="dic_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectBmFileInfoVo">
select id, task_id, model_id, name, url, dic_id, create_by, create_time from bm_file_info
select id, task_type, task_id, model_id, name, url, file_type, dic_id, create_by, create_time from bm_file_info
</sql>
<select id="selectBmFileInfoList" parameterType="com.bonus.material.basic.domain.BmFileInfo" resultMap="BmFileInfoResult">
<include refid="selectBmFileInfoVo"/>
<where>
<if test="taskType != null "> and task_type = #{taskType}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="modelId != null "> and model_id = #{modelId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="url != null and url != ''"> and url = #{url}</if>
<if test="fileType != null "> and file_type = #{fileType}</if>
<if test="dicId != null "> and dic_id = #{dicId}</if>
</where>
</select>
@ -37,19 +41,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertBmFileInfo" parameterType="com.bonus.material.basic.domain.BmFileInfo" useGeneratedKeys="true" keyProperty="id">
insert into bm_file_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskType != null">task_type,</if>
<if test="taskId != null">task_id,</if>
<if test="modelId != null">model_id,</if>
<if test="name != null">name,</if>
<if test="url != null">url,</if>
<if test="fileType != null">file_type,</if>
<if test="dicId != null">dic_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskType != null">#{taskType},</if>
<if test="taskId != null">#{taskId},</if>
<if test="modelId != null">#{modelId},</if>
<if test="name != null">#{name},</if>
<if test="url != null">#{url},</if>
<if test="fileType != null">#{fileType},</if>
<if test="dicId != null">#{dicId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -59,10 +67,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateBmFileInfo" parameterType="com.bonus.material.basic.domain.BmFileInfo">
update bm_file_info
<trim prefix="SET" suffixOverrides=",">
<if test="taskType != null">task_type = #{taskType},</if>
<if test="taskId != null">task_id = #{taskId},</if>
<if test="modelId != null">model_id = #{modelId},</if>
<if test="name != null">name = #{name},</if>
<if test="url != null">url = #{url},</if>
<if test="fileType != null">file_type = #{fileType},</if>
<if test="dicId != null">dic_id = #{dicId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@ -84,8 +94,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteBmFileInfoByBizInfo" parameterType="com.bonus.material.basic.domain.BmFileInfo">
delete from bm_file_info
<where>
<if test="taskType != null "> and task_type = #{taskType}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="modelId != null "> and model_id = #{modelId}</if>
<if test="fileType != null "> and file_type = #{fileType}</if>
<if test="dicId != null "> and dic_id = #{dicId}</if>
</where>
</delete>