1. 植物增加几个字段

This commit is contained in:
邱贞招 2024-01-26 16:20:08 +08:00
parent 05c2e0d105
commit b1c21d7f90
5 changed files with 57 additions and 22 deletions

View File

@ -96,7 +96,8 @@
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
<!-- <finalName>${project.artifactId}</finalName>-->
<finalName>autosprout-admin</finalName>
</build>
</project>

View File

@ -62,7 +62,7 @@ public class AsPlantController extends BaseController
/**
* 获取植物详细信息
*/
@PreAuthorize("@ss.hasPermi('plant:plant:query')")
// @PreAuthorize("@ss.hasPermi('plant:plant:query')")
@GetMapping(value = "/{plantId}")
public AjaxResult getInfo(@PathVariable("plantId") Long plantId)
{

View File

@ -52,4 +52,19 @@ public class AsPlant extends BaseEntity
@Excel(name = "介绍")
private String introduce;
/** 难易程度 */
@Excel(name = "难易程度")
private String complexity;
/** 功能 */
@Excel(name = "功能")
private String func;
/** 适合的空间 */
@Excel(name = "适合的空间")
private String fitSpace;
/** 养护重点 */
@Excel(name = "养护重点")
private String maintenanceFocus;
}

View File

@ -5,6 +5,7 @@ import com.ruoyi.device.domain.AsArticle;
import com.ruoyi.device.mapper.AsArticleMapper;
import com.ruoyi.device.service.IAsArticleService;
import com.ruoyi.system.mapper.SysDictDataMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -35,14 +36,16 @@ public class AsArticleServiceImpl implements IAsArticleService
public AsArticle selectAsArticleByArticleId(Long articleId)
{
AsArticle asArticle = asArticleMapper.selectAsArticleByArticleId(articleId);
asArticle.setFormatCreateTime(DateUtils.getYYYY_MM_DD(asArticle.getCreateTime()));
if(ObjectUtils.isNotEmpty(asArticle)){
asArticle.setFormatCreateTime(DateUtils.getYYYY_MM_DD(asArticle.getCreateTime()));
}
return asArticle;
}
/**
* 查询文章列表
*
* @param AsArticle 文章
* @param asArticle 文章
* @return 文章
*/
@Override
@ -58,7 +61,7 @@ public class AsArticleServiceImpl implements IAsArticleService
/**
* 新增文章
*
* @param AsArticle 文章
* @param asArticle 文章
* @return 结果
*/
@Override
@ -71,7 +74,7 @@ public class AsArticleServiceImpl implements IAsArticleService
/**
* 修改文章
*
* @param AsArticle 文章
* @param asArticle 文章
* @return 结果
*/
@Override

View File

@ -18,10 +18,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="introduce" column="introduce" />
<result property="complexity" column="complexity" />
<result property="func" column="func" />
<result property="fitSpace" column="fit_space" />
<result property="maintenanceFocus" column="maintenance_focus" />
</resultMap>
<sql id="selectAsPlantVo">
select plant_id, plant_name, classify_id, classify_name, picture, watering_cycle, beam, sprout_cycle, create_by, create_time, update_by, update_time, introduce from as_plant
select plant_id, plant_name, classify_id, classify_name, picture, watering_cycle, beam, sprout_cycle, create_by, create_time, update_by, update_time, introduce,complexity,func,fit_space,maintenance_focus from as_plant
</sql>
<select id="selectAsPlantList" parameterType="AsPlant" resultMap="AsPlantResult">
@ -55,6 +59,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="introduce != null">introduce,</if>
<if test="complexity != null">complexity,</if>
<if test="func != null">func,</if>
<if test="fitSpace != null">fit_space,</if>
<if test="maintenanceFocus != null">maintenance_focus,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="plantName != null">#{plantName},</if>
@ -69,6 +77,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="introduce != null">#{introduce},</if>
<if test="complexity != null">#{complexity},</if>
<if test="func != null">#{func},</if>
<if test="fitSpace != null">#{fitSpace},</if>
<if test="maintenanceFocus != null">#{maintenanceFocus},</if>
</trim>
</insert>
@ -87,6 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="introduce != null">introduce = #{introduce},</if>
<if test="complexity != null">complexity = #{complexity},</if>
<if test="func != null">func = #{func},</if>
<if test="fitSpace != null">fit_space = #{fitSpace},</if>
<if test="maintenanceFocus != null">maintenance_focus = #{maintenanceFocus},</if>
</trim>
where plant_id = #{plantId}
</update>