package com.alatus.service;

import com.alatus.model.TClue;

import com.github.pagehelper.PageInfo;

import java.io.InputStream;

public interface ClueService {

PageInfo getClueByPage(Integer current);

void importExcel(InputStream inputStream);

}

package com.alatus.service;

import com.alatus.model.TClue;

import com.github.pagehelper.PageInfo;

import java.io.InputStream;

public interface ClueService {

PageInfo getClueByPage(Integer current);

void importExcel(InputStream inputStream);

}

package com.alatus.service.impl;

import com.alatus.config.listener.UploadDataListener;

import com.alatus.constant.Constants;

import com.alatus.mapper.TClueMapper;

import com.alatus.model.TClue;

import com.alatus.query.BaseQuery;

import com.alatus.service.ClueService;

import com.alibaba.excel.EasyExcel;

import com.github.pagehelper.PageHelper;

import com.github.pagehelper.PageInfo;

import jakarta.annotation.Resource;

import org.springframework.stereotype.Service;

import java.io.InputStream;

import java.util.List;

@Service

public class ClueServiceImpl implements ClueService {

@Resource

private TClueMapper tClueMapper;

@Override

public PageInfo getClueByPage(Integer current) {

// 1.设置PageHelper

PageHelper.startPage(current, Constants.PAGE_SIZE);

// 2.查询

List list = tClueMapper.selectClueByPage(BaseQuery.builder().build());

// 3.封装分页数据到PageInfo

PageInfo info = new PageInfo<>(list);

return info;

}

@Override

public void importExcel(InputStream inputStream) {

// 第一个参数是文件,第二个参数是excel模板类,第三个是监听器

EasyExcel.read(inputStream,TClue.class,new UploadDataListener(tClueMapper)).sheet().doRead();

}

}

package com.alatus.service.impl;

import com.alatus.config.listener.UploadDataListener;

import com.alatus.constant.Constants;

import com.alatus.mapper.TClueMapper;

import com.alatus.model.TClue;

import com.alatus.query.BaseQuery;

import com.alatus.service.ClueService;

import com.alibaba.excel.EasyExcel;

import com.github.pagehelper.PageHelper;

import com.github.pagehelper.PageInfo;

import jakarta.annotation.Resource;

import org.springframework.stereotype.Service;

import java.io.InputStream;

import java.util.List;

@Service

public class ClueServiceImpl implements ClueService {

@Resource

private TClueMapper tClueMapper;

@Override

public PageInfo getClueByPage(Integer current) {

// 1.设置PageHelper

PageHelper.startPage(current, Constants.PAGE_SIZE);

// 2.查询

List list = tClueMapper.selectClueByPage(BaseQuery.builder().build());

// 3.封装分页数据到PageInfo

PageInfo info = new PageInfo<>(list);

return info;

}

@Override

public void importExcel(InputStream inputStream) {

// 第一个参数是文件,第二个参数是excel模板类,第三个是监听器

EasyExcel.read(inputStream,TClue.class,new UploadDataListener(tClueMapper)).sheet().doRead();

}

}

id, owner_id, activity_id, full_name, appellation, phone, weixin, qq, email, age,

job, year_income, address, need_loan, intention_state, intention_product, `state`,

`source`, description, next_contact_time, create_time, create_by, edit_time, edit_by

delete from t_clue

where id = #{id,jdbcType=INTEGER}

insert into t_clue (owner_id, activity_id, full_name,

appellation, phone, weixin,

qq, email, age, job,

year_income, address, need_loan,

intention_state, intention_product, `state`,

`source`, description, next_contact_time,

create_time, create_by, edit_time,

edit_by)

values (#{ownerId,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, #{fullName,jdbcType=VARCHAR},

#{appellation,jdbcType=INTEGER}, #{phone,jdbcType=VARCHAR}, #{weixin,jdbcType=VARCHAR},

#{qq,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{job,jdbcType=VARCHAR},

#{yearIncome,jdbcType=DECIMAL}, #{address,jdbcType=VARCHAR}, #{needLoan,jdbcType=INTEGER},

#{intentionState,jdbcType=INTEGER}, #{intentionProduct,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},

#{source,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR}, #{nextContactTime,jdbcType=TIMESTAMP},

#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP},

#{editBy,jdbcType=INTEGER})

insert into t_clue

owner_id,

activity_id,

full_name,

appellation,

phone,

weixin,

qq,

email,

age,

job,

year_income,

address,

need_loan,

intention_state,

intention_product,

`state`,

`source`,

description,

next_contact_time,

create_time,

create_by,

edit_time,

edit_by,

#{ownerId,jdbcType=INTEGER},

#{activityId,jdbcType=INTEGER},

#{fullName,jdbcType=VARCHAR},

#{appellation,jdbcType=INTEGER},

#{phone,jdbcType=VARCHAR},

#{weixin,jdbcType=VARCHAR},

#{qq,jdbcType=VARCHAR},

#{email,jdbcType=VARCHAR},

#{age,jdbcType=INTEGER},

#{job,jdbcType=VARCHAR},

#{yearIncome,jdbcType=DECIMAL},

#{address,jdbcType=VARCHAR},

#{needLoan,jdbcType=INTEGER},

#{intentionState,jdbcType=INTEGER},

#{intentionProduct,jdbcType=INTEGER},

#{state,jdbcType=INTEGER},

#{source,jdbcType=INTEGER},

#{description,jdbcType=VARCHAR},

#{nextContactTime,jdbcType=TIMESTAMP},

#{createTime,jdbcType=TIMESTAMP},

#{createBy,jdbcType=INTEGER},

#{editTime,jdbcType=TIMESTAMP},

#{editBy,jdbcType=INTEGER},

insert into t_clue(`owner_id`, `activity_id`, `full_name`,

`appellation`, `phone`, `weixin`,

`qq`, `email`, `age`, `job`,

`year_income`, `address`, `need_loan`,

`intention_state`, `intention_product`, `state`,

`source`, `description`, `next_contact_time`,

`create_time`, `create_by`, `edit_time`,

edit_by)

values

(#{tClue.ownerId,jdbcType=INTEGER}, #{tClue.activityId,jdbcType=INTEGER}, #{tClue.fullName,jdbcType=VARCHAR},

#{tClue.appellation,jdbcType=INTEGER}, #{tClue.phone,jdbcType=VARCHAR}, #{tClue.weixin,jdbcType=VARCHAR},

#{tClue.qq,jdbcType=VARCHAR}, #{tClue.email,jdbcType=VARCHAR}, #{tClue.age,jdbcType=INTEGER}, #{tClue.job,jdbcType=VARCHAR},

#{tClue.yearIncome,jdbcType=DECIMAL}, #{tClue.address,jdbcType=VARCHAR}, #{tClue.needLoan,jdbcType=INTEGER},

#{tClue.intentionState,jdbcType=INTEGER}, #{tClue.intentionProduct,jdbcType=INTEGER}, #{tClue.state,jdbcType=INTEGER},

#{tClue.source,jdbcType=INTEGER}, #{tClue.description,jdbcType=VARCHAR}, #{tClue.nextContactTime,jdbcType=TIMESTAMP},

#{tClue.createTime,jdbcType=TIMESTAMP}, #{tClue.createBy,jdbcType=INTEGER}, #{tClue.editTime,jdbcType=TIMESTAMP},

#{tClue.editBy,jdbcType=INTEGER})

update t_clue

owner_id = #{ownerId,jdbcType=INTEGER},

activity_id = #{activityId,jdbcType=INTEGER},

full_name = #{fullName,jdbcType=VARCHAR},

appellation = #{appellation,jdbcType=INTEGER},

phone = #{phone,jdbcType=VARCHAR},

weixin = #{weixin,jdbcType=VARCHAR},

qq = #{qq,jdbcType=VARCHAR},

email = #{email,jdbcType=VARCHAR},

age = #{age,jdbcType=INTEGER},

job = #{job,jdbcType=VARCHAR},

year_income = #{yearIncome,jdbcType=DECIMAL},

address = #{address,jdbcType=VARCHAR},

need_loan = #{needLoan,jdbcType=INTEGER},

intention_state = #{intentionState,jdbcType=INTEGER},

intention_product = #{intentionProduct,jdbcType=INTEGER},

`state` = #{state,jdbcType=INTEGER},

`source` = #{source,jdbcType=INTEGER},

description = #{description,jdbcType=VARCHAR},

next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},

create_time = #{createTime,jdbcType=TIMESTAMP},

create_by = #{createBy,jdbcType=INTEGER},

edit_time = #{editTime,jdbcType=TIMESTAMP},

edit_by = #{editBy,jdbcType=INTEGER},

where id = #{id,jdbcType=INTEGER}

update t_clue

set owner_id = #{ownerId,jdbcType=INTEGER},

activity_id = #{activityId,jdbcType=INTEGER},

full_name = #{fullName,jdbcType=VARCHAR},

appellation = #{appellation,jdbcType=INTEGER},

phone = #{phone,jdbcType=VARCHAR},

weixin = #{weixin,jdbcType=VARCHAR},

qq = #{qq,jdbcType=VARCHAR},

email = #{email,jdbcType=VARCHAR},

age = #{age,jdbcType=INTEGER},

job = #{job,jdbcType=VARCHAR},

year_income = #{yearIncome,jdbcType=DECIMAL},

address = #{address,jdbcType=VARCHAR},

need_loan = #{needLoan,jdbcType=INTEGER},

intention_state = #{intentionState,jdbcType=INTEGER},

intention_product = #{intentionProduct,jdbcType=INTEGER},

`state` = #{state,jdbcType=INTEGER},

`source` = #{source,jdbcType=INTEGER},

description = #{description,jdbcType=VARCHAR},

next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},

create_time = #{createTime,jdbcType=TIMESTAMP},

create_by = #{createBy,jdbcType=INTEGER},

edit_time = #{editTime,jdbcType=TIMESTAMP},

edit_by = #{editBy,jdbcType=INTEGER}

where id = #{id,jdbcType=INTEGER}

id, owner_id, activity_id, full_name, appellation, phone, weixin, qq, email, age,

job, year_income, address, need_loan, intention_state, intention_product, `state`,

`source`, description, next_contact_time, create_time, create_by, edit_time, edit_by

delete from t_clue

where id = #{id,jdbcType=INTEGER}

insert into t_clue (owner_id, activity_id, full_name,

appellation, phone, weixin,

qq, email, age, job,

year_income, address, need_loan,

intention_state, intention_product, `state`,

`source`, description, next_contact_time,

create_time, create_by, edit_time,

edit_by)

values (#{ownerId,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, #{fullName,jdbcType=VARCHAR},

#{appellation,jdbcType=INTEGER}, #{phone,jdbcType=VARCHAR}, #{weixin,jdbcType=VARCHAR},

#{qq,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{job,jdbcType=VARCHAR},

#{yearIncome,jdbcType=DECIMAL}, #{address,jdbcType=VARCHAR}, #{needLoan,jdbcType=INTEGER},

#{intentionState,jdbcType=INTEGER}, #{intentionProduct,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},

#{source,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR}, #{nextContactTime,jdbcType=TIMESTAMP},

#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP},

#{editBy,jdbcType=INTEGER})

insert into t_clue

owner_id,

activity_id,

full_name,

appellation,

phone,

weixin,

qq,

email,

age,

job,

year_income,

address,

need_loan,

intention_state,

intention_product,

`state`,

`source`,

description,

next_contact_time,

create_time,

create_by,

edit_time,

edit_by,

#{ownerId,jdbcType=INTEGER},

#{activityId,jdbcType=INTEGER},

#{fullName,jdbcType=VARCHAR},

#{appellation,jdbcType=INTEGER},

#{phone,jdbcType=VARCHAR},

#{weixin,jdbcType=VARCHAR},

#{qq,jdbcType=VARCHAR},

#{email,jdbcType=VARCHAR},

#{age,jdbcType=INTEGER},

#{job,jdbcType=VARCHAR},

#{yearIncome,jdbcType=DECIMAL},

#{address,jdbcType=VARCHAR},

#{needLoan,jdbcType=INTEGER},

#{intentionState,jdbcType=INTEGER},

#{intentionProduct,jdbcType=INTEGER},

#{state,jdbcType=INTEGER},

#{source,jdbcType=INTEGER},

#{description,jdbcType=VARCHAR},

#{nextContactTime,jdbcType=TIMESTAMP},

#{createTime,jdbcType=TIMESTAMP},

#{createBy,jdbcType=INTEGER},

#{editTime,jdbcType=TIMESTAMP},

#{editBy,jdbcType=INTEGER},

insert into t_clue(`owner_id`, `activity_id`, `full_name`,

`appellation`, `phone`, `weixin`,

`qq`, `email`, `age`, `job`,

`year_income`, `address`, `need_loan`,

`intention_state`, `intention_product`, `state`,

`source`, `description`, `next_contact_time`,

`create_time`, `create_by`, `edit_time`,

edit_by)

values

(#{tClue.ownerId,jdbcType=INTEGER}, #{tClue.activityId,jdbcType=INTEGER}, #{tClue.fullName,jdbcType=VARCHAR},

#{tClue.appellation,jdbcType=INTEGER}, #{tClue.phone,jdbcType=VARCHAR}, #{tClue.weixin,jdbcType=VARCHAR},

#{tClue.qq,jdbcType=VARCHAR}, #{tClue.email,jdbcType=VARCHAR}, #{tClue.age,jdbcType=INTEGER}, #{tClue.job,jdbcType=VARCHAR},

#{tClue.yearIncome,jdbcType=DECIMAL}, #{tClue.address,jdbcType=VARCHAR}, #{tClue.needLoan,jdbcType=INTEGER},

#{tClue.intentionState,jdbcType=INTEGER}, #{tClue.intentionProduct,jdbcType=INTEGER}, #{tClue.state,jdbcType=INTEGER},

#{tClue.source,jdbcType=INTEGER}, #{tClue.description,jdbcType=VARCHAR}, #{tClue.nextContactTime,jdbcType=TIMESTAMP},

#{tClue.createTime,jdbcType=TIMESTAMP}, #{tClue.createBy,jdbcType=INTEGER}, #{tClue.editTime,jdbcType=TIMESTAMP},

#{tClue.editBy,jdbcType=INTEGER})

update t_clue

owner_id = #{ownerId,jdbcType=INTEGER},

activity_id = #{activityId,jdbcType=INTEGER},

full_name = #{fullName,jdbcType=VARCHAR},

appellation = #{appellation,jdbcType=INTEGER},

phone = #{phone,jdbcType=VARCHAR},

weixin = #{weixin,jdbcType=VARCHAR},

qq = #{qq,jdbcType=VARCHAR},

email = #{email,jdbcType=VARCHAR},

age = #{age,jdbcType=INTEGER},

job = #{job,jdbcType=VARCHAR},

year_income = #{yearIncome,jdbcType=DECIMAL},

address = #{address,jdbcType=VARCHAR},

need_loan = #{needLoan,jdbcType=INTEGER},

intention_state = #{intentionState,jdbcType=INTEGER},

intention_product = #{intentionProduct,jdbcType=INTEGER},

`state` = #{state,jdbcType=INTEGER},

`source` = #{source,jdbcType=INTEGER},

description = #{description,jdbcType=VARCHAR},

next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},

create_time = #{createTime,jdbcType=TIMESTAMP},

create_by = #{createBy,jdbcType=INTEGER},

edit_time = #{editTime,jdbcType=TIMESTAMP},

edit_by = #{editBy,jdbcType=INTEGER},

where id = #{id,jdbcType=INTEGER}

update t_clue

set owner_id = #{ownerId,jdbcType=INTEGER},

activity_id = #{activityId,jdbcType=INTEGER},

full_name = #{fullName,jdbcType=VARCHAR},

appellation = #{appellation,jdbcType=INTEGER},

phone = #{phone,jdbcType=VARCHAR},

weixin = #{weixin,jdbcType=VARCHAR},

qq = #{qq,jdbcType=VARCHAR},

email = #{email,jdbcType=VARCHAR},

age = #{age,jdbcType=INTEGER},

job = #{job,jdbcType=VARCHAR},

year_income = #{yearIncome,jdbcType=DECIMAL},

address = #{address,jdbcType=VARCHAR},

need_loan = #{needLoan,jdbcType=INTEGER},

intention_state = #{intentionState,jdbcType=INTEGER},

intention_product = #{intentionProduct,jdbcType=INTEGER},

`state` = #{state,jdbcType=INTEGER},

`source` = #{source,jdbcType=INTEGER},

description = #{description,jdbcType=VARCHAR},

next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},

create_time = #{createTime,jdbcType=TIMESTAMP},

create_by = #{createBy,jdbcType=INTEGER},

edit_time = #{editTime,jdbcType=TIMESTAMP},

edit_by = #{editBy,jdbcType=INTEGER}

where id = #{id,jdbcType=INTEGER}

参考文章

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: