1. 植物增加几个字段
This commit is contained in:
parent
05c2e0d105
commit
b1c21d7f90
|
@ -86,17 +86,18 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<!-- <finalName>${project.artifactId}</finalName>-->
|
||||
<finalName>autosprout-admin</finalName>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||
|
||||
/**
|
||||
* 植物Controller
|
||||
*
|
||||
*
|
||||
* @author qiuzhenzhao
|
||||
* @date 2023-11-14
|
||||
*/
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
|
||||
/**
|
||||
* 植物对象 as_plant
|
||||
*
|
||||
*
|
||||
* @author qiuzhenzhao
|
||||
* @date 2023-11-14
|
||||
*/
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.device.mapper.AsPlantMapper">
|
||||
|
||||
|
||||
<resultMap type="AsPlant" id="AsPlantResult">
|
||||
<result property="plantId" column="plant_id" />
|
||||
<result property="plantName" column="plant_name" />
|
||||
|
@ -18,15 +18,19 @@ 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">
|
||||
<include refid="selectAsPlantVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="plantName != null and plantName != ''"> and plant_name like concat('%', #{plantName}, '%')</if>
|
||||
<if test="classifyId != null "> and classify_id = #{classifyId}</if>
|
||||
<if test="wateringCycle != null and wateringCycle != ''"> and watering_cycle = #{wateringCycle}</if>
|
||||
|
@ -34,12 +38,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="sproutCycle != null and sproutCycle != ''"> and sprout_cycle = #{sproutCycle}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAsPlantByPlantId" parameterType="Long" resultMap="AsPlantResult">
|
||||
<include refid="selectAsPlantVo"/>
|
||||
where plant_id = #{plantId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertAsPlant" parameterType="AsPlant" useGeneratedKeys="true" keyProperty="plantId">
|
||||
insert into as_plant
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -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>
|
||||
|
@ -96,9 +112,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteAsPlantByPlantIds" parameterType="String">
|
||||
delete from as_plant where plant_id in
|
||||
delete from as_plant where plant_id in
|
||||
<foreach item="plantId" collection="array" open="(" separator="," close=")">
|
||||
#{plantId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue
Block a user