客户关系管理

This commit is contained in:
zhanglipeng 2021-03-01 09:33:35 +08:00
parent a5cd0edaa5
commit b9e08fda2c
8 changed files with 1335 additions and 0 deletions

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询本一-客户关系管理列表
export function listCustomer(query) {
return request({
url: '/benyi/customer/list',
method: 'get',
params: query
})
}
// 查询本一-客户关系管理详细
export function getCustomer(id) {
return request({
url: '/benyi/customer/' + id,
method: 'get'
})
}
// 新增本一-客户关系管理
export function addCustomer(data) {
return request({
url: '/benyi/customer',
method: 'post',
data: data
})
}
// 修改本一-客户关系管理
export function updateCustomer(data) {
return request({
url: '/benyi/customer',
method: 'put',
data: data
})
}
// 删除本一-客户关系管理
export function delCustomer(id) {
return request({
url: '/benyi/customer/' + id,
method: 'delete'
})
}
// 导出本一-客户关系管理
export function exportCustomer(query) {
return request({
url: '/benyi/customer/export',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,497 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
label-width="90px"
>
<el-form-item label="客户姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系电话" prop="lxdh">
<el-input
v-model="queryParams.lxdh"
placeholder="请输入联系电话"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="幼儿园名称" prop="schoolname">
<el-input
v-model="queryParams.schoolname"
placeholder="请输入幼儿园名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所在省" prop="sheng">
<el-input
v-model="queryParams.sheng"
placeholder="请输入所在省"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="客户来源" prop="khly">
<el-select v-model="queryParams.khly" placeholder="请选择客户来源">
<el-option
v-for="dict in lyOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['benyi:customer:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['benyi:customer:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['benyi:customer:remove']"
>删除</el-button
>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="customerList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="编号" align="center" prop="id" /> -->
<el-table-column label="客户姓名" align="center" prop="name" />
<el-table-column label="幼儿园名称" align="center" prop="schoolname" />
<el-table-column label="幼儿园人数" align="center" prop="rs" />
<el-table-column label="身份" align="center" prop="sflx" :formatter="gxFormat"/>
<el-table-column label="联系电话" align="center" prop="lxdh" />
<el-table-column label="微信" align="center" prop="wx" />
<el-table-column label="抖音" align="center" prop="dy" />
<el-table-column label="其他" align="center" prop="qt" />
<el-table-column label="所在省" align="center" prop="sheng" />
<el-table-column label="所在市" align="center" prop="shi" />
<el-table-column label="客户来源" align="center" prop="khly" :formatter="lyFormat"/>
<el-table-column label="消费项目" align="center" prop="xfxm" />
<el-table-column label="消费价值" align="center" prop="xfjz" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['benyi:customer:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['benyi:customer:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改本一-客户关系管理对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row :gutter="15">
<el-col :span="12">
<el-form-item label="客户姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="幼儿园名称" prop="schoolname">
<el-input
v-model="form.schoolname"
placeholder="请输入幼儿园名称"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="幼儿园人数" prop="rs">
<el-input-number
v-model="form.rs"
placeholder="请输入幼儿园人数"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="身份" prop="sflx">
<el-select v-model="form.sflx" placeholder="请选择身份">
<el-option
v-for="dict in gxOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="lxdh">
<el-input v-model="form.lxdh" placeholder="请输入联系电话" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="微信" prop="wx">
<el-input v-model="form.wx" placeholder="请输入微信" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="抖音" prop="dy">
<el-input v-model="form.dy" placeholder="请输入抖音" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="其他联系方式" prop="qt">
<el-input v-model="form.qt" placeholder="请输入其他联系方式" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所在省" prop="sheng">
<el-input v-model="form.sheng" placeholder="请输入所在省" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所在市" prop="shi">
<el-input v-model="form.shi" placeholder="请输入所在市" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户来源" prop="khly">
<el-select v-model="form.khly" placeholder="请选择客户来源">
<el-option
v-for="dict in lyOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="消费项目" prop="xfxm">
<el-input v-model="form.xfxm" placeholder="请输入消费项目" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="消费价值" prop="xfjz">
<el-input v-model="form.xfjz" placeholder="请输入消费价值" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="bz">
<el-input v-model="form.bz" placeholder="请输入备注" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="转换跟进" prop="zhgj">
<el-input
v-model="form.zhgj"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listCustomer,
getCustomer,
delCustomer,
addCustomer,
updateCustomer,
exportCustomer,
} from "@/api/benyi/customer";
export default {
name: "Customer",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
total: 0,
// -
customerList: [],
//
title: "",
//
open: false,
gxOptions: [],
lyOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
sflx: undefined,
lxdh: undefined,
wx: undefined,
dy: undefined,
qt: undefined,
schoolname: undefined,
rs: undefined,
sheng: undefined,
shengid: undefined,
shi: undefined,
shiid: undefined,
khly: undefined,
createUserid: undefined,
bz: undefined,
zhgj: undefined,
state: undefined,
xfxm: undefined,
xfjz: undefined,
},
//
form: {},
//
rules: {
name: [
{ required: true, message: "客户姓名不能为空", trigger: "blur" },
],
schoolname: [
{ required: true, message: "幼儿园名称不能为空", trigger: "blur" },
],
lxdh: [
{ required: true, message: "幼儿园名称不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
this.getDicts("sys_dm_khgxsflx").then((response) => {
this.gxOptions = response.data;
});
this.getDicts("sys_dm_khgxly").then((response) => {
this.lyOptions = response.data;
});
},
methods: {
//
gxFormat(row, column) {
return this.selectDictLabel(this.gxOptions, row.sflx);
},
//
lyFormat(row, column) {
return this.selectDictLabel(this.lyOptions, row.khly);
},
/** 查询本一-客户关系管理列表 */
getList() {
this.loading = true;
listCustomer(this.queryParams).then((response) => {
this.customerList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
name: undefined,
sflx: undefined,
lxdh: undefined,
wx: undefined,
dy: undefined,
qt: undefined,
schoolname: undefined,
rs: 0,
sheng: undefined,
shengid: undefined,
shi: undefined,
shiid: undefined,
khly: undefined,
createUserid: undefined,
bz: undefined,
zhgj: undefined,
state: undefined,
xfxm: undefined,
xfjz: undefined,
createTime: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加本一-客户关系管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getCustomer(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改本一-客户关系管理";
});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != undefined) {
updateCustomer(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addCustomer(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm(
'是否确认删除本一-客户关系管理编号为"' + ids + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delCustomer(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有本一-客户关系管理数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportCustomer(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
},
};
</script>

View File

@ -0,0 +1,99 @@
package com.ruoyi.project.benyi.controller;
import java.util.List;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.benyi.domain.ByCustomer;
import com.ruoyi.project.benyi.service.IByCustomerService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 本一-客户关系管理Controller
*
* @author tsbz
* @date 2021-03-01
*/
@RestController
@RequestMapping("/benyi/customer")
public class ByCustomerController extends BaseController {
@Autowired
private IByCustomerService byCustomerService;
/**
* 查询本一-客户关系管理列表
*/
@PreAuthorize("@ss.hasPermi('benyi:customer:list')")
@GetMapping("/list")
public TableDataInfo list(ByCustomer byCustomer) {
startPage();
List<ByCustomer> list = byCustomerService.selectByCustomerList(byCustomer);
return getDataTable(list);
}
/**
* 导出本一-客户关系管理列表
*/
@PreAuthorize("@ss.hasPermi('benyi:customer:export')")
@Log(title = "本一-客户关系管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ByCustomer byCustomer) {
List<ByCustomer> list = byCustomerService.selectByCustomerList(byCustomer);
ExcelUtil<ByCustomer> util = new ExcelUtil<ByCustomer>(ByCustomer.class);
return util.exportExcel(list, "customer");
}
/**
* 获取本一-客户关系管理详细信息
*/
@PreAuthorize("@ss.hasPermi('benyi:customer:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(byCustomerService.selectByCustomerById(id));
}
/**
* 新增本一-客户关系管理
*/
@PreAuthorize("@ss.hasPermi('benyi:customer:add')")
@Log(title = "本一-客户关系管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ByCustomer byCustomer) {
byCustomer.setCreateUserid(SecurityUtils.getLoginUser().getUser().getUserId());
return toAjax(byCustomerService.insertByCustomer(byCustomer));
}
/**
* 修改本一-客户关系管理
*/
@PreAuthorize("@ss.hasPermi('benyi:customer:edit')")
@Log(title = "本一-客户关系管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ByCustomer byCustomer) {
return toAjax(byCustomerService.updateByCustomer(byCustomer));
}
/**
* 删除本一-客户关系管理
*/
@PreAuthorize("@ss.hasPermi('benyi:customer:remove')")
@Log(title = "本一-客户关系管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(byCustomerService.deleteByCustomerByIds(ids));
}
}

View File

@ -0,0 +1,322 @@
package com.ruoyi.project.benyi.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
/**
* 本一-客户关系管理对象 by_customer
*
* @author tsbz
* @date 2021-03-01
*/
public class ByCustomer extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 编号
*/
private Long id;
/**
* 姓名
*/
@Excel(name = "姓名")
private String name;
/**
* 身份
*/
@Excel(name = "身份")
private String sflx;
/**
* 联系电话
*/
@Excel(name = "联系电话")
private String lxdh;
/**
* 微信
*/
@Excel(name = "微信")
private String wx;
/**
* 抖音
*/
@Excel(name = "抖音")
private String dy;
/**
* 其他
*/
@Excel(name = "其他")
private String qt;
/**
* 幼儿园名称
*/
@Excel(name = "幼儿园名称")
private String schoolname;
/**
* 幼儿园人数
*/
@Excel(name = "幼儿园人数")
private Long rs;
/**
* 所在省
*/
@Excel(name = "所在省")
private String sheng;
/**
* 所在省编号
*/
@Excel(name = "所在省编号")
private String shengid;
/**
* 所在市
*/
@Excel(name = "所在市")
private String shi;
/**
* 所在市编号
*/
@Excel(name = "所在市编号")
private String shiid;
/**
* 客户来源
*/
@Excel(name = "客户来源")
private String khly;
/**
* 创建人
*/
@Excel(name = "创建人")
private Long createUserid;
/**
* 备注
*/
@Excel(name = "备注")
private String bz;
/**
* 转换跟进
*/
@Excel(name = "转换跟进")
private String zhgj;
/**
* 状态
*/
@Excel(name = "状态")
private String state;
/**
* 消费项目
*/
@Excel(name = "消费项目")
private String xfxm;
/**
* 消费价值
*/
@Excel(name = "消费价值")
private String xfjz;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setSflx(String sflx) {
this.sflx = sflx;
}
public String getSflx() {
return sflx;
}
public void setLxdh(String lxdh) {
this.lxdh = lxdh;
}
public String getLxdh() {
return lxdh;
}
public void setWx(String wx) {
this.wx = wx;
}
public String getWx() {
return wx;
}
public void setDy(String dy) {
this.dy = dy;
}
public String getDy() {
return dy;
}
public void setQt(String qt) {
this.qt = qt;
}
public String getQt() {
return qt;
}
public void setSchoolname(String schoolname) {
this.schoolname = schoolname;
}
public String getSchoolname() {
return schoolname;
}
public void setRs(Long rs) {
this.rs = rs;
}
public Long getRs() {
return rs;
}
public void setSheng(String sheng) {
this.sheng = sheng;
}
public String getSheng() {
return sheng;
}
public void setShengid(String shengid) {
this.shengid = shengid;
}
public String getShengid() {
return shengid;
}
public void setShi(String shi) {
this.shi = shi;
}
public String getShi() {
return shi;
}
public void setShiid(String shiid) {
this.shiid = shiid;
}
public String getShiid() {
return shiid;
}
public void setKhly(String khly) {
this.khly = khly;
}
public String getKhly() {
return khly;
}
public void setCreateUserid(Long createUserid) {
this.createUserid = createUserid;
}
public Long getCreateUserid() {
return createUserid;
}
public void setBz(String bz) {
this.bz = bz;
}
public String getBz() {
return bz;
}
public void setZhgj(String zhgj) {
this.zhgj = zhgj;
}
public String getZhgj() {
return zhgj;
}
public void setState(String state) {
this.state = state;
}
public String getState() {
return state;
}
public void setXfxm(String xfxm) {
this.xfxm = xfxm;
}
public String getXfxm() {
return xfxm;
}
public void setXfjz(String xfjz) {
this.xfjz = xfjz;
}
public String getXfjz() {
return xfjz;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("sflx", getSflx())
.append("lxdh", getLxdh())
.append("wx", getWx())
.append("dy", getDy())
.append("qt", getQt())
.append("schoolname", getSchoolname())
.append("rs", getRs())
.append("sheng", getSheng())
.append("shengid", getShengid())
.append("shi", getShi())
.append("shiid", getShiid())
.append("khly", getKhly())
.append("createUserid", getCreateUserid())
.append("bz", getBz())
.append("zhgj", getZhgj())
.append("state", getState())
.append("xfxm", getXfxm())
.append("xfjz", getXfjz())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.mapper;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByCustomer;
/**
* 本一-客户关系管理Mapper接口
*
* @author tsbz
* @date 2021-03-01
*/
public interface ByCustomerMapper {
/**
* 查询本一-客户关系管理
*
* @param id 本一-客户关系管理ID
* @return 本一-客户关系管理
*/
public ByCustomer selectByCustomerById(Long id);
/**
* 查询本一-客户关系管理列表
*
* @param byCustomer 本一-客户关系管理
* @return 本一-客户关系管理集合
*/
public List<ByCustomer> selectByCustomerList(ByCustomer byCustomer);
/**
* 新增本一-客户关系管理
*
* @param byCustomer 本一-客户关系管理
* @return 结果
*/
public int insertByCustomer(ByCustomer byCustomer);
/**
* 修改本一-客户关系管理
*
* @param byCustomer 本一-客户关系管理
* @return 结果
*/
public int updateByCustomer(ByCustomer byCustomer);
/**
* 删除本一-客户关系管理
*
* @param id 本一-客户关系管理ID
* @return 结果
*/
public int deleteByCustomerById(Long id);
/**
* 批量删除本一-客户关系管理
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteByCustomerByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.service;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByCustomer;
/**
* 本一-客户关系管理Service接口
*
* @author tsbz
* @date 2021-03-01
*/
public interface IByCustomerService {
/**
* 查询本一-客户关系管理
*
* @param id 本一-客户关系管理ID
* @return 本一-客户关系管理
*/
public ByCustomer selectByCustomerById(Long id);
/**
* 查询本一-客户关系管理列表
*
* @param byCustomer 本一-客户关系管理
* @return 本一-客户关系管理集合
*/
public List<ByCustomer> selectByCustomerList(ByCustomer byCustomer);
/**
* 新增本一-客户关系管理
*
* @param byCustomer 本一-客户关系管理
* @return 结果
*/
public int insertByCustomer(ByCustomer byCustomer);
/**
* 修改本一-客户关系管理
*
* @param byCustomer 本一-客户关系管理
* @return 结果
*/
public int updateByCustomer(ByCustomer byCustomer);
/**
* 批量删除本一-客户关系管理
*
* @param ids 需要删除的本一-客户关系管理ID
* @return 结果
*/
public int deleteByCustomerByIds(Long[] ids);
/**
* 删除本一-客户关系管理信息
*
* @param id 本一-客户关系管理ID
* @return 结果
*/
public int deleteByCustomerById(Long id);
}

View File

@ -0,0 +1,89 @@
package com.ruoyi.project.benyi.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.project.benyi.mapper.ByCustomerMapper;
import com.ruoyi.project.benyi.domain.ByCustomer;
import com.ruoyi.project.benyi.service.IByCustomerService;
/**
* 本一-客户关系管理Service业务层处理
*
* @author tsbz
* @date 2021-03-01
*/
@Service
public class ByCustomerServiceImpl implements IByCustomerService {
@Autowired
private ByCustomerMapper byCustomerMapper;
/**
* 查询本一-客户关系管理
*
* @param id 本一-客户关系管理ID
* @return 本一-客户关系管理
*/
@Override
public ByCustomer selectByCustomerById(Long id) {
return byCustomerMapper.selectByCustomerById(id);
}
/**
* 查询本一-客户关系管理列表
*
* @param byCustomer 本一-客户关系管理
* @return 本一-客户关系管理
*/
@Override
public List<ByCustomer> selectByCustomerList(ByCustomer byCustomer) {
return byCustomerMapper.selectByCustomerList(byCustomer);
}
/**
* 新增本一-客户关系管理
*
* @param byCustomer 本一-客户关系管理
* @return 结果
*/
@Override
public int insertByCustomer(ByCustomer byCustomer) {
byCustomer.setCreateTime(DateUtils.getNowDate());
return byCustomerMapper.insertByCustomer(byCustomer);
}
/**
* 修改本一-客户关系管理
*
* @param byCustomer 本一-客户关系管理
* @return 结果
*/
@Override
public int updateByCustomer(ByCustomer byCustomer) {
return byCustomerMapper.updateByCustomer(byCustomer);
}
/**
* 批量删除本一-客户关系管理
*
* @param ids 需要删除的本一-客户关系管理ID
* @return 结果
*/
@Override
public int deleteByCustomerByIds(Long[] ids) {
return byCustomerMapper.deleteByCustomerByIds(ids);
}
/**
* 删除本一-客户关系管理信息
*
* @param id 本一-客户关系管理ID
* @return 结果
*/
@Override
public int deleteByCustomerById(Long id) {
return byCustomerMapper.deleteByCustomerById(id);
}
}

View File

@ -0,0 +1,153 @@
<?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.project.benyi.mapper.ByCustomerMapper">
<resultMap type="ByCustomer" id="ByCustomerResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="sflx" column="sflx"/>
<result property="lxdh" column="lxdh"/>
<result property="wx" column="wx"/>
<result property="dy" column="dy"/>
<result property="qt" column="qt"/>
<result property="schoolname" column="schoolname"/>
<result property="rs" column="rs"/>
<result property="sheng" column="sheng"/>
<result property="shengid" column="shengid"/>
<result property="shi" column="shi"/>
<result property="shiid" column="shiid"/>
<result property="khly" column="khly"/>
<result property="createUserid" column="create_userid"/>
<result property="bz" column="bz"/>
<result property="zhgj" column="zhgj"/>
<result property="state" column="state"/>
<result property="xfxm" column="xfxm"/>
<result property="xfjz" column="xfjz"/>
<result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectByCustomerVo">
select id, name, sflx, lxdh, wx, dy, qt, schoolname, rs, sheng, shengid, shi, shiid, khly, create_userid, bz, zhgj, state, xfxm, xfjz, create_time from by_customer
</sql>
<select id="selectByCustomerList" parameterType="ByCustomer" resultMap="ByCustomerResult">
<include refid="selectByCustomerVo"/>
<where>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="sflx != null and sflx != ''">and sflx = #{sflx}</if>
<if test="lxdh != null and lxdh != ''">and lxdh = #{lxdh}</if>
<if test="wx != null and wx != ''">and wx = #{wx}</if>
<if test="dy != null and dy != ''">and dy = #{dy}</if>
<if test="qt != null and qt != ''">and qt = #{qt}</if>
<if test="schoolname != null and schoolname != ''">and schoolname like concat('%', #{schoolname}, '%')</if>
<if test="rs != null ">and rs = #{rs}</if>
<if test="sheng != null and sheng != ''">and sheng = #{sheng}</if>
<if test="shengid != null and shengid != ''">and shengid = #{shengid}</if>
<if test="shi != null and shi != ''">and shi = #{shi}</if>
<if test="shiid != null and shiid != ''">and shiid = #{shiid}</if>
<if test="khly != null and khly != ''">and khly = #{khly}</if>
<if test="createUserid != null ">and create_userid = #{createUserid}</if>
<if test="bz != null and bz != ''">and bz = #{bz}</if>
<if test="zhgj != null and zhgj != ''">and zhgj = #{zhgj}</if>
<if test="state != null and state != ''">and state = #{state}</if>
<if test="xfxm != null and xfxm != ''">and xfxm = #{xfxm}</if>
<if test="xfjz != null and xfjz != ''">and xfjz = #{xfjz}</if>
</where>
</select>
<select id="selectByCustomerById" parameterType="Long" resultMap="ByCustomerResult">
<include refid="selectByCustomerVo"/>
where id = #{id}
</select>
<insert id="insertByCustomer" parameterType="ByCustomer">
insert into by_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null ">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="sflx != null and sflx != ''">sflx,</if>
<if test="lxdh != null and lxdh != ''">lxdh,</if>
<if test="wx != null and wx != ''">wx,</if>
<if test="dy != null and dy != ''">dy,</if>
<if test="qt != null and qt != ''">qt,</if>
<if test="schoolname != null and schoolname != ''">schoolname,</if>
<if test="rs != null ">rs,</if>
<if test="sheng != null and sheng != ''">sheng,</if>
<if test="shengid != null and shengid != ''">shengid,</if>
<if test="shi != null and shi != ''">shi,</if>
<if test="shiid != null and shiid != ''">shiid,</if>
<if test="khly != null and khly != ''">khly,</if>
<if test="createUserid != null ">create_userid,</if>
<if test="bz != null and bz != ''">bz,</if>
<if test="zhgj != null and zhgj != ''">zhgj,</if>
<if test="state != null and state != ''">state,</if>
<if test="xfxm != null and xfxm != ''">xfxm,</if>
<if test="xfjz != null and xfjz != ''">xfjz,</if>
<if test="createTime != null ">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null ">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="sflx != null and sflx != ''">#{sflx},</if>
<if test="lxdh != null and lxdh != ''">#{lxdh},</if>
<if test="wx != null and wx != ''">#{wx},</if>
<if test="dy != null and dy != ''">#{dy},</if>
<if test="qt != null and qt != ''">#{qt},</if>
<if test="schoolname != null and schoolname != ''">#{schoolname},</if>
<if test="rs != null ">#{rs},</if>
<if test="sheng != null and sheng != ''">#{sheng},</if>
<if test="shengid != null and shengid != ''">#{shengid},</if>
<if test="shi != null and shi != ''">#{shi},</if>
<if test="shiid != null and shiid != ''">#{shiid},</if>
<if test="khly != null and khly != ''">#{khly},</if>
<if test="createUserid != null ">#{createUserid},</if>
<if test="bz != null and bz != ''">#{bz},</if>
<if test="zhgj != null and zhgj != ''">#{zhgj},</if>
<if test="state != null and state != ''">#{state},</if>
<if test="xfxm != null and xfxm != ''">#{xfxm},</if>
<if test="xfjz != null and xfjz != ''">#{xfjz},</if>
<if test="createTime != null ">#{createTime},</if>
</trim>
</insert>
<update id="updateByCustomer" parameterType="ByCustomer">
update by_customer
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="sflx != null and sflx != ''">sflx = #{sflx},</if>
<if test="lxdh != null and lxdh != ''">lxdh = #{lxdh},</if>
<if test="wx != null and wx != ''">wx = #{wx},</if>
<if test="dy != null and dy != ''">dy = #{dy},</if>
<if test="qt != null and qt != ''">qt = #{qt},</if>
<if test="schoolname != null and schoolname != ''">schoolname = #{schoolname},</if>
<if test="rs != null ">rs = #{rs},</if>
<if test="sheng != null and sheng != ''">sheng = #{sheng},</if>
<if test="shengid != null and shengid != ''">shengid = #{shengid},</if>
<if test="shi != null and shi != ''">shi = #{shi},</if>
<if test="shiid != null and shiid != ''">shiid = #{shiid},</if>
<if test="khly != null and khly != ''">khly = #{khly},</if>
<if test="createUserid != null ">create_userid = #{createUserid},</if>
<if test="bz != null and bz != ''">bz = #{bz},</if>
<if test="zhgj != null and zhgj != ''">zhgj = #{zhgj},</if>
<if test="state != null and state != ''">state = #{state},</if>
<if test="xfxm != null and xfxm != ''">xfxm = #{xfxm},</if>
<if test="xfjz != null and xfjz != ''">xfjz = #{xfjz},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteByCustomerById" parameterType="Long">
delete from by_customer where id = #{id}
</delete>
<delete id="deleteByCustomerByIds" parameterType="String">
delete from by_customer where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>