crops智慧农业

This commit is contained in:
2023-05-04 16:25:09 +08:00
parent 6ad345331d
commit 10b89f0da0
101 changed files with 5025 additions and 32 deletions

View File

@ -0,0 +1,126 @@
package com.ruoyi.pill.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 生产厂家信息对象 pill_factory
*
* @author my
* @date 2023-04-18
*/
public class PillFactory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 厂家ID */
private Long factoryId;
/** 厂家名称 */
@Excel(name = "厂家名称")
private String factoryName;
/** 厂家编码 */
@Excel(name = "厂家编码")
private String factoryCode;
/** 联系人 */
@Excel(name = "联系人")
private String contact;
/** 电话 */
@Excel(name = "电话")
private String phone;
/** 关键字 */
@Excel(name = "关键字")
private String keyword;
/** 状态 */
@Excel(name = "状态")
private String status;
public void setFactoryId(Long factoryId)
{
this.factoryId = factoryId;
}
public Long getFactoryId()
{
return factoryId;
}
public void setFactoryName(String factoryName)
{
this.factoryName = factoryName;
}
public String getFactoryName()
{
return factoryName;
}
public void setFactoryCode(String factoryCode)
{
this.factoryCode = factoryCode;
}
public String getFactoryCode()
{
return factoryCode;
}
public void setContact(String contact)
{
this.contact = contact;
}
public String getContact()
{
return contact;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setKeyword(String keyword)
{
this.keyword = keyword;
}
public String getKeyword()
{
return keyword;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("factoryId", getFactoryId())
.append("factoryName", getFactoryName())
.append("factoryCode", getFactoryCode())
.append("contact", getContact())
.append("phone", getPhone())
.append("keyword", getKeyword())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.pill.mapper;
import java.util.List;
import com.ruoyi.pill.domain.PillFactory;
/**
* 生产厂家信息Mapper接口
*
* @author my
* @date 2023-04-18
*/
public interface PillFactoryMapper
{
/**
* 查询生产厂家信息
*
* @param factoryId 生产厂家信息主键
* @return 生产厂家信息
*/
public PillFactory selectPillFactoryByFactoryId(Long factoryId);
/**
* 查询生产厂家信息列表
*
* @param pillFactory 生产厂家信息
* @return 生产厂家信息集合
*/
public List<PillFactory> selectPillFactoryList(PillFactory pillFactory);
/**
* 新增生产厂家信息
*
* @param pillFactory 生产厂家信息
* @return 结果
*/
public int insertPillFactory(PillFactory pillFactory);
/**
* 修改生产厂家信息
*
* @param pillFactory 生产厂家信息
* @return 结果
*/
public int updatePillFactory(PillFactory pillFactory);
/**
* 删除生产厂家信息
*
* @param factoryId 生产厂家信息主键
* @return 结果
*/
public int deletePillFactoryByFactoryId(Long factoryId);
/**
* 批量删除生产厂家信息
*
* @param factoryIds 需要删除的数据主键集合
* @return 结果
*/
public int deletePillFactoryByFactoryIds(Long[] factoryIds);
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.pill.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pill.mapper.PillFactoryMapper;
import com.ruoyi.pill.domain.PillFactory;
import com.ruoyi.pill.service.IPillFactoryService;
/**
* 生产厂家信息Service业务层处理
*
* @author my
* @date 2023-04-18
*/
@Service
public class PillFactoryServiceImpl implements IPillFactoryService
{
@Autowired
private PillFactoryMapper pillFactoryMapper;
/**
* 查询生产厂家信息
*
* @param factoryId 生产厂家信息主键
* @return 生产厂家信息
*/
@Override
public PillFactory selectPillFactoryByFactoryId(Long factoryId)
{
return pillFactoryMapper.selectPillFactoryByFactoryId(factoryId);
}
/**
* 查询生产厂家信息列表
*
* @param pillFactory 生产厂家信息
* @return 生产厂家信息
*/
@Override
public List<PillFactory> selectPillFactoryList(PillFactory pillFactory)
{
return pillFactoryMapper.selectPillFactoryList(pillFactory);
}
/**
* 新增生产厂家信息
*
* @param pillFactory 生产厂家信息
* @return 结果
*/
@Override
public int insertPillFactory(PillFactory pillFactory)
{
pillFactory.setCreateTime(DateUtils.getNowDate());
return pillFactoryMapper.insertPillFactory(pillFactory);
}
/**
* 修改生产厂家信息
*
* @param pillFactory 生产厂家信息
* @return 结果
*/
@Override
public int updatePillFactory(PillFactory pillFactory)
{
pillFactory.setUpdateTime(DateUtils.getNowDate());
return pillFactoryMapper.updatePillFactory(pillFactory);
}
/**
* 批量删除生产厂家信息
*
* @param factoryIds 需要删除的生产厂家信息主键
* @return 结果
*/
@Override
public int deletePillFactoryByFactoryIds(Long[] factoryIds)
{
return pillFactoryMapper.deletePillFactoryByFactoryIds(factoryIds);
}
/**
* 删除生产厂家信息信息
*
* @param factoryId 生产厂家信息主键
* @return 结果
*/
@Override
public int deletePillFactoryByFactoryId(Long factoryId)
{
return pillFactoryMapper.deletePillFactoryByFactoryId(factoryId);
}
}

View File

@ -0,0 +1,101 @@
<?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.ruoyi.pill.mapper.PillFactoryMapper">
<resultMap type="PillFactory" id="PillFactoryResult">
<result property="factoryId" column="factory_id" />
<result property="factoryName" column="factory_name" />
<result property="factoryCode" column="factory_code" />
<result property="contact" column="contact" />
<result property="phone" column="phone" />
<result property="keyword" column="keyword" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectPillFactoryVo">
select factory_id, factory_name, factory_code, contact, phone, keyword, status, create_by, create_time, update_by, update_time, remark from pill_factory
</sql>
<select id="selectPillFactoryList" parameterType="PillFactory" resultMap="PillFactoryResult">
<include refid="selectPillFactoryVo"/>
<where>
<if test="factoryName != null and factoryName != ''"> and factory_name like concat('%', #{factoryName}, '%')</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="contact != null and contact != ''"> and contact = #{contact}</if>
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
<if test="keyword != null and keyword != ''"> and keyword like concat('%', #{keyword}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectPillFactoryByFactoryId" parameterType="Long" resultMap="PillFactoryResult">
<include refid="selectPillFactoryVo"/>
where factory_id = #{factoryId}
</select>
<insert id="insertPillFactory" parameterType="PillFactory" useGeneratedKeys="true" keyProperty="factoryId">
insert into pill_factory
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="factoryName != null and factoryName != ''">factory_name,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="contact != null">contact,</if>
<if test="phone != null">phone,</if>
<if test="keyword != null">keyword,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="factoryName != null and factoryName != ''">#{factoryName},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="contact != null">#{contact},</if>
<if test="phone != null">#{phone},</if>
<if test="keyword != null">#{keyword},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updatePillFactory" parameterType="PillFactory">
update pill_factory
<trim prefix="SET" suffixOverrides=",">
<if test="factoryName != null and factoryName != ''">factory_name = #{factoryName},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="contact != null">contact = #{contact},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="keyword != null">keyword = #{keyword},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where factory_id = #{factoryId}
</update>
<delete id="deletePillFactoryByFactoryId" parameterType="Long">
delete from pill_factory where factory_id = #{factoryId}
</delete>
<delete id="deletePillFactoryByFactoryIds" parameterType="String">
delete from pill_factory where factory_id in
<foreach item="factoryId" collection="array" open="(" separator="," close=")">
#{factoryId}
</foreach>
</delete>
</mapper>