Bläddra i källkod

农村合作社 代码生成(默认)

wangzhe 1 år sedan
förälder
incheckning
e8ede0741b

+ 139 - 0
sooka-jnb/src/main/java/com/sooka/jnb/cooperative/domain/Cooperative.java

@@ -0,0 +1,139 @@
+package com.sooka.jnb.cooperative.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;
+
+/**
+ * 供销合作社对象 jnb_supply_and_marketing_cooperative
+ * 
+ * @author ruoyi
+ * @date 2024-03-01
+ */
+public class Cooperative extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 删除状态 */
+    private String delFlag;
+
+    /** 版本 */
+    @Excel(name = "版本")
+    private Integer version;
+
+    /** 供销社名称 */
+    @Excel(name = "供销社名称")
+    private String name;
+
+    /** 地址 */
+    @Excel(name = "地址")
+    private String address;
+
+    /** 负责人 */
+    @Excel(name = "负责人")
+    private String chargePeople;
+
+    /** 负责人电话 */
+    @Excel(name = "负责人电话")
+    private String chargePhone;
+
+    /** 图片 */
+    @Excel(name = "图片")
+    private String imgUrl;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setVersion(Integer version)
+    {
+        this.version = version;
+    }
+
+    public Integer getVersion()
+    {
+        return version;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setAddress(String address) 
+    {
+        this.address = address;
+    }
+
+    public String getAddress() 
+    {
+        return address;
+    }
+    public void setChargePeople(String chargePeople) 
+    {
+        this.chargePeople = chargePeople;
+    }
+
+    public String getChargePeople() 
+    {
+        return chargePeople;
+    }
+    public void setChargePhone(String chargePhone) 
+    {
+        this.chargePhone = chargePhone;
+    }
+
+    public String getChargePhone() 
+    {
+        return chargePhone;
+    }
+    public void setImgUrl(String imgUrl) 
+    {
+        this.imgUrl = imgUrl;
+    }
+
+    public String getImgUrl() 
+    {
+        return imgUrl;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .append("delFlag", getDelFlag())
+            .append("version", getVersion())
+            .append("name", getName())
+            .append("address", getAddress())
+            .append("chargePeople", getChargePeople())
+            .append("chargePhone", getChargePhone())
+            .append("imgUrl", getImgUrl())
+            .toString();
+    }
+}

+ 61 - 0
sooka-jnb/src/main/java/com/sooka/jnb/cooperative/mapper/CooperativeMapper.java

@@ -0,0 +1,61 @@
+package com.sooka.jnb.cooperative.mapper;
+
+import java.util.List;
+import com.sooka.jnb.cooperative.domain.Cooperative;
+
+/**
+ * 供销合作社Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-03-01
+ */
+public interface CooperativeMapper 
+{
+    /**
+     * 查询供销合作社
+     * 
+     * @param id 供销合作社主键
+     * @return 供销合作社
+     */
+    public Cooperative selectCooperativeById(Long id);
+
+    /**
+     * 查询供销合作社列表
+     * 
+     * @param jnbSupplyAndMarketingCooperative 供销合作社
+     * @return 供销合作社集合
+     */
+    public List<Cooperative> selectCooperativeList(Cooperative jnbSupplyAndMarketingCooperative);
+
+    /**
+     * 新增供销合作社
+     * 
+     * @param jnbSupplyAndMarketingCooperative 供销合作社
+     * @return 结果
+     */
+    public int insertCooperative(Cooperative jnbSupplyAndMarketingCooperative);
+
+    /**
+     * 修改供销合作社
+     * 
+     * @param jnbSupplyAndMarketingCooperative 供销合作社
+     * @return 结果
+     */
+    public int updateCooperative(Cooperative jnbSupplyAndMarketingCooperative);
+
+    /**
+     * 删除供销合作社
+     * 
+     * @param id 供销合作社主键
+     * @return 结果
+     */
+    public int deleteCooperativeById(Long id);
+
+    /**
+     * 批量删除供销合作社
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCooperativeByIds(Long[] ids);
+}

+ 61 - 0
sooka-jnb/src/main/java/com/sooka/jnb/cooperative/service/ICooperativeService.java

@@ -0,0 +1,61 @@
+package com.sooka.jnb.cooperative.service;
+
+import java.util.List;
+import com.sooka.jnb.cooperative.domain.Cooperative;
+
+/**
+ * 供销合作社Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-03-01
+ */
+public interface ICooperativeService 
+{
+    /**
+     * 查询供销合作社
+     * 
+     * @param id 供销合作社主键
+     * @return 供销合作社
+     */
+    public Cooperative selectCooperativeById(Long id);
+
+    /**
+     * 查询供销合作社列表
+     * 
+     * @param jnbSupplyAndMarketingCooperative 供销合作社
+     * @return 供销合作社集合
+     */
+    public List<Cooperative> selectCooperativeList(Cooperative jnbSupplyAndMarketingCooperative);
+
+    /**
+     * 新增供销合作社
+     * 
+     * @param jnbSupplyAndMarketingCooperative 供销合作社
+     * @return 结果
+     */
+    public int insertCooperative(Cooperative jnbSupplyAndMarketingCooperative);
+
+    /**
+     * 修改供销合作社
+     * 
+     * @param jnbSupplyAndMarketingCooperative 供销合作社
+     * @return 结果
+     */
+    public int updateCooperative(Cooperative jnbSupplyAndMarketingCooperative);
+
+    /**
+     * 批量删除供销合作社
+     * 
+     * @param ids 需要删除的供销合作社主键集合
+     * @return 结果
+     */
+    public int deleteCooperativeByIds(Long[] ids);
+
+    /**
+     * 删除供销合作社信息
+     * 
+     * @param id 供销合作社主键
+     * @return 结果
+     */
+    public int deleteCooperativeById(Long id);
+}

+ 97 - 0
sooka-jnb/src/main/java/com/sooka/jnb/cooperative/service/impl/CooperativeServiceImpl.java

@@ -0,0 +1,97 @@
+package com.sooka.jnb.cooperative.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.sooka.jnb.cooperative.domain.Cooperative;
+import com.sooka.jnb.cooperative.mapper.CooperativeMapper;
+import org.springframework.stereotype.Service;
+import com.sooka.jnb.cooperative.service.ICooperativeService;
+
+import javax.annotation.Resource;
+
+/**
+ * 供销合作社Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-03-01
+ */
+@Service
+public class CooperativeServiceImpl implements ICooperativeService 
+{
+    @Resource
+    private CooperativeMapper cooperativeMapper;
+
+    /**
+     * 查询供销合作社
+     * 
+     * @param id 供销合作社主键
+     * @return 供销合作社
+     */
+    @Override
+    public Cooperative selectCooperativeById(Long id)
+    {
+        return cooperativeMapper.selectCooperativeById(id);
+    }
+
+    /**
+     * 查询供销合作社列表
+     * 
+     * @param jnbSupplyAndMarketingCooperative 供销合作社
+     * @return 供销合作社
+     */
+    @Override
+    public List<Cooperative> selectCooperativeList(Cooperative jnbSupplyAndMarketingCooperative)
+    {
+        return cooperativeMapper.selectCooperativeList(jnbSupplyAndMarketingCooperative);
+    }
+
+    /**
+     * 新增供销合作社
+     * 
+     * @param jnbSupplyAndMarketingCooperative 供销合作社
+     * @return 结果
+     */
+    @Override
+    public int insertCooperative(Cooperative jnbSupplyAndMarketingCooperative)
+    {
+        jnbSupplyAndMarketingCooperative.setCreateTime(DateUtils.getNowDate());
+        return cooperativeMapper.insertCooperative(jnbSupplyAndMarketingCooperative);
+    }
+
+    /**
+     * 修改供销合作社
+     * 
+     * @param jnbSupplyAndMarketingCooperative 供销合作社
+     * @return 结果
+     */
+    @Override
+    public int updateCooperative(Cooperative jnbSupplyAndMarketingCooperative)
+    {
+        jnbSupplyAndMarketingCooperative.setUpdateTime(DateUtils.getNowDate());
+        return cooperativeMapper.updateCooperative(jnbSupplyAndMarketingCooperative);
+    }
+
+    /**
+     * 批量删除供销合作社
+     * 
+     * @param ids 需要删除的供销合作社主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCooperativeByIds(Long[] ids)
+    {
+        return cooperativeMapper.deleteCooperativeByIds(ids);
+    }
+
+    /**
+     * 删除供销合作社信息
+     * 
+     * @param id 供销合作社主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCooperativeById(Long id)
+    {
+        return cooperativeMapper.deleteCooperativeById(id);
+    }
+}

+ 105 - 0
sooka-jnb/src/main/resources/mapper/cooperative/CooperativeMapper.xml

@@ -0,0 +1,105 @@
+<?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.sooka.jnb.cooperative.mapper.CooperativeMapper">
+    
+    <resultMap type="com.sooka.jnb.cooperative.domain.Cooperative" id="CooperativeResult">
+        <result property="id"    column="id"    />
+        <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"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="version"    column="version"    />
+        <result property="name"    column="name"    />
+        <result property="address"    column="address"    />
+        <result property="chargePeople"    column="charge_people"    />
+        <result property="chargePhone"    column="charge_phone"    />
+        <result property="imgUrl"    column="img_url"    />
+    </resultMap>
+
+    <sql id="selectCooperativeVo">
+        select id, create_by, create_time, update_by, update_time, remark, del_flag, version, name, address, charge_people, charge_phone, img_url from jnb_supply_and_marketing_cooperative
+    </sql>
+
+    <select id="selectCooperativeList" parameterType="com.sooka.jnb.cooperative.domain.Cooperative" resultMap="CooperativeResult">
+        <include refid="selectCooperativeVo"/>
+        <where>  
+            <if test="version != null  and version != ''"> and version = #{version}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="address != null  and address != ''"> and address like concat('%', #{address}, '%')</if>
+            <if test="chargePeople != null  and chargePeople != ''"> and charge_people like concat('%', #{chargePeople}, '%')</if>
+            <if test="chargePhone != null  and chargePhone != ''"> and charge_phone = #{chargePhone}</if>
+            <if test="imgUrl != null  and imgUrl != ''"> and img_url = #{imgUrl}</if>
+        </where>
+    </select>
+    
+    <select id="selectCooperativeById" parameterType="java.lang.Long" resultMap="CooperativeResult">
+        <include refid="selectCooperativeVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertCooperative" parameterType="com.sooka.jnb.cooperative.domain.Cooperative" useGeneratedKeys="true" keyProperty="id">
+        insert into jnb_supply_and_marketing_cooperative
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <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>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="version != null">version,</if>
+            <if test="name != null">name,</if>
+            <if test="address != null">address,</if>
+            <if test="chargePeople != null">charge_people,</if>
+            <if test="chargePhone != null">charge_phone,</if>
+            <if test="imgUrl != null">img_url,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <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>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="version != null">#{version},</if>
+            <if test="name != null">#{name},</if>
+            <if test="address != null">#{address},</if>
+            <if test="chargePeople != null">#{chargePeople},</if>
+            <if test="chargePhone != null">#{chargePhone},</if>
+            <if test="imgUrl != null">#{imgUrl},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCooperative" parameterType="com.sooka.jnb.cooperative.domain.Cooperative">
+        update jnb_supply_and_marketing_cooperative
+        <trim prefix="SET" suffixOverrides=",">
+            <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>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="version != null">version = #{version},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="address != null">address = #{address},</if>
+            <if test="chargePeople != null">charge_people = #{chargePeople},</if>
+            <if test="chargePhone != null">charge_phone = #{chargePhone},</if>
+            <if test="imgUrl != null">img_url = #{imgUrl},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCooperativeById" parameterType="java.lang.Long">
+        delete from jnb_supply_and_marketing_cooperative where id = #{id}
+    </delete>
+
+    <delete id="deleteCooperativeByIds" parameterType="java.lang.String">
+        delete from jnb_supply_and_marketing_cooperative where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>