feat(sip): 添加客户信息管理功能
- 新增客户信息实体类、Mapper、Service、Controller- 实现客户信息的添加、编辑、删除、查询和导出功能 - 添加相关HTML模板文件master
parent
ee2cc9902f
commit
8bbd8b3a65
|
@ -0,0 +1,166 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('新增客户信息')" />
|
||||||
|
<th:block th:include="include :: datetimepicker-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-info-add">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label is-required">客户编码:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="customerCode" class="form-control" type="text" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">客户名称:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="customerName" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">客户邮编:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="customerPostcode" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">所在省:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="province" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">所在市:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="city" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">详细地址:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="address" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">联系人:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="contactPerson" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">联系电话:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="contactPhone" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">联系邮件:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="contactEmail" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">所属行业:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="industryTyoe" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">备注:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<textarea name="remark" class="form-control"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label is-required">创建时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="input-group date">
|
||||||
|
<input name="createAt" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">更新时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="input-group date">
|
||||||
|
<input name="updateAt" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">删除时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="input-group date">
|
||||||
|
<input name="deleteAt" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: datetimepicker-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "system/customer"
|
||||||
|
$("#form-info-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/add", $('#form-info-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("input[name='createAt']").datetimepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
minView: "month",
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
|
||||||
|
$("input[name='updateAt']").datetimepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
minView: "month",
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
|
||||||
|
$("input[name='deleteAt']").datetimepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
minView: "month",
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,167 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('修改客户信息')" />
|
||||||
|
<th:block th:include="include :: datetimepicker-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-info-edit" th:object="${customerInfo}">
|
||||||
|
<input name="id" th:field="*{id}" type="hidden">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label is-required">客户编码:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="customerCode" th:field="*{customerCode}" class="form-control" type="text" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">客户名称:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="customerName" th:field="*{customerName}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">客户邮编:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="customerPostcode" th:field="*{customerPostcode}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">所在省:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="province" th:field="*{province}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">所在市:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="city" th:field="*{city}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">详细地址:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="address" th:field="*{address}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">联系人:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="contactPerson" th:field="*{contactPerson}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">联系电话:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="contactPhone" th:field="*{contactPhone}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">联系邮件:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="contactEmail" th:field="*{contactEmail}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">所属行业:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="industryTyoe" th:field="*{industryTyoe}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">备注:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label is-required">创建时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="input-group date">
|
||||||
|
<input name="createAt" th:value="${#dates.format(customerInfo.createAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">更新时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="input-group date">
|
||||||
|
<input name="updateAt" th:value="${#dates.format(customerInfo.updateAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">删除时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="input-group date">
|
||||||
|
<input name="deleteAt" th:value="${#dates.format(customerInfo.deleteAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: datetimepicker-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "system/customer";
|
||||||
|
$("#form-info-edit").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-info-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("input[name='createAt']").datetimepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
minView: "month",
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
|
||||||
|
$("input[name='updateAt']").datetimepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
minView: "month",
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
|
||||||
|
$("input[name='deleteAt']").datetimepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
minView: "month",
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,190 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('客户信息列表')" />
|
||||||
|
</head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="container-div">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 search-collapse">
|
||||||
|
<form id="formId">
|
||||||
|
<div class="select-list">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label>客户编码:</label>
|
||||||
|
<input type="text" name="customerCode"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>客户名称:</label>
|
||||||
|
<input type="text" name="customerName"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>客户邮编:</label>
|
||||||
|
<input type="text" name="customerPostcode"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>所在省:</label>
|
||||||
|
<input type="text" name="province"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>所在市:</label>
|
||||||
|
<input type="text" name="city"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>详细地址:</label>
|
||||||
|
<input type="text" name="address"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>联系人:</label>
|
||||||
|
<input type="text" name="contactPerson"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>联系电话:</label>
|
||||||
|
<input type="text" name="contactPhone"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>联系邮件:</label>
|
||||||
|
<input type="text" name="contactEmail"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>所属行业:</label>
|
||||||
|
<input type="text" name="industryTyoe"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>创建时间:</label>
|
||||||
|
<input type="text" class="time-input" placeholder="请选择创建时间" name="createAt"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>更新时间:</label>
|
||||||
|
<input type="text" class="time-input" placeholder="请选择更新时间" name="updateAt"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>删除时间:</label>
|
||||||
|
<input type="text" class="time-input" placeholder="请选择删除时间" name="deleteAt"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:info:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:info:edit">
|
||||||
|
<i class="fa fa-edit"></i> 修改
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:info:remove">
|
||||||
|
<i class="fa fa-remove"></i> 删除
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:info:export">
|
||||||
|
<i class="fa fa-download"></i> 导出
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
<table id="bootstrap-table"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var editFlag = [[${@permission.hasPermi('system:info:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('system:info:remove')}]];
|
||||||
|
var prefix = ctx + "system/customer";
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var options = {
|
||||||
|
url: prefix + "/list",
|
||||||
|
createUrl: prefix + "/add",
|
||||||
|
updateUrl: prefix + "/edit/{id}",
|
||||||
|
removeUrl: prefix + "/remove",
|
||||||
|
exportUrl: prefix + "/export",
|
||||||
|
modalName: "客户信息",
|
||||||
|
columns: [{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '${comment}',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'customerCode',
|
||||||
|
title: '客户编码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'customerName',
|
||||||
|
title: '客户名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'customerPostcode',
|
||||||
|
title: '客户邮编'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'province',
|
||||||
|
title: '所在省'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'city',
|
||||||
|
title: '所在市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'address',
|
||||||
|
title: '详细地址'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'contactPerson',
|
||||||
|
title: '联系人'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'contactPhone',
|
||||||
|
title: '联系电话'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'contactEmail',
|
||||||
|
title: '联系邮件'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'industryTyoe',
|
||||||
|
title: '所属行业'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'remark',
|
||||||
|
title: '备注'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'createAt',
|
||||||
|
title: '创建时间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'updateAt',
|
||||||
|
title: '更新时间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'deleteAt',
|
||||||
|
title: '删除时间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: '数据状态'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||||
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.table.init(options);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,130 @@
|
||||||
|
package com.ruoyi.sip.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.sip.domain.CustomerInfo;
|
||||||
|
import com.ruoyi.sip.service.ICustomerInfoService;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户信息Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-05-14
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/system/customer")
|
||||||
|
public class CustomerInfoController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "system/customer";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ICustomerInfoService customerInfoService;
|
||||||
|
|
||||||
|
@RequiresPermissions("system:customer:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String info()
|
||||||
|
{
|
||||||
|
return prefix + "/info";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户信息列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customer:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(CustomerInfo customerInfo)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<CustomerInfo> list = customerInfoService.selectCustomerInfoList(customerInfo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出客户信息列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customer:export")
|
||||||
|
@Log(title = "客户信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(CustomerInfo customerInfo)
|
||||||
|
{
|
||||||
|
List<CustomerInfo> list = customerInfoService.selectCustomerInfoList(customerInfo);
|
||||||
|
ExcelUtil<CustomerInfo> util = new ExcelUtil<CustomerInfo>(CustomerInfo.class);
|
||||||
|
return util.exportExcel(list, "客户信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customer:add")
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存客户信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customer:add")
|
||||||
|
@Log(title = "客户信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(CustomerInfo customerInfo)
|
||||||
|
{
|
||||||
|
return toAjax(customerInfoService.insertCustomerInfo(customerInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customer:edit")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||||
|
{
|
||||||
|
CustomerInfo customerInfo = customerInfoService.selectCustomerInfoById(id);
|
||||||
|
mmap.put("customerInfo", customerInfo);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存客户信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customer:edit")
|
||||||
|
@Log(title = "客户信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(CustomerInfo customerInfo)
|
||||||
|
{
|
||||||
|
return toAjax(customerInfoService.updateCustomerInfo(customerInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customer:remove")
|
||||||
|
@Log(title = "客户信息", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(customerInfoService.deleteCustomerInfoByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.ruoyi.sip.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户信息对象 customer_info
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-05-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class CustomerInfo extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 客户编码 */
|
||||||
|
@Excel(name = "客户编码")
|
||||||
|
private String customerCode;
|
||||||
|
|
||||||
|
/** 客户名称 */
|
||||||
|
@Excel(name = "客户名称")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
/** 客户邮编 */
|
||||||
|
@Excel(name = "客户邮编")
|
||||||
|
private String customerPostcode;
|
||||||
|
|
||||||
|
/** 所在省 */
|
||||||
|
@Excel(name = "所在省")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
/** 所在市 */
|
||||||
|
@Excel(name = "所在市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/** 详细地址 */
|
||||||
|
@Excel(name = "详细地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/** 联系人 */
|
||||||
|
@Excel(name = "联系人")
|
||||||
|
private String contactPerson;
|
||||||
|
|
||||||
|
/** 联系电话 */
|
||||||
|
@Excel(name = "联系电话")
|
||||||
|
private String contactPhone;
|
||||||
|
|
||||||
|
/** 联系邮件 */
|
||||||
|
@Excel(name = "联系邮件")
|
||||||
|
private String contactEmail;
|
||||||
|
|
||||||
|
/** 所属行业 */
|
||||||
|
@Excel(name = "所属行业")
|
||||||
|
private String industryTyoe;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date createAt;
|
||||||
|
|
||||||
|
/** 更新时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date updateAt;
|
||||||
|
|
||||||
|
/** 删除时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date deleteAt;
|
||||||
|
|
||||||
|
/** 数据状态 */
|
||||||
|
@Excel(name = "数据状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.ruoyi.sip.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.sip.domain.CustomerInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-05-14
|
||||||
|
*/
|
||||||
|
public interface CustomerInfoMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询客户信息
|
||||||
|
*
|
||||||
|
* @param id 客户信息主键
|
||||||
|
* @return 客户信息
|
||||||
|
*/
|
||||||
|
public CustomerInfo selectCustomerInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户信息列表
|
||||||
|
*
|
||||||
|
* @param customerInfo 客户信息
|
||||||
|
* @return 客户信息集合
|
||||||
|
*/
|
||||||
|
public List<CustomerInfo> selectCustomerInfoList(CustomerInfo customerInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户信息
|
||||||
|
*
|
||||||
|
* @param customerInfo 客户信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertCustomerInfo(CustomerInfo customerInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户信息
|
||||||
|
*
|
||||||
|
* @param customerInfo 客户信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateCustomerInfo(CustomerInfo customerInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户信息
|
||||||
|
*
|
||||||
|
* @param id 客户信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCustomerInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCustomerInfoByIds(String[] ids);
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.ruoyi.sip.service;
|
||||||
|
|
||||||
|
import com.ruoyi.sip.domain.CustomerInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户信息Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-05-14
|
||||||
|
*/
|
||||||
|
public interface ICustomerInfoService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询客户信息
|
||||||
|
*
|
||||||
|
* @param id 客户信息主键
|
||||||
|
* @return 客户信息
|
||||||
|
*/
|
||||||
|
public CustomerInfo selectCustomerInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户信息列表
|
||||||
|
*
|
||||||
|
* @param customerInfo 客户信息
|
||||||
|
* @return 客户信息集合
|
||||||
|
*/
|
||||||
|
public List<CustomerInfo> selectCustomerInfoList(CustomerInfo customerInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户信息
|
||||||
|
*
|
||||||
|
* @param customerInfo 客户信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertCustomerInfo(CustomerInfo customerInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户信息
|
||||||
|
*
|
||||||
|
* @param customerInfo 客户信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateCustomerInfo(CustomerInfo customerInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的客户信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCustomerInfoByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户信息信息
|
||||||
|
*
|
||||||
|
* @param id 客户信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCustomerInfoById(Long id);
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
package com.ruoyi.sip.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.sip.domain.CustomerInfo;
|
||||||
|
import com.ruoyi.sip.mapper.CustomerInfoMapper;
|
||||||
|
import com.ruoyi.sip.service.ICustomerInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-05-14
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CustomerInfoServiceImpl implements ICustomerInfoService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private CustomerInfoMapper customerInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户信息
|
||||||
|
*
|
||||||
|
* @param id 客户信息主键
|
||||||
|
* @return 客户信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CustomerInfo selectCustomerInfoById(Long id)
|
||||||
|
{
|
||||||
|
return customerInfoMapper.selectCustomerInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户信息列表
|
||||||
|
*
|
||||||
|
* @param customerInfo 客户信息
|
||||||
|
* @return 客户信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<CustomerInfo> selectCustomerInfoList(CustomerInfo customerInfo)
|
||||||
|
{
|
||||||
|
return customerInfoMapper.selectCustomerInfoList(customerInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户信息
|
||||||
|
*
|
||||||
|
* @param customerInfo 客户信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertCustomerInfo(CustomerInfo customerInfo)
|
||||||
|
{
|
||||||
|
return customerInfoMapper.insertCustomerInfo(customerInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户信息
|
||||||
|
*
|
||||||
|
* @param customerInfo 客户信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateCustomerInfo(CustomerInfo customerInfo)
|
||||||
|
{
|
||||||
|
return customerInfoMapper.updateCustomerInfo(customerInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的客户信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteCustomerInfoByIds(String ids)
|
||||||
|
{
|
||||||
|
return customerInfoMapper.deleteCustomerInfoByIds(Convert.toStrArray(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户信息信息
|
||||||
|
*
|
||||||
|
* @param id 客户信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteCustomerInfoById(Long id)
|
||||||
|
{
|
||||||
|
return customerInfoMapper.deleteCustomerInfoById(id);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,128 @@
|
||||||
|
<?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.sip.mapper.CustomerInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="CustomerInfo" id="CustomerInfoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="customerCode" column="customer_code" />
|
||||||
|
<result property="customerName" column="customer_name" />
|
||||||
|
<result property="customerPostcode" column="customer_postcode" />
|
||||||
|
<result property="province" column="province" />
|
||||||
|
<result property="city" column="city" />
|
||||||
|
<result property="address" column="address" />
|
||||||
|
<result property="contactPerson" column="contact_person" />
|
||||||
|
<result property="contactPhone" column="contact_phone" />
|
||||||
|
<result property="contactEmail" column="contact_email" />
|
||||||
|
<result property="industryTyoe" column="Industry_tyoe" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="createAt" column="create_at" />
|
||||||
|
<result property="updateAt" column="update_at" />
|
||||||
|
<result property="deleteAt" column="delete_at" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectCustomerInfoVo">
|
||||||
|
select id, customer_code, customer_name, customer_postcode, province, city, address, contact_person, contact_phone, contact_email, Industry_tyoe, remark, create_at, update_at, delete_at, status from customer_info
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectCustomerInfoList" parameterType="CustomerInfo" resultMap="CustomerInfoResult">
|
||||||
|
<include refid="selectCustomerInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="customerCode != null and customerCode != ''"> and customer_code = #{customerCode}</if>
|
||||||
|
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
||||||
|
<if test="customerPostcode != null and customerPostcode != ''"> and customer_postcode = #{customerPostcode}</if>
|
||||||
|
<if test="province != null and province != ''"> and province = #{province}</if>
|
||||||
|
<if test="city != null and city != ''"> and city = #{city}</if>
|
||||||
|
<if test="address != null and address != ''"> and address = #{address}</if>
|
||||||
|
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
|
||||||
|
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
|
||||||
|
<if test="contactEmail != null and contactEmail != ''"> and contact_email = #{contactEmail}</if>
|
||||||
|
<if test="industryTyoe != null and industryTyoe != ''"> and Industry_tyoe = #{industryTyoe}</if>
|
||||||
|
<if test="createAt != null "> and create_at = #{createAt}</if>
|
||||||
|
<if test="updateAt != null "> and update_at = #{updateAt}</if>
|
||||||
|
<if test="deleteAt != null "> and delete_at = #{deleteAt}</if>
|
||||||
|
<if test="status != null "> and status = #{status}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCustomerInfoById" parameterType="Long" resultMap="CustomerInfoResult">
|
||||||
|
<include refid="selectCustomerInfoVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertCustomerInfo" parameterType="CustomerInfo">
|
||||||
|
insert into customer_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="customerCode != null and customerCode != ''">customer_code,</if>
|
||||||
|
<if test="customerName != null">customer_name,</if>
|
||||||
|
<if test="customerPostcode != null">customer_postcode,</if>
|
||||||
|
<if test="province != null">province,</if>
|
||||||
|
<if test="city != null">city,</if>
|
||||||
|
<if test="address != null">address,</if>
|
||||||
|
<if test="contactPerson != null">contact_person,</if>
|
||||||
|
<if test="contactPhone != null">contact_phone,</if>
|
||||||
|
<if test="contactEmail != null">contact_email,</if>
|
||||||
|
<if test="industryTyoe != null">Industry_tyoe,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="createAt != null">create_at,</if>
|
||||||
|
<if test="updateAt != null">update_at,</if>
|
||||||
|
<if test="deleteAt != null">delete_at,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="customerCode != null and customerCode != ''">#{customerCode},</if>
|
||||||
|
<if test="customerName != null">#{customerName},</if>
|
||||||
|
<if test="customerPostcode != null">#{customerPostcode},</if>
|
||||||
|
<if test="province != null">#{province},</if>
|
||||||
|
<if test="city != null">#{city},</if>
|
||||||
|
<if test="address != null">#{address},</if>
|
||||||
|
<if test="contactPerson != null">#{contactPerson},</if>
|
||||||
|
<if test="contactPhone != null">#{contactPhone},</if>
|
||||||
|
<if test="contactEmail != null">#{contactEmail},</if>
|
||||||
|
<if test="industryTyoe != null">#{industryTyoe},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="createAt != null">#{createAt},</if>
|
||||||
|
<if test="updateAt != null">#{updateAt},</if>
|
||||||
|
<if test="deleteAt != null">#{deleteAt},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateCustomerInfo" parameterType="CustomerInfo">
|
||||||
|
update customer_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
|
||||||
|
<if test="customerName != null">customer_name = #{customerName},</if>
|
||||||
|
<if test="customerPostcode != null">customer_postcode = #{customerPostcode},</if>
|
||||||
|
<if test="province != null">province = #{province},</if>
|
||||||
|
<if test="city != null">city = #{city},</if>
|
||||||
|
<if test="address != null">address = #{address},</if>
|
||||||
|
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
|
||||||
|
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||||||
|
<if test="contactEmail != null">contact_email = #{contactEmail},</if>
|
||||||
|
<if test="industryTyoe != null">Industry_tyoe = #{industryTyoe},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="createAt != null">create_at = #{createAt},</if>
|
||||||
|
<if test="updateAt != null">update_at = #{updateAt},</if>
|
||||||
|
<if test="deleteAt != null">delete_at = #{deleteAt},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteCustomerInfoById" parameterType="Long">
|
||||||
|
delete from customer_info where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteCustomerInfoByIds" parameterType="String">
|
||||||
|
delete from customer_info where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue