合并代码

This commit is contained in:
sxu 2025-01-22 19:09:16 +08:00
parent b9cdaf658e
commit cd74fb2a82
7 changed files with 757 additions and 18 deletions

View File

@ -8,13 +8,13 @@
<version>24.12.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bonus-smart-canteen</artifactId>
<description>
bonus-modules-smart-canteen智慧食堂
</description>
<dependencies>
<!--加密依赖包-->
@ -32,56 +32,56 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Swagger UI -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.fox.version}</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- bonus Common DataSource -->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-common-datasource</artifactId>
</dependency>
<!-- bonus Common DataScope -->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-common-datascope</artifactId>
</dependency>
<!-- bonus Common Log -->
<dependency>
<groupId>com.bonus</groupId>
<artifactId>bonus-common-log</artifactId>
</dependency>
<!-- bonus Common Swagger -->
<dependency>
<groupId>com.bonus</groupId>
@ -117,6 +117,12 @@
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<!-- 支付宝支付-->
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.34.0.ALL</version>
</dependency>
</dependencies>
@ -126,6 +132,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.2</version>
<executions>
<execution>
<goals>
@ -136,5 +143,5 @@
</plugin>
</plugins>
</build>
</project>
</project>

View File

@ -0,0 +1,38 @@
# Tomcat
server:
port: 58689
# Spring
spring:
cloud:
nacos:
discovery:
# 服务注册地址测试地址
#server-addr: 127.0.0.1:8848
# 服务注册地址正式地址
server-addr: 127.0.0.1:18848
namespace: smart_canteen
username: nacos
password: jysoft@sbd1
config:
# 服务注册地址测试地址
#server-addr: 127.0.0.1:8848
# 服务注册地址正式地址
server-addr: 127.0.0.1:18848
namespace: smart_canteen
username: nacos
password: jysoft@sbd1
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
#加密组件
jasypt:
encryptor:
password: Encrypt
mybatis:
configuration:
map-underscore-to-camel-case: true

View File

@ -6,6 +6,7 @@ spring:
profiles:
# 环境配置
active: smart_canteen_local
# active: smart_canteen_dev
niu:
siteurl: https://dev06.xnzn.net
niupayurl: https://dev06.xnzn.net/tengyun-api/leopen/pay/device #测试地址食堂支付
@ -17,14 +18,24 @@ niu:
applicationidpsw: 082d5733fc44443e992071b2bc916620
sncode: 001
serialnum: 02022840
#
#niu:
# siteurl: http://10.138.55.106:58100
# niupayurl: http://10.138.55.106:58100/tengyun-api/leopen/pay/device #地址食堂支付
# niusearchuserurl: http://10.138.55.106:58100/tengyun-api/leopen/customer/query #地址查询用户
# niupayreturnurl: http://10.138.55.106:58100/tengyun-api/leopen/pay/refund #地址食堂支付退钱
# niuallocanteen: https://dev06.xnzn.net/tengyun-api/leopen/canteen/query #地址食堂列表
# niualloshopll: https://dev06.xnzn.net/tengyun-api/leopen/stall/query #档口
# niuallocanteen: http://10.138.55.106:58100/tengyun-api/leopen/canteen/query #地址食堂列表
# niualloshopll: http://10.138.55.106:58100/tengyun-api/leopen/stall/query #档口
# applicationid: 396571655104630784
# applicationidpsw: ee75c51b4a854c43ad9a85560f024068
# sncode: 2ad34554g2 #虚拟支付设备
# serialnum: 02022840
# serialnum: 02022840
alipay:
URL: https://openapi.alipay.com/gateway.do
PID: 2088041561080184
APPID: 2021002125609361
PRIVATE_KEY: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCpBulkHcSEQvo0GmPyYmyNOWjlCxTn/r/zrOLoXlLN44ZECgdn+Kn9E0EFjwenc/xz4H3V89KrwCA0kNX3m5Hs5qfbKIaycIQf7MvBQHPeUxQ+HeiBwg8b5vcaNy9RtS+wEuU21GF2ZU4QFpk9wYU/MWtvyt/vtj/HCL3/IGvVhcQcbumGlmBEYfoFZLez/7PfIY0SOZ7jdxCS/XGOwwBx2hMTCsMS05VPEaEwDYV5U2WN8FDDXCt6NvHPPR+BUoDON7xxaalHcN/mokpkyFmTXXAadjLVof9BJFPIYaJKmN/aRG7TWMvvZwEDKmcmeyLGiph9M4UEviiXJus/369TAgMBAAECggEAN1Bqune/YuUkSj7ErIKnMYQzHpmEyvMkUBMo4pBTmss1mjiJ+e13e7l8Utxezd74I9e4dnbnX4ttPqaTTwebNqK5FdBqXCTUKDpu55w3Du+zNSzGdQhTt3bbMLoUgzG/HGjimBHin0NBy6QJnBsjhu2eUiRbKnBC6NikjMRIZcRrAhFx65s6M6X7tRmWCybPDcWyp2Zz+nQZhCaku+qVdNz1+Jt1z3R7RZvcVNMXV0XKTu/TdMGfeGOzmyjwCEQG2iw/e7y7QkJHQDU0dKjeBCcZ9xAeGjY9m2gEK2nk1drPJ4TUEtREbZbS8lVkdjOGFQ0VMEY00KEb4JLRwam16QKBgQDlMyaqhiYAY8o1QxZ/4i2YxNHnP8Q0qQ4lyvTaVjZH3trINIXMjwtlezxwjXoMKvcgYfXFdJ9La88qsBOrqzkgePI5sX3AAGMACgUSfQmbLCfxQ4pzN2/bigWl5apFWWrfi7vmUlE+xUZmbv+HePLVslOS8RmCE79sHjwIEGQghQKBgQC8yo1xCdripF8aLMZVFDBabi3i8n6jJFzEJvY74HqoIegjSAUkmivSvw/VkGdg+bGoAinza/4zUAF7oCn/z+Q422ZQ6ldHetDioxxtumUU1Zt6ilwdpiQzMGj9B9+fHtpEaXZJjjcUQCKUMOBegcki4H4WkHcyqkLHk7TY8DPD9wKBgQDV0LwXhIHbBzzSJz3MG2HSDHqMsm4FelhaZVW6gYat0XZkIqtXQ3KsPyUJEtJym3pjWT9/7uXT5EUlW5FeKqNmaa3+qFfZUAMLPE2zC7Z0beLtLcbw6RyOv9m5A+GuRFZxKNgna0+jsUGVuaLj7K8NMAjLIeRb9rQy1pnGJBRkSQKBgFyr6OY1+jYKjYxhsjGNKXcaYnfmpPccIFVA8tnNhSgHDNZUwgGHlD9s/i7NJZHav7RC66jLuAokGbY/lp41xEeMmxrZDWLPDL5TZt8OAhRKDnoGdNUw+tAN0Vtzg/etw2KVijTtFGhiWxb3Lwv1FXCDViFpZLmADiu9e6aJsj9dAoGBAK2IuG617pbbFq6vl9lYyYxT5wBYWQ47uHu8vKTfKnZ6zkGecZssiLdSKMwmAB0oJOXPc9QcWe3MYAnFEBw2DygmluxDlE5hK36Nb2Tvs75MD7Bj0noQ4pCC12v1KF57zzhaU9PqkAM8VouLLWe7eOa6ScBZn+3P9Q0EijuPesn/
FORMAT: JSON
CHARSET: UTF-8
SIGN_TYPE: RSA2
ALIPAY_PUBLIC_KEY: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApnqCjevyilI4LcWsrUI7d6zSSc/+xqKO6U0Bmf3yCKRNPNubqHeOQ7Wd9+63lswObGNa6sHYkoZEmoO3WhIRu1ruV1gG3dqnuZ93PNHtoG22S6fPoSwJyB1i1N61dPHV7ikU5Ljq/VJhP05cYH+MiZOb5sx47Ub4KqKghVkyZu6mSlVWu/ojipd0H3kl88QXnF1W3QT1B9DSkODg94u4A28SrJHT+8nkPhOsD8cs5NmwmZJUieFiHh69hEgR+Af2xl1G+LNRWN4vTZ4sWcAnQp+

View File

@ -0,0 +1,264 @@
<?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.bonus.canteen.consumer.mapper.CustAddrMapper">
<resultMap type="com.bonus.canteen.consumer.model.CustAddr" id="CustAddrMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="custId" column="cust_id" jdbcType="INTEGER"/>
<result property="addrId" column="addr_id" jdbcType="INTEGER"/>
<result property="custName" column="cust_name" jdbcType="VARCHAR"/>
<result property="mobile" column="mobile" jdbcType="VARCHAR"/>
<result property="areaCode" column="area_code" jdbcType="VARCHAR"/>
<result property="detailAddr" column="detail_addr" jdbcType="VARCHAR"/>
<result property="addrFullName" column="addr_full_name" jdbcType="VARCHAR"/>
<result property="openid" column="openid" jdbcType="VARCHAR"/>
<result property="sourceType" column="source_type" jdbcType="INTEGER"/>
<result property="ifDefault" column="if_default" jdbcType="INTEGER"/>
<result property="ifDel" column="if_del" jdbcType="INTEGER"/>
<result property="revision" column="revision" jdbcType="INTEGER"/>
<result property="crby" column="crby" jdbcType="VARCHAR"/>
<result property="crtime" column="crtime" jdbcType="TIMESTAMP"/>
<result property="upby" column="upby" jdbcType="VARCHAR"/>
<result property="uptime" column="uptime" jdbcType="TIMESTAMP"/>
<result property="placeId" column="place_id" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="CustAddrMap">
select
id, cust_id, addr_id, cust_name, mobile, area_code, detail_addr, addr_full_name, openid, source_type, if_default, if_del, revision, crby, crtime, upby, uptime, place_id
from cust_addr
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="CustAddrMap">
select
id, cust_id, addr_id, cust_name, mobile, area_code, detail_addr, addr_full_name, openid, source_type, if_default, if_del, revision, crby, crtime, upby, uptime, place_id
from cust_addr
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="custId != null">
and cust_id = #{custId}
</if>
<if test="addrId != null">
and addr_id = #{addrId}
</if>
<if test="custName != null and custName != ''">
and cust_name = #{custName}
</if>
<if test="mobile != null and mobile != ''">
and mobile = #{mobile}
</if>
<if test="areaCode != null and areaCode != ''">
and area_code = #{areaCode}
</if>
<if test="detailAddr != null and detailAddr != ''">
and detail_addr = #{detailAddr}
</if>
<if test="addrFullName != null and addrFullName != ''">
and addr_full_name = #{addrFullName}
</if>
<if test="openid != null and openid != ''">
and openid = #{openid}
</if>
<if test="sourceType != null">
and source_type = #{sourceType}
</if>
<if test="ifDefault != null">
and if_default = #{ifDefault}
</if>
<if test="ifDel != null">
and if_del = #{ifDel}
</if>
<if test="revision != null">
and revision = #{revision}
</if>
<if test="crby != null and crby != ''">
and crby = #{crby}
</if>
<if test="crtime != null">
and crtime = #{crtime}
</if>
<if test="upby != null and upby != ''">
and upby = #{upby}
</if>
<if test="uptime != null">
and uptime = #{uptime}
</if>
<if test="placeId != null">
and place_id = #{placeId}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from cust_addr
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="custId != null">
and cust_id = #{custId}
</if>
<if test="addrId != null">
and addr_id = #{addrId}
</if>
<if test="custName != null and custName != ''">
and cust_name = #{custName}
</if>
<if test="mobile != null and mobile != ''">
and mobile = #{mobile}
</if>
<if test="areaCode != null and areaCode != ''">
and area_code = #{areaCode}
</if>
<if test="detailAddr != null and detailAddr != ''">
and detail_addr = #{detailAddr}
</if>
<if test="addrFullName != null and addrFullName != ''">
and addr_full_name = #{addrFullName}
</if>
<if test="openid != null and openid != ''">
and openid = #{openid}
</if>
<if test="sourceType != null">
and source_type = #{sourceType}
</if>
<if test="ifDefault != null">
and if_default = #{ifDefault}
</if>
<if test="ifDel != null">
and if_del = #{ifDel}
</if>
<if test="revision != null">
and revision = #{revision}
</if>
<if test="crby != null and crby != ''">
and crby = #{crby}
</if>
<if test="crtime != null">
and crtime = #{crtime}
</if>
<if test="upby != null and upby != ''">
and upby = #{upby}
</if>
<if test="uptime != null">
and uptime = #{uptime}
</if>
<if test="placeId != null">
and place_id = #{placeId}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into cust_addr(cust_id, addr_id, cust_name, mobile, area_code, detail_addr, addr_full_name, openid, source_type, if_default, if_del, revision, crby, crtime, upby, uptime, place_id)
values (#{custId}, #{addrId}, #{custName}, #{mobile}, #{areaCode}, #{detailAddr}, #{addrFullName}, #{openid}, #{sourceType}, #{ifDefault}, #{ifDel}, #{revision}, #{crby}, #{crtime}, #{upby}, #{uptime}, #{placeId})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into cust_addr(cust_id, addr_id, cust_name, mobile, area_code, detail_addr, addr_full_name, openid, source_type, if_default, if_del, revision, crby, crtime, upby, uptime, place_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.custId}, #{entity.addrId}, #{entity.custName}, #{entity.mobile}, #{entity.areaCode}, #{entity.detailAddr}, #{entity.addrFullName}, #{entity.openid}, #{entity.sourceType}, #{entity.ifDefault}, #{entity.ifDel}, #{entity.revision}, #{entity.crby}, #{entity.crtime}, #{entity.upby}, #{entity.uptime}, #{entity.placeId})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into cust_addr(cust_id, addr_id, cust_name, mobile, area_code, detail_addr, addr_full_name, openid, source_type, if_default, if_del, revision, crby, crtime, upby, uptime, place_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.custId}, #{entity.addrId}, #{entity.custName}, #{entity.mobile}, #{entity.areaCode}, #{entity.detailAddr}, #{entity.addrFullName}, #{entity.openid}, #{entity.sourceType}, #{entity.ifDefault}, #{entity.ifDel}, #{entity.revision}, #{entity.crby}, #{entity.crtime}, #{entity.upby}, #{entity.uptime}, #{entity.placeId})
</foreach>
on duplicate key update
cust_id = values(cust_id),
addr_id = values(addr_id),
cust_name = values(cust_name),
mobile = values(mobile),
area_code = values(area_code),
detail_addr = values(detail_addr),
addr_full_name = values(addr_full_name),
openid = values(openid),
source_type = values(source_type),
if_default = values(if_default),
if_del = values(if_del),
revision = values(revision),
crby = values(crby),
crtime = values(crtime),
upby = values(upby),
uptime = values(uptime),
place_id = values(place_id)
</insert>
<!--通过主键修改数据-->
<update id="update">
update cust_addr
<set>
<if test="custId != null">
cust_id = #{custId},
</if>
<if test="addrId != null">
addr_id = #{addrId},
</if>
<if test="custName != null and custName != ''">
cust_name = #{custName},
</if>
<if test="mobile != null and mobile != ''">
mobile = #{mobile},
</if>
<if test="areaCode != null and areaCode != ''">
area_code = #{areaCode},
</if>
<if test="detailAddr != null and detailAddr != ''">
detail_addr = #{detailAddr},
</if>
<if test="addrFullName != null and addrFullName != ''">
addr_full_name = #{addrFullName},
</if>
<if test="openid != null and openid != ''">
openid = #{openid},
</if>
<if test="sourceType != null">
source_type = #{sourceType},
</if>
<if test="ifDefault != null">
if_default = #{ifDefault},
</if>
<if test="ifDel != null">
if_del = #{ifDel},
</if>
<if test="revision != null">
revision = #{revision},
</if>
<if test="crby != null and crby != ''">
crby = #{crby},
</if>
<if test="crtime != null">
crtime = #{crtime},
</if>
<if test="upby != null and upby != ''">
upby = #{upby},
</if>
<if test="uptime != null">
uptime = #{uptime},
</if>
<if test="placeId != null">
place_id = #{placeId},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from cust_addr where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,330 @@
<?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.bonus.canteen.consumer.mapper.CustPlaceMapper">
<resultMap type="com.bonus.canteen.consumer.model.CustPlace" id="CustPlaceMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="placeId" column="place_id" jdbcType="INTEGER"/>
<result property="placeNum" column="place_num" jdbcType="VARCHAR"/>
<result property="placeName" column="place_name" jdbcType="VARCHAR"/>
<result property="placeLevel" column="place_level" jdbcType="INTEGER"/>
<result property="ifLast" column="if_last" jdbcType="INTEGER"/>
<result property="superId" column="super_id" jdbcType="INTEGER"/>
<result property="placeFullName" column="place_full_name" jdbcType="VARCHAR"/>
<result property="placeUrl" column="place_url" jdbcType="VARCHAR"/>
<result property="canteenId" column="canteen_id" jdbcType="INTEGER"/>
<result property="shopstallId" column="shopstall_id" jdbcType="INTEGER"/>
<result property="specialRecipeId" column="special_recipe_id" jdbcType="INTEGER"/>
<result property="commonRecipeId" column="common_recipe_id" jdbcType="INTEGER"/>
<result property="remarks" column="remarks" jdbcType="VARCHAR"/>
<result property="ifDel" column="if_del" jdbcType="INTEGER"/>
<result property="revision" column="revision" jdbcType="INTEGER"/>
<result property="crby" column="crby" jdbcType="VARCHAR"/>
<result property="crtime" column="crtime" jdbcType="TIMESTAMP"/>
<result property="upby" column="upby" jdbcType="VARCHAR"/>
<result property="uptime" column="uptime" jdbcType="TIMESTAMP"/>
<result property="userId" column="user_id" jdbcType="INTEGER"/>
<result property="superIds" column="super_ids" jdbcType="VARCHAR"/>
<result property="publicCode" column="public_code" jdbcType="INTEGER"/>
<result property="sort" column="sort" jdbcType="VARCHAR"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="CustPlaceMap">
select
id, place_id, place_num, place_name, place_level, if_last, super_id, place_full_name, place_url, canteen_id, shopstall_id, special_recipe_id, common_recipe_id, remarks, if_del, revision, crby, crtime, upby, uptime, user_id, super_ids, public_code, sort
from cust_place
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="CustPlaceMap">
select
id, place_id, place_num, place_name, place_level, if_last, super_id, place_full_name, place_url, canteen_id, shopstall_id, special_recipe_id, common_recipe_id, remarks, if_del, revision, crby, crtime, upby, uptime, user_id, super_ids, public_code, sort
from cust_place
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="placeId != null">
and place_id = #{placeId}
</if>
<if test="placeNum != null and placeNum != ''">
and place_num = #{placeNum}
</if>
<if test="placeName != null and placeName != ''">
and place_name = #{placeName}
</if>
<if test="placeLevel != null">
and place_level = #{placeLevel}
</if>
<if test="ifLast != null">
and if_last = #{ifLast}
</if>
<if test="superId != null">
and super_id = #{superId}
</if>
<if test="placeFullName != null and placeFullName != ''">
and place_full_name = #{placeFullName}
</if>
<if test="placeUrl != null and placeUrl != ''">
and place_url = #{placeUrl}
</if>
<if test="canteenId != null">
and canteen_id = #{canteenId}
</if>
<if test="shopstallId != null">
and shopstall_id = #{shopstallId}
</if>
<if test="specialRecipeId != null">
and special_recipe_id = #{specialRecipeId}
</if>
<if test="commonRecipeId != null">
and common_recipe_id = #{commonRecipeId}
</if>
<if test="remarks != null and remarks != ''">
and remarks = #{remarks}
</if>
<if test="ifDel != null">
and if_del = #{ifDel}
</if>
<if test="revision != null">
and revision = #{revision}
</if>
<if test="crby != null and crby != ''">
and crby = #{crby}
</if>
<if test="crtime != null">
and crtime = #{crtime}
</if>
<if test="upby != null and upby != ''">
and upby = #{upby}
</if>
<if test="uptime != null">
and uptime = #{uptime}
</if>
<if test="userId != null">
and user_id = #{userId}
</if>
<if test="superIds != null and superIds != ''">
and super_ids = #{superIds}
</if>
<if test="publicCode != null">
and public_code = #{publicCode}
</if>
<if test="sort != null and sort != ''">
and sort = #{sort}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from cust_place
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="placeId != null">
and place_id = #{placeId}
</if>
<if test="placeNum != null and placeNum != ''">
and place_num = #{placeNum}
</if>
<if test="placeName != null and placeName != ''">
and place_name = #{placeName}
</if>
<if test="placeLevel != null">
and place_level = #{placeLevel}
</if>
<if test="ifLast != null">
and if_last = #{ifLast}
</if>
<if test="superId != null">
and super_id = #{superId}
</if>
<if test="placeFullName != null and placeFullName != ''">
and place_full_name = #{placeFullName}
</if>
<if test="placeUrl != null and placeUrl != ''">
and place_url = #{placeUrl}
</if>
<if test="canteenId != null">
and canteen_id = #{canteenId}
</if>
<if test="shopstallId != null">
and shopstall_id = #{shopstallId}
</if>
<if test="specialRecipeId != null">
and special_recipe_id = #{specialRecipeId}
</if>
<if test="commonRecipeId != null">
and common_recipe_id = #{commonRecipeId}
</if>
<if test="remarks != null and remarks != ''">
and remarks = #{remarks}
</if>
<if test="ifDel != null">
and if_del = #{ifDel}
</if>
<if test="revision != null">
and revision = #{revision}
</if>
<if test="crby != null and crby != ''">
and crby = #{crby}
</if>
<if test="crtime != null">
and crtime = #{crtime}
</if>
<if test="upby != null and upby != ''">
and upby = #{upby}
</if>
<if test="uptime != null">
and uptime = #{uptime}
</if>
<if test="userId != null">
and user_id = #{userId}
</if>
<if test="superIds != null and superIds != ''">
and super_ids = #{superIds}
</if>
<if test="publicCode != null">
and public_code = #{publicCode}
</if>
<if test="sort != null and sort != ''">
and sort = #{sort}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into cust_place(place_id, place_num, place_name, place_level, if_last, super_id, place_full_name, place_url, canteen_id, shopstall_id, special_recipe_id, common_recipe_id, remarks, if_del, revision, crby, crtime, upby, uptime, user_id, super_ids, public_code, sort)
values (#{placeId}, #{placeNum}, #{placeName}, #{placeLevel}, #{ifLast}, #{superId}, #{placeFullName}, #{placeUrl}, #{canteenId}, #{shopstallId}, #{specialRecipeId}, #{commonRecipeId}, #{remarks}, #{ifDel}, #{revision}, #{crby}, #{crtime}, #{upby}, #{uptime}, #{userId}, #{superIds}, #{publicCode}, #{sort})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into cust_place(place_id, place_num, place_name, place_level, if_last, super_id, place_full_name, place_url, canteen_id, shopstall_id, special_recipe_id, common_recipe_id, remarks, if_del, revision, crby, crtime, upby, uptime, user_id, super_ids, public_code, sort)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.placeId}, #{entity.placeNum}, #{entity.placeName}, #{entity.placeLevel}, #{entity.ifLast}, #{entity.superId}, #{entity.placeFullName}, #{entity.placeUrl}, #{entity.canteenId}, #{entity.shopstallId}, #{entity.specialRecipeId}, #{entity.commonRecipeId}, #{entity.remarks}, #{entity.ifDel}, #{entity.revision}, #{entity.crby}, #{entity.crtime}, #{entity.upby}, #{entity.uptime}, #{entity.userId}, #{entity.superIds}, #{entity.publicCode}, #{entity.sort})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into cust_place(place_id, place_num, place_name, place_level, if_last, super_id, place_full_name, place_url, canteen_id, shopstall_id, special_recipe_id, common_recipe_id, remarks, if_del, revision, crby, crtime, upby, uptime, user_id, super_ids, public_code, sort)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.placeId}, #{entity.placeNum}, #{entity.placeName}, #{entity.placeLevel}, #{entity.ifLast}, #{entity.superId}, #{entity.placeFullName}, #{entity.placeUrl}, #{entity.canteenId}, #{entity.shopstallId}, #{entity.specialRecipeId}, #{entity.commonRecipeId}, #{entity.remarks}, #{entity.ifDel}, #{entity.revision}, #{entity.crby}, #{entity.crtime}, #{entity.upby}, #{entity.uptime}, #{entity.userId}, #{entity.superIds}, #{entity.publicCode}, #{entity.sort})
</foreach>
on duplicate key update
place_id = values(place_id),
place_num = values(place_num),
place_name = values(place_name),
place_level = values(place_level),
if_last = values(if_last),
super_id = values(super_id),
place_full_name = values(place_full_name),
place_url = values(place_url),
canteen_id = values(canteen_id),
shopstall_id = values(shopstall_id),
special_recipe_id = values(special_recipe_id),
common_recipe_id = values(common_recipe_id),
remarks = values(remarks),
if_del = values(if_del),
revision = values(revision),
crby = values(crby),
crtime = values(crtime),
upby = values(upby),
uptime = values(uptime),
user_id = values(user_id),
super_ids = values(super_ids),
public_code = values(public_code),
sort = values(sort)
</insert>
<!--通过主键修改数据-->
<update id="update">
update cust_place
<set>
<if test="placeId != null">
place_id = #{placeId},
</if>
<if test="placeNum != null and placeNum != ''">
place_num = #{placeNum},
</if>
<if test="placeName != null and placeName != ''">
place_name = #{placeName},
</if>
<if test="placeLevel != null">
place_level = #{placeLevel},
</if>
<if test="ifLast != null">
if_last = #{ifLast},
</if>
<if test="superId != null">
super_id = #{superId},
</if>
<if test="placeFullName != null and placeFullName != ''">
place_full_name = #{placeFullName},
</if>
<if test="placeUrl != null and placeUrl != ''">
place_url = #{placeUrl},
</if>
<if test="canteenId != null">
canteen_id = #{canteenId},
</if>
<if test="shopstallId != null">
shopstall_id = #{shopstallId},
</if>
<if test="specialRecipeId != null">
special_recipe_id = #{specialRecipeId},
</if>
<if test="commonRecipeId != null">
common_recipe_id = #{commonRecipeId},
</if>
<if test="remarks != null and remarks != ''">
remarks = #{remarks},
</if>
<if test="ifDel != null">
if_del = #{ifDel},
</if>
<if test="revision != null">
revision = #{revision},
</if>
<if test="crby != null and crby != ''">
crby = #{crby},
</if>
<if test="crtime != null">
crtime = #{crtime},
</if>
<if test="upby != null and upby != ''">
upby = #{upby},
</if>
<if test="uptime != null">
uptime = #{uptime},
</if>
<if test="userId != null">
user_id = #{userId},
</if>
<if test="superIds != null and superIds != ''">
super_ids = #{superIds},
</if>
<if test="publicCode != null">
public_code = #{publicCode},
</if>
<if test="sort != null and sort != ''">
sort = #{sort},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from cust_place where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,89 @@
<?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.bonus.canteen.consumer.mapper.SysNoticeMapper">
<resultMap type="com.bonus.canteen.consumer.model.SysNotice" id="SysNoticeResult">
<result property="noticeId" column="notice_id" />
<result property="noticeTitle" column="notice_title" />
<result property="noticeType" column="notice_type" />
<result property="noticeContent" column="notice_content" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectNoticeVo">
select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark
from sys_notice
</sql>
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
<include refid="selectNoticeVo"/>
where notice_id = #{noticeId}
</select>
<select id="selectNoticeList" parameterType="com.bonus.canteen.consumer.model.SysNotice" resultMap="SysNoticeResult">
<include refid="selectNoticeVo"/>
<where>
<if test="noticeTitle != null and noticeTitle != ''">
AND notice_title like concat('%', #{noticeTitle}, '%')
</if>
<if test="noticeType != null and noticeType != ''">
AND notice_type = #{noticeType}
</if>
<if test="createBy != null and createBy != ''">
AND create_by like concat('%', #{createBy}, '%')
</if>
</where>
</select>
<insert id="insertNotice" parameterType="com.bonus.canteen.consumer.model.SysNotice">
insert into sys_notice (
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
<if test="status != null and status != '' ">status, </if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
<if test="status != null and status != ''">#{status}, </if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateNotice" parameterType="com.bonus.canteen.consumer.model.SysNotice">
update sys_notice
<set>
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
<if test="status != null and status != ''">status = #{status}, </if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where notice_id = #{noticeId}
</update>
<delete id="deleteNoticeById" parameterType="Long">
delete from sys_notice where notice_id = #{noticeId}
</delete>
<delete id="deleteNoticeByIds" parameterType="Long">
delete from sys_notice where notice_id in
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
#{noticeId}
</foreach>
</delete>
</mapper>

View File

@ -9,8 +9,8 @@
<modelVersion>4.0.0</modelVersion>
<modules>
<module>core-aggregator</module>
<module>bonus-cateen</module>
<!-- <module>core-aggregator</module>-->
<!-- <module>bonus-cateen</module>-->
<module>bonus-smart-canteen</module>
</modules>