first commit

This commit is contained in:
2025-02-20 15:14:38 +08:00
commit 70e3764011
1113 changed files with 107789 additions and 0 deletions
+126
View File
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd">
<!-- Spring的配置文件,主要配置和业务逻辑有关的 -->
<!-- 数据源,事务控制 -->
<context:component-scan base-package="lingtao.net">
<!-- 只不扫描控制器,其他都扫描-->
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<!-- ================配置数据源:c3p0================ -->
<context:property-placeholder location="classpath:dbconfig.properties"/>
<bean id="pooledDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property>
<property name="driverClass" value="${jdbc.driverClass}"></property>
<property name="user" value="${jdbc.user}"></property>
<property name="password" value="${jdbc.password}"></property>
</bean>
<!-- ===============配置和mybatis的整合================= -->
<bean
id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 注入数据源 -->
<property name="dataSource" ref="pooledDataSource"></property>
<!-- 加载mybatis的配置文件 -->
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
<!-- 指定mybatis的mapper文件的位置 -->
<property name="mapperLocations" value="classpath:mapper/*.xml"></property>
</bean>
<!-- 使用扫描器 :扫描mapper接口,将mybatis接口的实现加入到ioc容器中
mapper接口的名字就是类名的首字母小写-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 指定接口的所在包,加入到ioc容器中 -->
<property name="basePackage" value="lingtao.net.dao,lingtao.net.mapper"></property>
</bean>
<!-- 配置一个可以执行批量的sqlSession -->
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory"></constructor-arg>
<constructor-arg name="executorType" value="SIMPLE"></constructor-arg>
</bean>
<!-- =================配置事务控制================= -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!-- 控制住数据源 -->
<property name="dataSource" ref="pooledDataSource"></property>
</bean>
<!-- 开启基于注解的事务,使用xml配置形式的事务(比较重要的都是使用配置) -->
<aop:config>
<!-- 切入点表达式 -->
<aop:pointcut expression="execution(* lingtao.net.service..*(..))" id="txPoint"/>
<!-- 配置事务增强 -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint"/>
</aop:config>
<!-- 配置事务增强-事务如何切入 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 所有的方法都是事务方法 -->
<tx:method name="*" propagation="REQUIRED"/>
<!-- 以get开头的所有方法:查询使用只读 -->
<tx:method name="get*" read-only="true"/>
</tx:attributes>
</tx:advice>
<!-- Spring配置文件的核心:(数据源、与mybatis的整合、事务控制) -->
<!-- 自定义Realm -->
<bean id="shiroRealm" class="lingtao.net.realm.ShiroRealm"></bean>
<!-- session管理器(用户操作session -->
<bean id="sessionDAO" class="org.apache.shiro.session.mgt.eis.MemorySessionDAO"></bean>
<!-- 配置shiro session 的一个管理器 -->
<bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
<property name="sessionValidationSchedulerEnabled" value="true"/>
<property name="sessionDAO" ref="sessionDAO"></property>
</bean>
<!-- shiro安全管理器 -->
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<!-- 自定义的realm -->
<property name="realm" ref="shiroRealm"/>
<!-- shiro session管理器 -->
<property name="sessionManager" ref="sessionManager"></property>
</bean>
<!-- 配置shiro的一些拦截规则,id必须和web.xml中的 shiro 拦截器名一致 -->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<!-- Shiro的核心安全接口,这个属性是必须的 -->
<property name="securityManager" ref="securityManager"/>
<!-- 身份认证失败,则跳转到登录页面的配置 -->
<property name="loginUrl" value="/login.jsp"/>
<!-- 认证通过会 要跳转 的页面 -->
<property name="successUrl" value="/main.jsp"></property>
<!-- 权限认证失败,则跳转到指定页面 -->
<property name="unauthorizedUrl" value="/refuse"/> <!-- 登录后访问没有权限的页面后跳转的页面 -->
<!-- Shiro连接约束配置,即过滤链的定义 -->
<property name="filterChainDefinitions">
<value>
<!-- 注意:规则是有顺序的,从上到下,拦截范围必须是从小到大的 -->
<!-- url = 拦截规则(anon为匿名,authc为要登录后,才能访问,logout登出过滤) -->
/login = anon
/logout = logout
/SysUser/**=anon
/static/** = anon
/img/** = anon
/abc/** = anon
/views/** = authc
/js/** = authc
/**= authc
</value>
</property>
</bean>
</beans>
+9
View File
@@ -0,0 +1,9 @@
#jdbc.jdbcUrl=jdbc:mysql://47.122.33.193:3306/quote_price
#jdbc.driverClass=com.mysql.jdbc.Driver
#jdbc.user=admin_666888
#jdbc.password=Admin_666888
jdbc.jdbcUrl=jdbc:mysql://127.0.0.1:3306/quote_price
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.user=root
jdbc.password=RdCcZOL1QxdYqEot
Binary file not shown.
+23
View File
@@ -0,0 +1,23 @@
#\u5B9A\u4E49LOG\u8F93\u51FA\u7EA7\u522B
log4j.rootLogger=INFO,Console
#\u5B9A\u4E49\u65E5\u5FD7\u8F93\u51FA\u76EE\u7684\u5730\u4E3A\u63A7\u5236\u53F0
log4j.appender.Console=org.apache.log4j.ConsoleAppender
#\u53EF\u4EE5\u7075\u6D3B\u7684\u6307\u5B9A\u65E5\u5FD7\u8F93\u51FA\u683C\u5F0F\uFF0C\u4E0B\u9762\u4E00\u884C\u662F\u6307\u5B9A\u5177\u4F53\u7684\u683C\u5F0F
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d [%t] [%p] [%c] - %m%n
#mybatis\u663E\u793ASQL\u8BED\u53E5\u65E5\u5FD7\u914D\u7F6E
log4j.logger.lingtao.net.dao=DEBUG
#log4j.logger.java.sql.ResultSet=INFO
#log4j.logger.org.apche=INFO
#log4j.logger.java.sql.Statement=DEBUG
#log4j.logger.java.sql.PreparedStatement=DEBUG
log4j.logger.com.springframework=ERROR
log4j.logger.com.ibatis=DEBUG
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
log4j.logger.java.sql.ResultSet=DEBUG
+390
View File
@@ -0,0 +1,390 @@
<?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="lingtao.net.dao.ArticleMapper">
<resultMap id="BaseResultMap" type="lingtao.net.bean.Article">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="imagesUrl" jdbcType="VARCHAR" property="imagesUrl" />
<result column="hit" jdbcType="INTEGER" property="hit" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="createBy" jdbcType="VARCHAR" property="createBy" />
<result column="createDate" jdbcType="TIMESTAMP" property="createDate" />
<result column="updateBy" jdbcType="VARCHAR" property="updateBy" />
<result column="updateDate" jdbcType="TIMESTAMP" property="updateDate" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="lingtao.net.bean.Article">
<result column="content" jdbcType="LONGVARCHAR" property="content" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, title, type, status, imagesUrl, hit, remark, createBy, createDate, updateBy,
updateDate
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="lingtao.net.bean.ArticleExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from tbl_article
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="lingtao.net.bean.ArticleExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from tbl_article
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from tbl_article
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tbl_article
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="lingtao.net.bean.ArticleExample">
delete from tbl_article
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="lingtao.net.bean.Article">
insert into tbl_article (id, title, type,
status, imagesUrl, hit,
remark, createBy, createDate,
updateBy, updateDate, content
)
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{imagesUrl,jdbcType=VARCHAR}, #{hit,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="lingtao.net.bean.Article">
insert into tbl_article
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="title != null">
title,
</if>
<if test="type != null">
type,
</if>
<if test="status != null">
status,
</if>
<if test="imagesUrl != null">
imagesUrl,
</if>
<if test="hit != null">
hit,
</if>
<if test="remark != null">
remark,
</if>
<if test="createBy != null">
createBy,
</if>
<if test="createDate != null">
createDate,
</if>
<if test="updateBy != null">
updateBy,
</if>
<if test="updateDate != null">
updateDate,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="imagesUrl != null">
#{imagesUrl,jdbcType=VARCHAR},
</if>
<if test="hit != null">
#{hit,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
#{createDate,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
#{updateDate,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="lingtao.net.bean.ArticleExample" resultType="java.lang.Long">
select count(*) from tbl_article
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update tbl_article
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.imagesUrl != null">
imagesUrl = #{record.imagesUrl,jdbcType=VARCHAR},
</if>
<if test="record.hit != null">
hit = #{record.hit,jdbcType=INTEGER},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
createBy = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createDate != null">
createDate = #{record.createDate,jdbcType=TIMESTAMP},
</if>
<if test="record.updateBy != null">
updateBy = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.updateDate != null">
updateDate = #{record.updateDate,jdbcType=TIMESTAMP},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update tbl_article
set id = #{record.id,jdbcType=INTEGER},
title = #{record.title,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
imagesUrl = #{record.imagesUrl,jdbcType=VARCHAR},
hit = #{record.hit,jdbcType=INTEGER},
remark = #{record.remark,jdbcType=VARCHAR},
createBy = #{record.createBy,jdbcType=VARCHAR},
createDate = #{record.createDate,jdbcType=TIMESTAMP},
updateBy = #{record.updateBy,jdbcType=VARCHAR},
updateDate = #{record.updateDate,jdbcType=TIMESTAMP},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update tbl_article
set id = #{record.id,jdbcType=INTEGER},
title = #{record.title,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
imagesUrl = #{record.imagesUrl,jdbcType=VARCHAR},
hit = #{record.hit,jdbcType=INTEGER},
remark = #{record.remark,jdbcType=VARCHAR},
createBy = #{record.createBy,jdbcType=VARCHAR},
createDate = #{record.createDate,jdbcType=TIMESTAMP},
updateBy = #{record.updateBy,jdbcType=VARCHAR},
updateDate = #{record.updateDate,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="lingtao.net.bean.Article">
update tbl_article
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
</if>
<if test="imagesUrl != null">
imagesUrl = #{imagesUrl,jdbcType=VARCHAR},
</if>
<if test="hit != null">
hit = #{hit,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
createBy = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
createDate = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
updateBy = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
updateDate = #{updateDate,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="lingtao.net.bean.Article">
update tbl_article
set title = #{title,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
imagesUrl = #{imagesUrl,jdbcType=VARCHAR},
hit = #{hit,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
createBy = #{createBy,jdbcType=VARCHAR},
createDate = #{createDate,jdbcType=TIMESTAMP},
updateBy = #{updateBy,jdbcType=VARCHAR},
updateDate = #{updateDate,jdbcType=TIMESTAMP},
content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="lingtao.net.bean.Article">
update tbl_article
set title = #{title,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
imagesUrl = #{imagesUrl,jdbcType=VARCHAR},
hit = #{hit,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
createBy = #{createBy,jdbcType=VARCHAR},
createDate = #{createDate,jdbcType=TIMESTAMP},
updateBy = #{updateBy,jdbcType=VARCHAR},
updateDate = #{updateDate,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getArticle" parameterType="Article" resultMap="BaseResultMap">
select * from tbl_article
<where>
<if test="title != null and title != ''">
title like '%${title}%'
</if>
<if test="type != null and type != ''">
type = #{type}
</if>
</where>
ORDER BY createDate DESC
</select>
</mapper>
+37
View File
@@ -0,0 +1,37 @@
<?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="lingtao.net.dao.BugMapper">
<select id="getBugs" parameterType="Bug" resultType="Bug">
SELECT
*
FROM
bug
<where>
<if test="createBy !=null and createBy != '' ">
createBy like '%${createBy}%'
</if>
</where>
ORDER BY id DESC
</select>
<insert id="addBug" parameterType="Bug">
INSERT INTO bug
(
id,
product,
bugRemark,
createBy,
createDate
)
VALUES
(
NULL,
#{product},
#{bugRemark},
#{createBy},
now()
)
</insert>
</mapper>
@@ -0,0 +1,26 @@
<?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="lingtao.net.mapper.ClothingTagMapper">
<insert id="insert" parameterType="lingtao.net.entity.ClothingTag">
INSERT INTO product_clothing_tag
(material,
technique,
product_membrane,
product_slice,
is_rope,
compute,
formula,
rope_formula,
is_multi)
VALUES (#{material},
#{technique},
#{productMembrane},
#{productSlice},
#{isRope},
#{compute,typeHandler=lingtao.net.handler.MapToVarcharTypeHandler},
#{formula},
#{ropeFormula},
#{isMulti})
</insert>
</mapper>
@@ -0,0 +1,49 @@
<?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="lingtao.net.dao.CustomerAwardMapper">
<!-- 查询列表 -->
<select id="getCustomerAward" parameterType="CustomerAward" resultType="CustomerAward">
select * from tbl_customer_award
<where>
<if test="nickname !=null and nickname != '' ">
and nickname like '%${nickname}%'
</if>
<if test="shopname !=null and shopname != '' ">
and shopname like '%${shopname}%'
</if>
<if test="creator !=null and creator != '' ">
and creator like '%${creator}%'
</if>
<if test="createTimeBegin !=null and createTimeBegin != '' ">
<![CDATA[and awardDate >= #{createTimeBegin} ]]>
</if>
<if test="createTimeEnd !=null and createTimeEnd != '' ">
<![CDATA[and awardDate <= #{createTimeEnd} ]]>
</if>
</where>
order by createDate DESC
</select>
<!-- 批量删除数据 -->
<delete id="deleteBatch" parameterType="int">
<!-- delete from tbl_finance where financeId in(7789,7790) -->
<!-- forEach:用来循环; collection:用来指定循环的数据的类型; 可以填的值有:array,list,map
item:循环中为每个循环的数据指定一个别名; index:循环中循环的下标 ; open:开始; close:结束; separator:数组中元素之间的分隔符 -->
delete from tbl_customer_award where id in
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 批量插入 -->
<insert id="insertForeach" parameterType="java.util.List">
insert into tbl_customer_award (
id, nickname, payPercent, askNumber, customerPrice,award,shopname,awardDate,creator,createDate)
values
<foreach collection="list" item="item" index="index" separator=",">
(
null,#{item.nickname},#{item.payPercent},#{item.askNumber},#{item.customerPrice},#{item.award},#{item.shopname},#{item.awardDate},#{item.creator},now())
</foreach>
</insert>
</mapper>
@@ -0,0 +1,155 @@
<?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="lingtao.net.dao.CustomerDataMapper">
<!-- 获取操作的数据根据店铺 -->
<select id="getCustomerDatas" parameterType="CustomerData" resultType="CustomerData">
select * from tbl_customer_data
<where>
<if test="realname != null and realname != ''">
and realname like '%${realname}%'
</if>
<if test="wangwang != null and wangwang != ''">
and wangwang like '%${wangwang}%'
</if>
<if test="isBuy != null and isBuy != ''">
and isBuy = #{isBuy}
</if>
<if test="roleSearch != null and roleSearch != ''">
and role = #{roleSearch}
</if>
<if test = "roleArr != null and roleArr != '' " >
and role in
<foreach collection="roleArr" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="createDateBegin !=null and createDateBegin != '' ">
<![CDATA[and createDate >= #{createDateBegin} ]]>
</if>
<if test="createDateEnd !=null and createDateEnd != '' ">
<![CDATA[and createDate <= #{createDateEnd} ]]>
</if>
</where>
ORDER BY createDate DESC
</select>
<insert id="addCustomerData" useGeneratedKeys="true" keyProperty="id" parameterType="CustomerData">
insert into tbl_customer_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="username != null">
username,
</if>
<if test="realname != null">
realname,
</if>
<if test="role != null">
role,
</if>
<if test="price != null">
price,
</if>
<if test="productExplain != null">
productExplain,
</if>
<if test="wangwang != null">
wangwang,
</if>
<if test="isBuy != null">
isBuy,
</if>
<if test="commentSelf != null">
commentSelf,
</if>
<if test="createBy != null">
createBy,
</if>
createDate,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="realname != null">
#{realname,jdbcType=VARCHAR},
</if>
<if test="role != null">
#{role,jdbcType=VARCHAR},
</if>
<if test="price != null">
#{price,jdbcType=DOUBLE},
</if>
<if test="productExplain != null">
#{productExplain,jdbcType=VARCHAR},
</if>
<if test="wangwang != null">
#{wangwang,jdbcType=VARCHAR},
</if>
<if test="isBuy != null">
#{isBuy,jdbcType=VARCHAR},
</if>
<if test="commentSelf != null">
#{commentSelf,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
now(),
</trim>
</insert>
<update id="updateCustomerDataById" parameterType="CustomerData">
update tbl_customer_data
<set>
<if test="role != null">
role = #{role,jdbcType=VARCHAR},
</if>
<if test="price != null">
price = #{price,jdbcType=DOUBLE},
</if>
<if test="productExplain != null">
productExplain = #{productExplain,jdbcType=VARCHAR},
</if>
<if test="wangwang != null">
wangwang = #{wangwang,jdbcType=VARCHAR},
</if>
<if test="commentSelf != null">
commentSelf = #{commentSelf,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
updateBy = #{updateBy,jdbcType=VARCHAR},
</if>
updateDate = now(),
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<!-- 修改店长评语 -->
<update id="updateCommentManager" parameterType="CustomerData">
UPDATE
tbl_customer_data
SET
commentManager = #{commentManager}, commentDate = now()
WHERE
id = #{id}
</update>
<delete id="deleteCustomerDataById" parameterType="java.lang.Integer">
delete from tbl_customer_data
where id = #{id,jdbcType=INTEGER}
</delete>
<!-- 查询7天内的数据 -->
<select id="getProductExplain" parameterType="String" resultType="String">
SELECT
remark
FROM
tbl_quote_data
WHERE
<![CDATA[ DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= DATE(quoteTime) ]]>
AND
username = #{username}
AND
remark LIKE '%${productExplain}%'
ORDER BY id DESC
</select>
</mapper>
@@ -0,0 +1,134 @@
<?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="lingtao.net.dao.CustomerTrainMapper">
<select id="getCustomerTrainContents" parameterType="CustomerTrainContent"
resultType="CustomerTrainContent">
SELECT
*
FROM
t_customer_train_content
<where>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="proType != null and proType != ''">
and pro_type = #{proType}
</if>
<if test="kind != null and kind != ''">
and kind = #{kind}
</if>
</where>
ORDER BY sort
</select>
<insert id="addCustomerTrainContent" parameterType="CustomerTrainContent">
insert into t_customer_train_content
(pro_type,kind,sort,content,type,create_by,create_date)
values
(#{proType},#{kind},#{sort},#{content},#{type},#{createBy},now())
</insert>
<update id="updateCustomerTrainContentById">
update t_customer_train_content
<set>
<if test="proType != null and proType != ''">
pro_type = #{proType},
</if>
<if test="kind != null and kind != ''">
kind = #{kind},
</if>
<if test="content != null and content != ''">
content = #{content,jdbcType=VARCHAR},
</if>
type = #{type},
update_by = #{updateBy},
update_date = now(),
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteCustomerTrainContentById" parameterType="java.lang.Integer">
delete from t_customer_train_content
where id = #{id,jdbcType=INTEGER}
</delete>
<!-- 产品种类字典 -->
<select id="getCustomerTrainProTypes" parameterType="CustomerTrainProType"
resultType="CustomerTrainProType">
SELECT
*
FROM
t_customer_train_pro_type
<where>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="proType != null and proType != ''">
and pro_type = #{proType}
</if>
</where>
ORDER BY sort
</select>
<insert id="addCustomerTrainProType" parameterType="CustomerTrainProType">
insert into t_customer_train_pro_type
(pro_type,remark,sort,type,create_by,create_date)
values
(#{proType},#{remark},#{sort},#{type},#{createBy},now())
</insert>
<update id="updateCustomerTrainProTypeById">
update t_customer_train_pro_type
set
pro_type = #{proType},
remark = #{remark},
sort = #{sort},
type = #{type},
update_by = #{updateBy},
update_date = now()
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteCustomerTrainProTypeById" parameterType="java.lang.Integer">
delete from t_customer_train_pro_type
where id = #{id,jdbcType=INTEGER}
</delete>
<!-- 产品类型字典 -->
<select id="getCustomerTrainKindLabelsByProType" parameterType="CustomerTrainKindLabel"
resultType="CustomerTrainKindLabel">
SELECT
*
FROM
t_customer_train_kind_label
where pro_type = #{proType}
and type = #{type}
ORDER BY sort
</select>
<insert id="addCustomerTrainKindLabel" parameterType="CustomerTrainKindLabel">
insert into t_customer_train_kind_label
(pro_type,kind_label,remark,sort,type,create_by,create_date)
values
(#{proType},#{kindLabel},#{remark},#{sort},#{type},#{createBy},now())
</insert>
<update id="updateCustomerTrainKindLabelById">
update t_customer_train_kind_label
set
kind_label = #{kindLabel},
remark = #{remark},
sort = #{sort},
type = #{type},
update_by = #{updateBy},
update_date = now()
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteCustomerTrainKindLabelById" parameterType="java.lang.Integer">
delete from t_customer_train_kind_label
where id = #{id,jdbcType=INTEGER}
</delete>
</mapper>
@@ -0,0 +1,53 @@
<?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="lingtao.net.dao.ExpressFeeMapper">
<select id="getExpressFees" parameterType="ExpressFee"
resultType="ExpressFee">
SELECT
*
FROM
tbl_express_fee
<where>
<if test="province != null and province != ''">
province like '%${province}%'
</if>
</where>
order by id
</select>
<insert id="addExpressFee" parameterType="ExpressFee">
insert into
tbl_express_fee
(province,pro_type_label,first_weight_price,continued_weight_price,start_price,createBy,createDate)
values
(#{province},#{proTypeLabel},#{firstWeight},#{continuedWeightPrice},#{startPrice},#{createBy},now())
</insert>
<update id="updateExpressFeeById" parameterType="ExpressFee">
update tbl_express_fee
<set>
<if test="province != null">
province = #{province,jdbcType=VARCHAR},
</if>
<if test="firstWeightPrice != null and firstWeightPrice != 0.0">
first_weight_price = #{firstWeightPrice},
</if>
<if test="continuedWeightPrice != null and continuedWeightPrice != 0.0">
continued_weight_price = #{continuedWeightPrice},
</if>
<if test="startPrice != null and startPrice != 0.0">
start_price = #{startPrice},
</if>
<if test="updateBy != null">
updateBy = #{updateBy,jdbcType=VARCHAR},
</if>
updateDate = now()
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteExpressFeeById">
delete from tbl_express_fee where id = #{id}
</delete>
</mapper>
@@ -0,0 +1,55 @@
<?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="lingtao.net.dao.Finance2Mapper">
<!-- 查询列表 -->
<select id="getFinance" parameterType="Finance" resultType="Finance">
select * from tbl_sys_finance2
<where>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="filename != null and filename != ''">
and filename = #{filename}
</if>
<if test="orderNumber != null and orderNumber != ''">
and order_number like "%${orderNumber}%"
</if>
</where>
ORDER BY create_date DESC,id ASC
</select>
<select id="getAllFilename" parameterType="String" resultType="String">
SELECT
DISTINCT filename
FROM
tbl_sys_finance2
WHERE creator = #{creator}
ORDER BY create_date DESC
</select>
<!-- 批量插入 -->
<insert id="insertForeach" parameterType="java.util.List">
insert into tbl_sys_finance2 (
id, add_time, supplier,
shopname, kind, kind2,
order_number, filename, count,
number, zhang,remark, creator)
values
<foreach collection="list" item="item" index="index" separator=",">
(
null,#{item.addTime},#{item.supplier},#{item.shopname},#{item.kind},
#{item.kind2},#{item.orderNumber},#{item.filename},#{item.count},#{item.number},
#{item.zhang},#{item.remark},#{item.creator})
</foreach>
</insert>
<!-- 导入数据前查询数据是否已存在,存在就不插入 -->
<select id="checkAccountNumber" parameterType="String" resultType="String">
SELECT
order_number
FROM
tbl_sys_finance2
WHERE order_number = #{orderNumber}
</select>
</mapper>
@@ -0,0 +1,252 @@
<?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="lingtao.net.dao.Finance3Mapper">
<!-- 查询列表 -->
<select id="getFinance" parameterType="Finance" resultType="Finance">
select * from tbl_sys_finance3
<where>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="filename != null and filename != ''">
and filename = #{filename}
</if>
<if test="orderNumber != null and orderNumber != ''">
and order_number like "%${orderNumber}%"
</if>
</where>
ORDER BY create_date DESC,id ASC
</select>
<select id="getAllFilename" parameterType="String" resultType="String">
SELECT
DISTINCT filename
FROM
tbl_sys_finance3
WHERE creator = #{creator}
ORDER BY create_date DESC
</select>
<!-- 批量插入 -->
<insert id="insertForeach" parameterType="java.util.List">
insert into tbl_sys_finance3 (
id, add_time, supplier,
shopname, kind, kind2,
order_number, filename, count,
number, zhang,remark, creator)
values
<foreach collection="list" item="item" index="index" separator=",">
(
null,#{item.addTime},#{item.supplier},#{item.shopname},#{item.kind},
#{item.kind2},#{item.orderNumber},#{item.filename},#{item.count},#{item.number},
#{item.zhang},#{item.remark},#{item.creator})
</foreach>
</insert>
<!-- 导入数据前查询数据是否已存在,存在就不插入 -->
<select id="checkAccountNumber" parameterType="String" resultType="String">
SELECT
order_number
FROM
tbl_sys_finance3
WHERE order_number = #{orderNumber}
</select>
<!-- 拼版计算4开始 -->
<select id="getFinance4" parameterType="Finance" resultType="Finance">
select * from tbl_sys_finance4
<where>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="filename != null and filename != ''">
and filename = #{filename}
</if>
<if test="orderNumber != null and orderNumber != ''">
and order_number like "%${orderNumber}%"
</if>
</where>
ORDER BY create_date DESC,id ASC
</select>
<select id="getAllFilename4" parameterType="String" resultType="String">
SELECT
DISTINCT filename
FROM
tbl_sys_finance4
WHERE creator = #{creator}
ORDER BY create_date DESC
</select>
<insert id="insertForeach4" parameterType="java.util.List">
insert into tbl_sys_finance4 (
id, add_time, supplier,
shopname, kind, kind2,
order_number, filename, count,
number, zhang,remark, creator)
values
<foreach collection="list" item="item" index="index" separator=",">
(
null,#{item.addTime},#{item.supplier},#{item.shopname},#{item.kind},
#{item.kind2},#{item.orderNumber},#{item.filename},#{item.count},#{item.number},
#{item.zhang},#{item.remark},#{item.creator})
</foreach>
</insert>
<select id="checkAccountNumber4" parameterType="String" resultType="String">
SELECT
order_number
FROM
tbl_sys_finance4
WHERE order_number = #{orderNumber}
</select>
<!-- 拼版计算4结束 -->
<!-- 拼版计算5开始 -->
<select id="getFinance5" parameterType="Finance" resultType="Finance">
select * from tbl_sys_finance5
<where>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="filename != null and filename != ''">
and filename = #{filename}
</if>
<if test="orderNumber != null and orderNumber != ''">
and order_number like "%${orderNumber}%"
</if>
</where>
ORDER BY create_date DESC,id ASC
</select>
<select id="getAllFilename5" parameterType="String" resultType="String">
SELECT
DISTINCT filename
FROM
tbl_sys_finance5
WHERE creator = #{creator}
ORDER BY create_date DESC
</select>
<insert id="insertForeach5" parameterType="java.util.List">
insert into tbl_sys_finance5 (
id, add_time, supplier,
shopname, kind, kind2,
order_number, filename, count,
number, zhang,remark, creator)
values
<foreach collection="list" item="item" index="index" separator=",">
(
null,#{item.addTime},#{item.supplier},#{item.shopname},#{item.kind},
#{item.kind2},#{item.orderNumber},#{item.filename},#{item.count},#{item.number},
#{item.zhang},#{item.remark},#{item.creator})
</foreach>
</insert>
<select id="checkAccountNumber5" parameterType="String" resultType="String">
SELECT
order_number
FROM
tbl_sys_finance5
WHERE order_number = #{orderNumber}
</select>
<!-- 拼版计算5结束 -->
<!-- 拼版计算6开始 -->
<select id="getFinance6" parameterType="Finance" resultType="Finance">
select * from tbl_sys_finance6
<where>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="filename != null and filename != ''">
and filename = #{filename}
</if>
<if test="orderNumber != null and orderNumber != ''">
and order_number like "%${orderNumber}%"
</if>
</where>
ORDER BY create_date DESC,id ASC
</select>
<select id="getAllFilename6" parameterType="String" resultType="String">
SELECT
DISTINCT filename
FROM
tbl_sys_finance6
WHERE creator = #{creator}
ORDER BY create_date DESC
</select>
<insert id="insertForeach6" parameterType="java.util.List">
insert into tbl_sys_finance6 (
id, add_time, supplier,
shopname, kind, kind2,
order_number, filename, count,
number, zhang,remark, creator)
values
<foreach collection="list" item="item" index="index" separator=",">
(
null,#{item.addTime},#{item.supplier},#{item.shopname},#{item.kind},
#{item.kind2},#{item.orderNumber},#{item.filename},#{item.count},#{item.number},
#{item.zhang},#{item.remark},#{item.creator})
</foreach>
</insert>
<select id="checkAccountNumber6" parameterType="String" resultType="String">
SELECT
order_number
FROM
tbl_sys_finance6
WHERE order_number = #{orderNumber}
</select>
<!-- 拼版计算6结束 -->
<!-- 拼版计算7开始 -->
<select id="getFinance7" parameterType="Finance" resultType="Finance">
select * from tbl_sys_finance7
<where>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="filename != null and filename != ''">
and filename = #{filename}
</if>
<if test="orderNumber != null and orderNumber != ''">
and order_number like "%${orderNumber}%"
</if>
</where>
ORDER BY create_date DESC,id ASC
</select>
<select id="getAllFilename7" parameterType="String" resultType="String">
SELECT
DISTINCT filename
FROM
tbl_sys_finance7
WHERE creator = #{creator}
ORDER BY create_date DESC
</select>
<insert id="insertForeach7" parameterType="java.util.List">
insert into tbl_sys_finance7 (
id, add_time, supplier,
shopname, kind, kind2,
order_number, filename, count,
number, zhang,remark, creator)
values
<foreach collection="list" item="item" index="index" separator=",">
(
null,#{item.addTime},#{item.supplier},#{item.shopname},#{item.kind},
#{item.kind2},#{item.orderNumber},#{item.filename},#{item.count},#{item.number},
#{item.zhang},#{item.remark},#{item.creator})
</foreach>
</insert>
<select id="checkAccountNumber7" parameterType="String" resultType="String">
SELECT
order_number
FROM
tbl_sys_finance7
WHERE order_number = #{orderNumber}
</select>
<!-- 拼版计算7结束 -->
</mapper>
@@ -0,0 +1,46 @@
<?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="lingtao.net.dao.FinanceDifferenceMapper">
<!-- 查询列表 -->
<select id="get" parameterType="FinanceDifference" resultType="FinanceDifference">
select * from tbl_sys_finance_difference
<where>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="filename != null and filename != ''">
and filename = #{filename}
</if>
<if test="orderNumber != null and orderNumber != ''">
and order_number like "%${orderNumber}%"
</if>
</where>
order by create_date DESC
</select>
<select id="getAllFilename" parameterType="String" resultType="String">
SELECT
DISTINCT filename
FROM
tbl_sys_finance_difference
WHERE creator = #{creator}
ORDER BY create_date DESC
</select>
<!-- 批量插入 -->
<insert id="insertForeach" parameterType="java.util.List">
insert into tbl_sys_finance_difference (
id, order_number, shopname,
wangwang, pay_time, price,
remark, taobao_status, open_order_number,
filename, creator)
values
<foreach collection="list" item="item" index="index" separator=",">
(
null,#{item.orderNumber},#{item.shopname},#{item.wangwang},#{item.payTime},
#{item.price},#{item.remark},#{item.taobaoStatus},#{item.openOrderNumber},
#{item.filename},#{item.creator})
</foreach>
</insert>
</mapper>
@@ -0,0 +1,43 @@
<?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="lingtao.net.dao.FinanceExtractMapper">
<!-- 查询列表 -->
<select id="getFinanceExtract" parameterType="FinanceExtract" resultType="FinanceExtract">
select * from tbl_sys_finance_extract
<where>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="filename != null and filename != ''">
and filename = #{filename}
</if>
<if test="orderNumber != null and orderNumber != ''">
and order_number like "%${orderNumber}%"
</if>
</where>
ORDER BY create_date DESC,id ASC
</select>
<select id="getFilename_extract" parameterType="String" resultType="String">
SELECT
DISTINCT filename
FROM
tbl_sys_finance_extract
WHERE creator = #{creator}
ORDER BY create_date DESC
</select>
<!-- 批量插入 -->
<insert id="insertForeach" parameterType="java.util.List">
insert into tbl_sys_finance_extract (
id, order_number, remark, length, width,
height, count, filename, creator,create_date)
values
<foreach collection="list" item="item" index="index" separator=",">
(
null,#{item.orderNumber},#{item.remark},#{item.length},#{item.width},
#{item.height},#{item.count},#{item.filename},#{item.creator},now())
</foreach>
</insert>
</mapper>
@@ -0,0 +1,55 @@
<?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="lingtao.net.dao.FinanceMapper">
<!-- 查询列表 -->
<select id="getFinance" parameterType="Finance" resultType="Finance">
select * from tbl_sys_finance
<where>
<if test="creator != null and creator != ''">
and creator = #{creator}
</if>
<if test="filename != null and filename != ''">
and filename = #{filename}
</if>
<if test="orderNumber != null and orderNumber != ''">
and order_number like "%${orderNumber}%"
</if>
</where>
ORDER BY create_date DESC,id ASC
</select>
<select id="getAllFilename" parameterType="String" resultType="String">
SELECT
DISTINCT filename
FROM
tbl_sys_finance
WHERE creator = #{creator}
ORDER BY create_date DESC
</select>
<!-- 批量插入 -->
<insert id="insertForeach" parameterType="java.util.List">
insert into tbl_sys_finance (
id, add_time, supplier,
shopname, kind, kind2,
order_number, filename, count,
number, zhang,remark, creator)
values
<foreach collection="list" item="item" index="index" separator=",">
(
null,#{item.addTime},#{item.supplier},#{item.shopname},#{item.kind},
#{item.kind2},#{item.orderNumber},#{item.filename},#{item.count},#{item.number},
#{item.zhang},#{item.remark},#{item.creator})
</foreach>
</insert>
<!-- 导入数据前查询数据是否已存在,存在就不插入 -->
<select id="checkAccountNumber" parameterType="String" resultType="String">
SELECT
order_number
FROM
tbl_sys_finance
WHERE order_number = #{orderNumber}
</select>
</mapper>
@@ -0,0 +1,59 @@
<?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="lingtao.net.dao.InformationMapper">
<select id="getInformations" parameterType="Information"
resultType="Information">
SELECT
*
FROM
tbl_information
<where>
<if test="content != null and content != ''">
content like '%${content}%'
</if>
</where>
order by id
</select>
<!-- 获取简答题 -->
<select id="getShortAnswers" resultType="Information">
SELECT
*
FROM
tbl_information
WHERE TYPE = 0
ORDER BY id
</select>
<insert id="addInformation" parameterType="Information">
insert into
tbl_information
(content,type,createBy,createDate)
values
(#{content},#{type},#{createBy},now())
</insert>
<update id="updateInformationById" parameterType="Information">
update tbl_information
<set>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
updateBy = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
updateDate = now(),
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteInformationById">
delete from tbl_information where id = #{id}
</delete>
</mapper>
@@ -0,0 +1,59 @@
<?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="lingtao.net.dao.LoginIpMapper">
<select id="getLoginIpList" parameterType="LoginIp" resultType="LoginIp">
select * from tbl_login_ip
<where>
<if test="agreeIp != null and agreeIp != ''">
and agreeIp like '%${agreeIp}%'
</if>
<if test="remark != null and remark != ''">
and remark like '%${remark}%'
</if>
</where>
order by createDate desc
</select>
<!-- 新增 -->
<insert id="addIp" parameterType="LoginIp">
insert into tbl_login_ip
(agreeIp,remark,createBy,createDate,updateBy,updateTime)
values
(#{agreeIp},#{remark},#{createBy},now(),#{createBy},now())
</insert>
<!-- 修改 -->
<update id="updateIp" parameterType="LoginIp">
update tbl_login_ip
<set>
<if test="agreeIp != null">
agreeIp = #{agreeIp,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
updateBy = #{updateBy,jdbcType=VARCHAR},
</if>
updateTime = now()
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<!-- 删除 -->
<delete id="deleteIpById">
delete from tbl_login_ip where id = #{id}
</delete>
<!-- 批量删除数据 -->
<delete id="deleteBatch" parameterType="int">
<!-- delete from tbl_finance where financeId in(7789,7790) -->
<!-- forEach:用来循环; collection:用来指定循环的数据的类型; 可以填的值有:array,list,map
item:循环中为每个循环的数据指定一个别名; index:循环中循环的下标 ; open:开始; close:结束; separator:数组中元素之间的分隔符 -->
delete from tbl_login_ip where id in
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,17 @@
<?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="lingtao.net.dao.LoginLogMapper">
<select id="getLoginLogList" parameterType="LoginLog" resultType="LoginLog">
select * from tbl_login_log
<where>
<if test="remark != null and remark != ''">
and remark like '%${remark}%'
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
</where>
order by loginTime desc
</select>
</mapper>
+273
View File
@@ -0,0 +1,273 @@
<?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="lingtao.net.dao.MyFileMapper">
<resultMap id="BaseResultMap" type="lingtao.net.bean.MyFile">
<id column="fileId" jdbcType="INTEGER" property="fileId" />
<result column="fileName" jdbcType="VARCHAR" property="fileName" />
<result column="filePath" jdbcType="VARCHAR" property="filePath" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="createBy" jdbcType="VARCHAR" property="createBy" />
<result column="createDate" jdbcType="TIMESTAMP" property="createDate" />
<result column="updateBy" jdbcType="VARCHAR" property="updateBy" />
<result column="updateDate" jdbcType="TIMESTAMP" property="updateDate" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
fileId, fileName, filePath, remark, createBy, createDate, updateBy, updateDate
</sql>
<select id="selectByExample" parameterType="lingtao.net.bean.MyFileExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from tbl_file
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tbl_file
where fileId = #{fileId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tbl_file
where fileId = #{fileId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="lingtao.net.bean.MyFileExample">
delete from tbl_file
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="lingtao.net.bean.MyFile">
insert into tbl_file (fileId, fileName, filePath,
remark, createBy, createDate,
updateBy, updateDate)
values (#{fileId,jdbcType=INTEGER}, #{fileName,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="lingtao.net.bean.MyFile">
insert into tbl_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileId != null">
fileId,
</if>
<if test="fileName != null">
fileName,
</if>
<if test="filePath != null">
filePath,
</if>
<if test="remark != null">
remark,
</if>
<if test="createBy != null">
createBy,
</if>
<if test="createDate != null">
createDate,
</if>
<if test="updateBy != null">
updateBy,
</if>
<if test="updateDate != null">
updateDate,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fileId != null">
#{fileId,jdbcType=INTEGER},
</if>
<if test="fileName != null">
#{fileName,jdbcType=VARCHAR},
</if>
<if test="filePath != null">
#{filePath,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
#{createDate,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
#{updateDate,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="lingtao.net.bean.MyFileExample" resultType="java.lang.Long">
select count(*) from tbl_file
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update tbl_file
<set>
<if test="record.fileId != null">
fileId = #{record.fileId,jdbcType=INTEGER},
</if>
<if test="record.fileName != null">
fileName = #{record.fileName,jdbcType=VARCHAR},
</if>
<if test="record.filePath != null">
filePath = #{record.filePath,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
createBy = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createDate != null">
createDate = #{record.createDate,jdbcType=TIMESTAMP},
</if>
<if test="record.updateBy != null">
updateBy = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.updateDate != null">
updateDate = #{record.updateDate,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update tbl_file
set fileId = #{record.fileId,jdbcType=INTEGER},
fileName = #{record.fileName,jdbcType=VARCHAR},
filePath = #{record.filePath,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
createBy = #{record.createBy,jdbcType=VARCHAR},
createDate = #{record.createDate,jdbcType=TIMESTAMP},
updateBy = #{record.updateBy,jdbcType=VARCHAR},
updateDate = #{record.updateDate,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="lingtao.net.bean.MyFile">
update tbl_file
<set>
<if test="fileName != null">
fileName = #{fileName,jdbcType=VARCHAR},
</if>
<if test="filePath != null">
filePath = #{filePath,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
createBy = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
createDate = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
updateBy = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
updateDate = #{updateDate,jdbcType=TIMESTAMP},
</if>
</set>
where fileId = #{fileId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="lingtao.net.bean.MyFile">
update tbl_file
set fileName = #{fileName,jdbcType=VARCHAR},
filePath = #{filePath,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
createBy = #{createBy,jdbcType=VARCHAR},
createDate = #{createDate,jdbcType=TIMESTAMP},
updateBy = #{updateBy,jdbcType=VARCHAR},
updateDate = #{updateDate,jdbcType=TIMESTAMP}
where fileId = #{fileId,jdbcType=INTEGER}
</update>
<!-- 获取所有的文件信息 -->
<select id="getFileList" parameterType="MyFile" resultMap="BaseResultMap">
SELECT
a.fileId,
a.fileName,
a.filePath
FROM
tbl_file a
<where>
<if test="fileName != null and fileName !='' ">
and fileName like '%${fileName}%'
</if>
</where>
</select>
</mapper>
@@ -0,0 +1,147 @@
<?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="lingtao.net.dao.ProductImgMapper">
<!--获取有上传图片的产品列表 -->
<select id="getProKindList" parameterType="ProductImg"
resultType="ProductImg">
SELECT
id,
pro_type_value,
pro_type_label,
kind_value,
kind_label,
kind2_value,
kind2_label,
remark,
create_date
FROM
product_img
<where>
<if test="proTypeLabel != null and proTypeLabel !=''">
pro_type_label like "%${proTypeLabel}%"
</if>
</where>
ORDER BY pro_type_value,kind_value
</select>
<update id="updateImgUploadRemark" parameterType="ProductImg">
update product_img
set remark = #{remark}
where id = #{id}
</update>
<!--根据value获取label -->
<select id="getLabel" parameterType="ProductImg"
resultType="SysDictProduct">
SELECT DISTINCT pro_type_label,kind_label,kind2_label FROM
sys_dict_product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
<if test="kind2Value != null and kind2Value != ''">
and kind2_value = #{kind2Value}
</if>
</where>
</select>
<!--新增图片信息 -->
<insert id="addImgUrl" useGeneratedKeys="true" keyProperty="id"
parameterType="ProductImg">
insert into product_img
(
pro_type_value,pro_type_label,
<if test="kindValue != null and kindValue !=''">
kind_value,
</if>
<if test="kindLabel != null and kindLabel !=''">
kind_label,
</if>
<if test="kind2Value != null and kind2Value !=''">
kind2_value,
</if>
<if test="kind2Label != null and kind2Label !=''">
kind2_label,
</if>
img_url,
remark,
filename
)
values
(
#{proTypeValue},#{proTypeLabel},
<if test="kindValue != null and kindValue !=''">
#{kindValue},
</if>
<if test="kindLabel != null and kindLabel !=''">
#{kindLabel},
</if>
<if test="kind2Value != null and kind2Value !=''">
#{kind2Value},
</if>
<if test="kind2Label != null and kind2Label !=''">
#{kind2Label},
</if>
#{imgUrl},
#{remark},
#{filename}
)
</insert>
<!-- 获取所有的产品 -->
<select id="findAllPro" resultType="SysDictProduct">
SELECT DISTINCT pro_type_label,
pro_type_value
FROM sys_dict_product
WHERE pro_type_label IS NOT NULL
</select>
<!--根据种类获取材质-->
<select id="getKindsByPro" resultType="SysDictProduct">
SELECT distinct kind_value,
kind_label
FROM sys_dict_product
WHERE pro_type_value = #{proTypeValue}
</select>
<!--根据材质获取规格-->
<select id="getKind2sByKind" resultType="SysDictProduct">
SELECT distinct
kind2_value,
kind2_label
FROM
sys_dict_product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
</where>
</select>
<!--轮播图/回显 根据条件获取产品图片-->
<select id="getImgsByProKind" parameterType="Product" resultType="ProductImg">
select id,img_url,remark,filename,img_width,img_height
from product_img
<where>
<if test="proTypeValue != null and proTypeValue != '' ">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != '' ">
and kind_value = #{kindValue}
</if>
<if test="kind2Value != null and kind2Value != '' ">
and kind2_value = #{kind2Value}
</if>
<if test="craftValue != null and craftValue != '' ">
and craft_value = #{craftValue}
</if>
</where>
</select>
</mapper>
+328
View File
@@ -0,0 +1,328 @@
<?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="lingtao.net.dao.ProductMapper">
<select id="getProductList" parameterType="Product" resultType="Product">
SELECT
*
FROM
product
<where>
<if test="proTypeLabel != null and proTypeLabel !=''">
and pro_type_label like "%${proTypeLabel}%"
</if>
</where>
</select>
<update id="updatePriceById" parameterType="Product">
UPDATE
product
<set>
updater = #{updater},
update_date = now(),
<if test="count != null">
count = #{count,jdbcType=INTEGER},
</if>
<if test="price != null">
price = #{price,jdbcType=DOUBLE},
</if>
<if test="priceMultiple != null">
price_multiple = #{priceMultiple},
</if>
<if test="weight != null">
weight = #{weight},
</if>
</set>
WHERE
pro_id = #{proId}
</update>
<!-- 获取所有的产品种类 -->
<select id="findAllPro" resultType="Product">
SELECT DISTINCT
pro_type_label,
pro_type_value
FROM
sys_dict_product
WHERE pro_type_label IS NOT NULL
</select>
<!-- 根据产品种类,获取品种 -->
<select id="getKindsByPro" parameterType="String" resultType="Product">
SELECT
kind_value,
kind_label
FROM
sys_dict_product
WHERE
pro_type_value = #{proTypeValue}
ORDER BY kind_value ASC
</select>
<!-- 价格计算 -->
<select id="getThanPrice" parameterType="Product" resultType="Product">
SELECT
COUNT, price, price_multiple, discount_price discountPrice,kind_label,weight
FROM
product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
<if test="kind1Value != null and kind1Value != ''">
and kind1_value = #{kind1Value}
</if>
<if test="kind2Value != null and kind2Value != ''">
and kind2_value = #{kind2Value}
</if>
<if test="length != null and length != ''">
and length = #{length}
</if>
<if test="width != null and width != ''">
and width = #{width}
</if>
<if test="count != null and count != ''">
and count >= #{count}
ORDER BY count
</if>
</where>
LIMIT 4
</select>
<!-- 慕斯垫价格计算 -->
<select id="getMsdPrice" parameterType="Product" resultType="Product">
SELECT
COUNT, price, price_multiple, discount_price discountPrice,kind_label,weight
FROM
product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="(kindValue != null and kindValue != '') or (kind1Value != null and kind1Value != '') or (kind2Value != null and kind2Value != '')">
and (kind_value = #{kindValue} or kind1_value = #{kindValue} or kind2_value = #{kindValue})
</if>
<if test="count != null and count != ''">
and count >= #{count}
</if>
</where>
LIMIT 4
</select>
<!--优惠券大于5位计算 1万以内(数据库中是单价)=====(单价*位数)-->
<select id="couponThanPrice" parameterType="Product" resultType="Product">
SELECT
COUNT,
(price * #{num}) price,
price_multiple
FROM
product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
<if test="count != null and count != ''">
and count >= #{count}
</if>
</where>
</select>
<!--优惠券5位以上数量1万以上价格======(单价*位数) * 1万的倍数-->
<select id="couponThousandThanPrice" parameterType="Product" resultType="Product">
SELECT
#{count} count,
(price * #{num}) * #{count}/10000 price,
price_multiple
FROM
product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
<if test="count != null and count != ''">
and count = 10000
</if>
</where>
LIMIT 4
</select>
<!-- 腰封/吊旗标识,比优惠券贵10元/位 1万以内====(优惠券单价+10) * 位数-->
<select id="hangingFlagsThanPrice" parameterType="Product" resultType="Product">
SELECT
COUNT,
((price+ #{p}) * #{num}) price,
price_multiple
FROM
product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
<if test="count != null and count != ''">
and count >= #{count}
</if>
</where>
LIMIT 4
</select>
<!-- 腰封/吊旗标识,比优惠券贵10元/位,数量1万以上====((单价+10)*位数) * 1万的倍数-->
<select id="hangingFlagsThousandThanPrice" parameterType="Product" resultType="Product">
SELECT
#{count} count,
((price+ #{p}) * #{num}) * #{count}/10000 price,
price_multiple
FROM
product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
<if test="count != null and count != ''">
and count = 10000
</if>
</where>
LIMIT 4
</select>
<!--吊旗/宣传单6-9位数以上价格计算(同 couponThanPrices-->
<select id="couponThanPrices" parameterType="Product" resultType="Product">
SELECT
COUNT,
((price + #{p}) * #{num}) price,
price_multiple
FROM
product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
<if test="kind2Value != null and kind2Value != ''">
and kind2_value = #{kind2Value}
</if>
<if test="count != null and count != ''">
and count >= #{count}
</if>
</where>
LIMIT 4
</select>
<!--吊旗/宣传单5位数以上价格计算(同 couponThanPrice-->
<select id="diaoqiThanPrice" parameterType="Product" resultType="Product">
SELECT
COUNT,
(price * #{num}) price,
price_multiple
FROM
product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
<if test="kind2Value != null and kind2Value != ''">
and kind2_value = #{kind2Value}
</if>
<if test="count != null and count != ''">
and count >= #{count}
</if>
</where>
LIMIT 4
</select>
<!--便签本联单/稿纸超过1千数量的价格-数据库是单价,不用除1000-->
<select id="notePaperPrice" parameterType="Product" resultType="Product">
SELECT
(1 * #{count}) count,
a.price price,
a.price_multiple price_multiple
FROM
(SELECT
price,
price_multiple
FROM
product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
<if test="kind2Value != null and kind2Value != ''">
and kind2_value = #{kind2Value}
</if>
<if test="count != null and count != ''">
and count = 1000) a
</if>
</where>
</select>
<!--优惠券、吊旗、腰封;便签本彩胶纸/红头文件;扇子;超过1万数量的价格;扇子超过1万数量的重量-->
<select id="thanThousandPrice" parameterType="Product" resultType="Product">
SELECT
(1 * #{count}) count,
(a.price * #{count}) price,
price_multiple,
(a.weight * #{count}) weight
FROM
(SELECT
(price / 10000) price,
price_multiple,
(weight / 10000) weight
FROM
product
<where>
<if test="proTypeValue != null and proTypeValue != ''">
and pro_type_value = #{proTypeValue}
</if>
<if test="kindValue != null and kindValue != ''">
and kind_value = #{kindValue}
</if>
<if test="kind1Value != null and kind1Value != ''">
and kind1_value = #{kind1Value}
</if>
<if test="kind2Value != null and kind2Value != ''">
and kind2_value = #{kind2Value}
</if>
<if test="count != null and count != ''">
and count = 10000) a
</if>
</where>
</select>
<!-- 根据关键字搜索菜单 -->
<select id="searchPro" resultType="sysDictSearchPro">
SELECT
pro_type_label,url
FROM
sys_dict_search_pro
WHERE
like_pro_type_label LIKE '%${likeProTypeLabel}%'
AND
status = 1
</select>
<!-- 价格导入 -->
<insert id="insertSelective" parameterType="Product">
insert into product (length,width,count,price,kind_value,kind_label,pro_type_value,pro_type_label)
values (#{length},#{width},#{count},#{price},#{kindValue},#{kindLabel},#{proTypeValue},#{proTypeLabel})
</insert>
</mapper>
@@ -0,0 +1,96 @@
<?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="lingtao.net.dao.QuestionMapper">
<select id="questions" parameterType="Question"
resultType="Question">
SELECT
*
FROM
tbl_question
<where>
<if test="question != null and question != ''">
question like '%${question}%'
</if>
<if test="type != null and type != ''">
type = #{type}
</if>
</where>
order by createDate desc
</select>
<!-- 获取单选题 -->
<select id="getSingleQuestions" resultType="Question">
SELECT
*
FROM
tbl_question
where type = 0
ORDER BY id ASC
</select>
<!-- 获取多选题 -->
<select id="getMultipleQuestions" resultType="Question">
SELECT
*
FROM
tbl_question
where type = 1
ORDER BY id ASC
</select>
<!-- 获取填空题 -->
<select id="getFillQuestions" resultType="Question">
SELECT
*
FROM
tbl_question
where type = 2
ORDER BY id ASC
</select>
<insert id="addQuestion" parameterType="Question">
insert into tbl_question
(question,answer1,answer2,answer3,answer4,answer,type,ansCount,createBy,createDate)
values
(#{question},#{answer1},#{answer2},#{answer3},#{answer4},#{answer},#{type},#{ansCount},#{createBy},now())
</insert>
<update id="updateQuestionById" parameterType="Question">
update tbl_question
<set>
<if test="question != null">
question = #{question,jdbcType=VARCHAR},
</if>
<if test="answer1 != null">
answer1 = #{answer1,jdbcType=VARCHAR},
</if>
<if test="answer2 != null">
answer2 = #{answer2,jdbcType=VARCHAR},
</if>
<if test="answer3 != null">
answer3 = #{answer3,jdbcType=VARCHAR},
</if>
<if test="answer4 != null">
answer4 = #{answer4,jdbcType=VARCHAR},
</if>
<if test="answer != null">
answer = #{answer,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="ansCount != null">
ansCount = #{ansCount,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
updateBy = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
updateDate = now(),
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteQuestionById">
delete from tbl_question where id = #{id}
</delete>
</mapper>
@@ -0,0 +1,414 @@
<?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="lingtao.net.dao.QuoteDataMapper">
<select id="quoteDatas" parameterType="QuoteData" resultType="QuoteData">
SELECT
*,
b.`role`
FROM
tbl_quote_data a
LEFT JOIN
tbl_sys_user b
ON
a.`username` = b.`username`
<where>
<!-- 只有一个店铺或者搜索店铺的时候 -->
<if test="roleSearch != null and roleSearch != ''">
and b.role like '%${roleSearch}%'
</if>
<!-- 没有条件查询,默认查出所有的店铺数据 -->
<if test = "roleArr != null and roleArr != '' " >
and b.role in
<foreach collection="roleArr" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<foreach collection="roleArr" item="item">
or b.role like '%${item}%'
</foreach>
</if>
<!-- 有条件查询,查出拥有的店铺以及条件数据 -->
<if test = "roleSearchArr != null and roleSearchArr != '' " >
and (
<foreach collection="roleSearchArr" item="item" separator="or">
b.role like '%${item}%'
</foreach>
)
</if>
<if test="realname !=null and realname != '' ">
and a.realname like '%${realname}%'
</if>
<if test="remark !=null and remark != '' ">
and remark like '%${remark}%'
</if>
<if test="wangwang !=null and wangwang != '' ">
and wangwang like '%${wangwang}%'
</if>
<if test="price !=null and price != '' ">
and price >= #{price}
</if>
<if test="isBuy != null and isBuy != ''">
and isBuy = #{isBuy}
</if>
<if test="isBuyToDay != null and isBuyToDay != ''">
and isBuyToDay = #{isBuyToDay}
</if>
<if test="isSelect != null and isSelect != ''">
and isSelect = #{isSelect}
</if>
<if test="isFillIn != null and isFillIn != ''">
and isFillIn = #{isFillIn}
</if>
<if test="proTypeLabel !=null and proTypeLabel != '' ">
and proTypeLabel = #{proTypeLabel}
</if>
<if test="orderNumber !=null and orderNumber != '' ">
and orderNumber like '%${orderNumber}%'
</if>
<if test="commentManager !=null and commentManager != '' ">
and commentManager like '%${commentManager}%'
</if>
<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
</if>
<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
<![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
</if>
<if test="isSelfShop != null and isSelfShop != ''">
and b.role NOT LIKE '%1010%'
AND b.role NOT LIKE '%1021%'
AND b.role NOT LIKE '%1022%'
AND b.role NOT LIKE '%1023%'
AND b.role NOT LIKE '%1024%'
AND b.role NOT LIKE '%1025%'
AND b.role NOT LIKE '%1016%'
AND b.role NOT LIKE '%1018%'
</if>
</where>
ORDER BY id DESC
</select>
<insert id="addQuoteData" parameterType="QuoteData">
INSERT INTO tbl_quote_data
(id,username,realname,role,shopname,price,isBuy,isBuyToDay,remark,remarkJudge,quoteTime,isSelect,isFillIn,wangwang,proTypeLabel)
VALUES
(NULL,#{username},#{realname},#{role},#{shopname},#{price},#{isBuy},#{isBuyToDay},#{remark},#{remarkJudge},now(),#{isSelect},#{isFillIn},#{wangwang},#{proTypeLabel})
</insert>
<update id="updateById" parameterType="QuoteData">
UPDATE
tbl_quote_data
<set>
<if test="commentManager != null and commentManager != ''">
commentManager = #{commentManager},
commentManagerDate = now(),
</if>
<if test="price != null and price != ''">
price = #{price},
</if>
<if test="buyPrice != null and buyPrice != ''">
buyPrice = #{buyPrice},
</if>
<if test="wangwang != null and wangwang != ''">
wangwang = #{wangwang},
isFillIn = #{isFillIn},
fillInDate = now(),
</if>
<if test="commentSelf != null and commentSelf != ''">
commentSelf = #{commentSelf},
commentSelfDate = now(),
</if>
</set>
WHERE
id = #{id}
</update>
<!-- 改变当天成交状态 -->
<update id="changeIsBuyToDay">
UPDATE
tbl_quote_data
SET
isBuyToDay =
CASE
WHEN
isBuyToDay = '1'
THEN
'0'
ELSE
'1'
END,
isBuyToDayDate = now()
WHERE id = #{id}
</update>
<!-- 店长改变成交状态 -->
<update id="changeIsBuy">
UPDATE
tbl_quote_data
SET
isBuy =
CASE
WHEN
isBuy = '1'
THEN
'0'
ELSE
'1'
END,
buyDate = now()
WHERE id = #{id}
</update>
<!-- 查询3分钟内的数据 -->
<select id="getQuoteDataByMinutes" parameterType="String" resultType="String">
SELECT
remarkJudge
FROM
tbl_quote_data
WHERE id >
(SELECT
id - 10
FROM
tbl_quote_data
WHERE quoteTime > DATE_SUB(NOW(), INTERVAL 3 MINUTE)
LIMIT 1)
AND
quoteTime > DATE_SUB(NOW(), INTERVAL 3 MINUTE)
AND
username = #{username}
</select>
<select id="getShopName" resultType="String">
SELECT
DISTINCT shopname FROM tbl_quote_data
WHERE
shopname != ""
<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
</if>
<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
<![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
</if>
ORDER BY -shopname DESC
</select>
<!-- 根据店铺查找人员 -->
<select id="getRealnames" parameterType="String" resultType="String">
SELECT DISTINCT
a.realname
FROM
tbl_quote_data a
LEFT JOIN tbl_sys_user b
ON a.`username` = b.`username`
WHERE b.role LIKE '%${shopname}%'
AND b.userStatus = '1'
</select>
<!-- 根据店铺查找报价数据 -->
<select id="getEchartList" parameterType="QuoteData" resultType="QuoteData">
SELECT
t.alldata,
t.allBuy,
t.alldata - t.allBuy allNotBuy,
t.todayBuy,
t.allBuy - t.todayBuy notTodayBuy,
t.todayBuyPrice + t.notTodayBuyPrice allBuyPrice,
t.todayBuyPrice,
t.notTodayBuyPrice,
t.allBuy / t.alldata allBuyPercentage
FROM
(SELECT
COUNT(*) alldata,
(SELECT
COUNT(*)
FROM
(SELECT
COUNT(*)
FROM
tbl_quote_data
WHERE (isBuyToDay = "1"
OR isBuy = "1")
<if test="shopname !=null and shopname != '' and shopname != '999'">
AND shopname = #{shopname}
</if>
<if test="realname !=null and realname != '' ">
AND realname = #{realname}
</if>
<if test="proTypeLabel !=null and proTypeLabel != '' ">
AND proTypeLabel = #{proTypeLabel}
</if>
<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
</if>
<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
<![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
</if>
AND price >= 300
GROUP BY wangwang) b) allBuy,
(SELECT
COUNT(*)
FROM
(SELECT
COUNT(*)
FROM
tbl_quote_data
WHERE isBuyToDay = "1"
<if test="shopname !=null and shopname != '' and shopname != '999'">
AND shopname = #{shopname}
</if>
<if test="realname !=null and realname != '' ">
AND realname = #{realname}
</if>
<if test="proTypeLabel !=null and proTypeLabel != '' ">
AND proTypeLabel = #{proTypeLabel}
</if>
<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
</if>
<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
<![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
</if>
AND price >= 300
GROUP BY wangwang) b) todayBuy,
(SELECT
ROUND(SUM(IFNULL(price, 0)), 2)
FROM
(SELECT
price
FROM
tbl_quote_data
WHERE isBuyToDay = "1"
<if test="shopname !=null and shopname != '' and shopname != '999'">
AND shopname = #{shopname}
</if>
<if test="realname !=null and realname != '' ">
AND realname = #{realname}
</if>
<if test="proTypeLabel !=null and proTypeLabel != '' ">
AND proTypeLabel = #{proTypeLabel}
</if>
<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
</if>
<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
<![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
</if>
AND price >= 300
GROUP BY wangwang) b) todayBuyPrice,
(SELECT
IFNULL(ROUND(SUM(IFNULL(buyPrice, 0)), 2), 0)
FROM
(SELECT
buyPrice
FROM
tbl_quote_data
WHERE isBuy = "1"
AND isBuyToDay = "0"
<if test="shopname !=null and shopname != '' and shopname != '999'">
AND shopname = #{shopname}
</if>
<if test="realname !=null and realname != '' ">
AND realname = #{realname}
</if>
<if test="proTypeLabel !=null and proTypeLabel != '' ">
AND proTypeLabel = #{proTypeLabel}
</if>
<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
</if>
<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
<![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
</if>
AND buyPrice >= 300
GROUP BY wangwang) b) notTodayBuyPrice
FROM
(SELECT
COUNT(*),
realname,
shopname
FROM
tbl_quote_data a
WHERE 1 = 1
<if test="shopname !=null and shopname != '' and shopname != '999'">
AND shopname = #{shopname}
</if>
<if test="realname !=null and realname != '' ">
AND realname = #{realname}
</if>
<if test="proTypeLabel !=null and proTypeLabel != '' ">
AND proTypeLabel = #{proTypeLabel}
</if>
<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
</if>
<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
<![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
</if>
AND price >= 300
AND isFillin = '1'
GROUP BY wangwang) tab) t
</select>
<!-- 根据店铺查找客服流失数据 -->
<select id="getKefuEchartList" parameterType="QuoteData" resultType="QuoteData">
SELECT
t.alldata,
t.allBuy,
t.alldata - t.allBuy t.notBuy
FROM
(SELECT
COUNT(*) alldata,
(SELECT
COUNT(*)
FROM
(SELECT
COUNT(*)
FROM
tbl_quote_data
WHERE (isBuyToDay = "1"
OR isBuy = "1")
<if test="shopname !=null and shopname != '' and shopname != '999'">
AND shopname = #{shopname}
</if>
<if test="realname !=null and realname != '' ">
AND realname = #{realname}
</if>
<if test="proTypeLabel !=null and proTypeLabel != '' ">
AND proTypeLabel = #{proTypeLabel}
</if>
<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
</if>
<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
<![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
</if>
AND price >= 200
GROUP BY wangwang) b) allBuy
FROM
(SELECT
COUNT(*),
realname,
shopname
FROM
tbl_quote_data a
WHERE 1 = 1
<if test="shopname !=null and shopname != '' and shopname != '999'">
AND shopname = #{shopname}
</if>
<if test="realname !=null and realname != '' ">
AND realname = #{realname}
</if>
<if test="proTypeLabel !=null and proTypeLabel != '' ">
AND proTypeLabel = #{proTypeLabel}
</if>
<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
</if>
<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
<![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
</if>
AND price >= 200
AND isFillin = '1'
GROUP BY wangwang,realname) tab) t
</select>
</mapper>
@@ -0,0 +1,67 @@
<?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="lingtao.net.dao.QuoteLogMapper">
<select id="quoteLogs" parameterType="QuoteLog" resultType="QuoteLog">
SELECT
quoteId,
quoteTime,
quoteIp,
realname,
remark,
brower,
os,
shopname
FROM
tbl_quote_log
where
quoteId > 1600000
<if test="realname !=null and realname != '' ">
and realname like '%${realname}%'
</if>
<if test="remark !=null and remark != '' ">
and remark like '%${remark}%'
</if>
<if test="shopname !=null and shopname != '' ">
and shopname like '%${shopname}%'
</if>
<if test="price !=null and price != '' ">
and price >= #{price}
</if>
<if test="quoteTimeBegin !=null and quoteTimeBegin != '' ">
<![CDATA[and quoteTime >= #{quoteTimeBegin} ]]>
</if>
<if test="quoteTimeEnd !=null and quoteTimeEnd != '' ">
<![CDATA[and quoteTime <= #{quoteTimeEnd} ]]>
</if>
ORDER BY quoteId DESC
</select>
<insert id="insertSelective" parameterType="QuoteLog">
INSERT INTO tbl_quote_log
(
quoteId,
quoteIp,
os,
realname,
username,
brower,
remark,
shopname,
price
)
VALUES
(
NULL,
#{quoteIp},
#{os},
#{realname},
#{username},
#{brower},
#{remark},
#{shopname},
#{price}
)
</insert>
</mapper>
@@ -0,0 +1,72 @@
<?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="lingtao.net.dao.SysDictSearchProMapper">
<select id="keyWordsList" parameterType="SysDictSearchPro" resultType="SysDictSearchPro">
SELECT
*
FROM
sys_dict_search_pro
<where>
<if test="proTypeLabel !=null and proTypeLabel != '' ">
pro_type_label like '%${proTypeLabel}%'
</if>
</where>
</select>
<insert id="insertSelective" parameterType="SysDictSearchPro">
INSERT INTO sys_dict_search_pro
(
id,
pro_type_label,
like_pro_type_label,
url,
status,
creator,
createDate
)
VALUES
(
NULL,
#{proTypeLabel},
#{likeProTypeLabel},
#{url},
#{status},
#{creator},
now()
)
</insert>
<update id="updateKeyWordById" parameterType="SysDictSearchPro">
UPDATE
sys_dict_search_pro
SET
<if test="likeProTypeLabel != null and likeProTypeLabel != ''">
like_pro_type_label = #{likeProTypeLabel},
</if>
<if test="url != null and url != ''">
url = #{url},
</if>
updateDate = now(),
updater = #{updater}
WHERE
id = #{id}
</update>
<!-- 改变关键字状态 -->
<update id="changeKeyWordStatus">
UPDATE
sys_dict_search_pro
SET
status =
CASE
WHEN
status = '1'
THEN
'0'
ELSE
'1'
END
WHERE id = #{id}
</update>
</mapper>
@@ -0,0 +1,60 @@
<?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="lingtao.net.dao.SysPermissionMapper">
<resultMap id="BaseResultMap" type="lingtao.net.bean.SysPermission">
<id column="perId" jdbcType="INTEGER" property="perId" />
<result column="perName" jdbcType="VARCHAR" property="perName" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="perCode" jdbcType="VARCHAR" property="perCode" />
<result column="perIcon" jdbcType="VARCHAR" property="perIcon" />
<result column="parentId" jdbcType="INTEGER" property="parentId" />
<result column="orderNo" jdbcType="VARCHAR" property="orderNo" />
<result column="createBy" jdbcType="VARCHAR" property="updateBy" />
<result column="createDate" jdbcType="TIMESTAMP" property="createDate" />
</resultMap>
<select id="getAll" resultMap="BaseResultMap">
select * from tbl_sys_permission
</select>
<select id="getParentPers" resultMap="perMap">
select * from tbl_sys_permission where parentId is null
</select>
<resultMap id="perMap" type="SysPermission" autoMapping="true">
<id column="perId" property="perId"></id>
<collection property="children" javaType="java.util.List" ofType="SysPermission" column="perId" select="getByParentId"></collection>
</resultMap>
<!--查询二级权限-->
<select id="getByParentId" parameterType="int" resultMap="perMap002">
select * from tbl_sys_permission where parentId = #{perId}
</select>
<!--查询三级权限-->
<resultMap id="perMap002" type="SysPermission" autoMapping="true">
<id column="perId" property="perId"></id>
<collection property="children" javaType="java.util.List" ofType="SysPermission" column="perId" select="getThird"></collection>
</resultMap>
<select id="getThird" parameterType="int" resultType="SysPermission">
select * from tbl_sys_permission where parentId = #{perId}
</select>
<!-- 根据登陆的用户查询权限 -->
<select id="getPersByUserId" parameterType="int" resultType="SysPermission">
SELECT
*
FROM
tbl_sys_permission
WHERE perId IN
( SELECT
perId
FROM
tbl_sys_role_permission
WHERE
roleId in (
select roleId from tbl_sys_user_role where userId = #{userId}
)
)
ORDER BY -orderNo DESC
</select>
</mapper>
+124
View File
@@ -0,0 +1,124 @@
<?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="lingtao.net.dao.SysRoleMapper">
<resultMap id="BaseResultMap" type="lingtao.net.bean.SysRole">
<id column="roleId" jdbcType="INTEGER" property="roleId" />
<result column="roleName" jdbcType="VARCHAR" property="roleName" />
<result column="isRegist" jdbcType="VARCHAR" property="isRegist" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="createBy" jdbcType="VARCHAR" property="createBy" />
<result column="createDate" jdbcType="TIMESTAMP" property="createDate" />
<result column="updateBy" jdbcType="VARCHAR" property="updateBy" />
<result column="updateDate" jdbcType="TIMESTAMP" property="updateDate" />
</resultMap>
<!-- 查询角色拥有的权限 -->
<select id="getPerIdsByRoleId" parameterType="int" resultType="int">
select perId from tbl_sys_role_permission where roleId = #{roleId}
</select>
<!-- 删除角色拥有的权限 -->
<delete id="deleteRolePermissions" parameterType="int">
delete from tbl_sys_role_permission where roleId = #{roleId}
</delete>
<!-- 给角色授权 -->
<insert id="addRolePermissions">
insert into tbl_sys_role_permission(roleId,perId)
values
<foreach collection="perIds" item="item" separator=",">
(#{roleId},#{item})
</foreach>
</insert>
<!-- 获取所有角色 -->
<select id="getRoles" parameterType="SysRole" resultMap="BaseResultMap">
select * from tbl_sys_role
<where>
<if test="roleName != null and roleName != ''">
and roleName like '%${roleName}%'
</if>
</where>
order by isRegist
</select>
<!-- 改变与用户状态 -->
<update id="changeRoleStatus" parameterType="String">
UPDATE
tbl_sys_role
SET
isRegist =
CASE
WHEN
isRegist = '1'
THEN
'0'
ELSE
'1'
END
WHERE roleId = #{roleId}
</update>
<insert id="insertSelective" parameterType="lingtao.net.bean.SysRole">
INSERT INTO tbl_sys_role
(
roleId,
roleName,
isRegist,
remark,
createBy,
createDate
)
VALUES
(
NULL,
#{roleName},
#{isRegist},
#{remark},
#{createBy},
now()
)
</insert>
<update id="updateByPrimaryKeySelective" parameterType="lingtao.net.bean.SysRole">
update
tbl_sys_role
set
roleName = #{roleName,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
updateDate = now()
where
roleId = #{roleId,jdbcType=INTEGER}
</update>
<!-- 删除角色 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tbl_sys_role
where roleId = #{roleId,jdbcType=INTEGER}
</delete>
<!-- 查询角色,把角色ID转成文字 -->
<!-- 查询可以被注册的角色 -->
<select id="getAllRoleName" resultMap="BaseResultMap">
SELECT
roleId,roleName
FROM
tbl_sys_role
<where>
<if test="isRegist != null and isRegist != '' ">
isRegist = #{isRegist}
</if>
</where>
ORDER BY
roleId ASC
</select>
<!-- 查询出用户所拥有的且允许被创建的角色 -->
<select id="getRolesByUserId" parameterType="int" resultType="SysRole">
select * from tbl_sys_role where isRegist != '0' and roleId in (
<!-- 查询用户拥有的角色 -->
select roleId from tbl_sys_user_role where userId = #{userId}
)
</select>
</mapper>
+246
View File
@@ -0,0 +1,246 @@
<?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="lingtao.net.dao.SysUserMapper">
<resultMap id="BaseResultMap" type="lingtao.net.bean.SysUser">
<id column="userId" jdbcType="INTEGER" property="userId" />
<result column="realname" jdbcType="VARCHAR" property="realname" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="userStatus" jdbcType="VARCHAR" property="userStatus" />
<result column="role" jdbcType="VARCHAR" property="role" />
<result column="sysStatus" jdbcType="VARCHAR" property="sysStatus" />
<result column="needIp" jdbcType="VARCHAR" property="needIp" />
<result column="createBy" jdbcType="VARCHAR" property="createBy" />
<result column="createDate" jdbcType="TIMESTAMP" property="createDate" />
<result column="updateBy" jdbcType="VARCHAR" property="updateBy" />
<result column="updateDate" jdbcType="TIMESTAMP" property="updateDate" />
</resultMap>
<!-- 根据用户名查询用户 -->
<!-- <select id="getUserByUsername" parameterType="String" resultMap="BaseResultMap">
select * from tbl_sys_user where username = #{username}
</select> -->
<!-- 获取用户 -->
<select id="getUsers" parameterType="SysUser" resultMap="BaseResultMap">
select * from tbl_sys_user
<where>
<if test="username != null and username != ''">
and username like '%${username}%'
</if>
<if test="realname != null and realname != ''">
and realname like '%${realname}%'
</if>
<if test="userStatus != null and userStatus != ''">
and userStatus = #{userStatus}
</if>
<if test="roleSearch != null and roleSearch != ''">
and role like '%${roleSearch}%'
</if>
<if test = "roleArr != null and roleArr != '' " >
and role in
<foreach collection="roleArr" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<foreach collection="roleArr" item="item">
or role like '%${item}%'
</foreach>
</if>
</where>
ORDER BY userId DESC
</select>
<!-- 改变用户启用状态 -->
<update id="changeUserStatus">
UPDATE
tbl_sys_user
SET
userStatus =
CASE
WHEN
userStatus = '1'
THEN
'0'
ELSE
'1'
END,
sysStatus = CASE WHEN sysStatus = '2' THEN '0' ElSE '2' END
WHERE userId = #{userId}
</update>
<!-- 改变用户系统状态 -->
<update id="changeSysStatus">
UPDATE
tbl_sys_user
SET
sysStatus =
CASE
WHEN
sysStatus = '2'
THEN
'1'
ELSE
'2'
END
WHERE userId = #{userId}
</update>
<!-- 改变所有用户的Ip状态 -->
<update id="changeNeedIp">
UPDATE
tbl_sys_user
SET
needIp =
CASE
WHEN needIp = '1'
THEN '0'
WHEN needIp = '0'
THEN '1'
ELSE '2'
END
</update>
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="userId" parameterType="lingtao.net.bean.SysUser">
insert into tbl_sys_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="realname != null">
realname,
</if>
<if test="username != null">
username,
</if>
<if test="password != null">
password,
</if>
<if test="userStatus != null">
userStatus,
</if>
<if test="role != null">
role,
</if>
<if test="sysStatus != null">
sysStatus,
</if>
<if test="needIp != null">
needIp,
</if>
<if test="createBy != null">
createBy,
</if>
<if test="createDate != null">
createDate,
</if>
<if test="updateBy != null">
updateBy,
</if>
<if test="updateDate != null">
updateDate,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="realname != null">
#{realname,jdbcType=VARCHAR},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="userStatus != null">
#{userStatus,jdbcType=VARCHAR},
</if>
<if test="role != null">
#{role,jdbcType=VARCHAR},
</if>
<if test="sysStatus != null">
#{sysStatus,jdbcType=VARCHAR},
</if>
<if test="needIp != null">
#{needIp,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
#{createDate,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
#{updateDate,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="lingtao.net.bean.SysUser">
update tbl_sys_user
<set>
<if test="realname != null">
realname = #{realname,jdbcType=VARCHAR},
</if>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="userStatus != null">
userStatus = #{userStatus,jdbcType=VARCHAR},
</if>
<if test="role != null">
role = #{role,jdbcType=VARCHAR},
</if>
<if test="sysStatus != null">
sysStatus = #{sysStatus,jdbcType=VARCHAR},
</if>
<if test="needIp != null">
needIp = #{needIp,jdbcType=VARCHAR},
</if>
<if test="birthDay != null">
birthDay = #{birthDay,jdbcType=VARCHAR},
</if>
<if test="birthType != null">
birthType = #{birthType,jdbcType=VARCHAR},
</if>
<if test="isBirthDay != null">
isBirthDay = #{isBirthDay,jdbcType=INTEGER},
</if>
<if test="entryDate != null">
entryDate = #{entryDate,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
createBy = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
createDate = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
updateBy = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
updateDate = #{updateDate,jdbcType=TIMESTAMP},
</if>
</set>
where userId = #{userId,jdbcType=INTEGER}
</update>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tbl_sys_user
where userId = #{userId,jdbcType=INTEGER}
</delete>
<select id="deleteUserRoles">
delete from tbl_sys_user_role where userId = #{userId}
</select>
<insert id="addUserRoles">
insert into tbl_sys_user_role(userId, roleId)
values
<foreach collection="roleIds" item="item" separator=",">
(#{userId},#{item})
</foreach>
</insert>
</mapper>
@@ -0,0 +1,46 @@
<?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="lingtao.net.dao.UpdateLogMapper">
<select id="getUpdateLogs" parameterType="UpdateLog"
resultType="UpdateLog">
SELECT
*
FROM
tbl_update_log
<where>
<if test="content != null and content != ''">
content like '%${content}%'
</if>
<if test="add_time_begin != null and add_time_begin != ''">
<![CDATA[ and addTime >= #{add_time_begin}]]>
</if>
<if test="add_time_end != null and add_time_end != ''">
<![CDATA[ and addTime <= #{add_time_end} ]]>
</if>
</where>
order by addTime desc
</select>
<insert id="addLog" parameterType="UpdateLog">
insert into tbl_update_log
(content,addTime,createBy,createDate)
values
(#{content},#{addTime},#{createBy},now())
</insert>
<update id="updateLogById">
update tbl_update_log
<set>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteLogById" parameterType="java.lang.Integer">
delete from tbl_update_log
where id = #{id,jdbcType=INTEGER}
</delete>
</mapper>
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 开启驼峰命名 -->
<settings>
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
<!-- 配置别名 -->
<typeAliases>
<package name="lingtao.net.bean"/>
</typeAliases>
<plugins>
<plugin interceptor="com.github.pagehelper.PageInterceptor">
<!-- 配置分页参数合理化 -->
<property name="reasonable" value="true"/>
</plugin>
</plugins>
</configuration>
+587
View File
@@ -0,0 +1,587 @@
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.7.20-log : Database - quote_price
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`quote_price` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `quote_price`;
/*Table structure for table `bug` */
DROP TABLE IF EXISTS `bug`;
CREATE TABLE `bug` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`product` varchar(150) DEFAULT NULL COMMENT '产品',
`bugRemark` varchar(1665) DEFAULT NULL COMMENT '问题界面',
`createBy` varchar(60) DEFAULT NULL COMMENT '提交人',
`createDate` datetime DEFAULT NULL COMMENT '提交时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='bug表';
/*Table structure for table `product` */
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`pro_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`length` double DEFAULT NULL COMMENT '长度',
`width` double DEFAULT NULL COMMENT '宽度',
`count` double DEFAULT NULL COMMENT '数量',
`area` double DEFAULT NULL COMMENT '面积',
`price` double DEFAULT NULL COMMENT '价格',
`price_multiple` double DEFAULT NULL COMMENT '价格倍数',
`discount_price` double DEFAULT NULL COMMENT '折扣价',
`floor_price` double DEFAULT NULL COMMENT '跳楼价',
`weight` double DEFAULT NULL COMMENT '重量',
`kind_value` varchar(135) DEFAULT NULL COMMENT '产品种类1',
`kind_label` varchar(810) DEFAULT NULL COMMENT '种类1说明',
`kind1_value` varchar(100) DEFAULT NULL COMMENT '产品种类',
`kind1_label` varchar(100) DEFAULT NULL COMMENT '产品说明',
`kind2_value` varchar(135) DEFAULT NULL COMMENT '产品种类2',
`kind2_label` varchar(810) DEFAULT NULL COMMENT '种类2说明',
`pro_type_value` varchar(135) DEFAULT NULL COMMENT '产品分类',
`pro_type_label` varchar(1350) DEFAULT NULL COMMENT '产品分类说明',
`creator` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
`updater` varchar(20) DEFAULT NULL COMMENT '更新人',
`update_date` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`pro_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15349 DEFAULT CHARSET=utf8 COMMENT='价格表';
/*Table structure for table `product_img` */
DROP TABLE IF EXISTS `product_img`;
CREATE TABLE `product_img` (
`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`pro_type_value` varchar(810) DEFAULT NULL COMMENT '产品类型',
`pro_type_label` varchar(4050) DEFAULT NULL COMMENT '产品类型说明',
`kind_value` varchar(450) DEFAULT NULL COMMENT '产品种类1',
`kind_label` varchar(450) DEFAULT NULL COMMENT '产品种类1说明',
`kind2_value` varchar(450) DEFAULT NULL COMMENT '产品种类2',
`kind2_label` varchar(450) DEFAULT NULL COMMENT '产品种类2说明',
`remark` varchar(350) DEFAULT NULL COMMENT '备注',
`img_url` varchar(520) DEFAULT NULL COMMENT '图片地址',
`filename` varchar(150) DEFAULT NULL COMMENT '文件名称',
`creator` bigint(20) DEFAULT NULL,
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updater` bigint(20) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`img_width` varchar(540) DEFAULT NULL COMMENT '图片宽度',
`img_height` varchar(540) DEFAULT NULL COMMENT '图片高度',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=147 DEFAULT CHARSET=utf8;
/*Table structure for table `sys_dict_product` */
DROP TABLE IF EXISTS `sys_dict_product`;
CREATE TABLE `sys_dict_product` (
`pro_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`kind_value` varchar(2295) DEFAULT NULL COMMENT '产品种类1',
`kind_label` varchar(2295) DEFAULT NULL COMMENT '种类1说明',
`kind2_value` varchar(450) DEFAULT NULL COMMENT '产品种类2',
`kind2_label` varchar(450) DEFAULT NULL COMMENT '种类2说明',
`kind_price` double DEFAULT NULL,
`discount_price` double DEFAULT NULL,
`floor_price` double DEFAULT NULL,
`weight` double DEFAULT NULL,
`pro_type_value` varchar(2295) DEFAULT NULL COMMENT '产品分类',
`pro_type_label` varchar(2295) DEFAULT NULL COMMENT '分类说明',
`remark` varchar(2295) DEFAULT NULL,
`create_by` varchar(270) DEFAULT NULL,
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(270) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
PRIMARY KEY (`pro_id`)
) ENGINE=InnoDB AUTO_INCREMENT=391 DEFAULT CHARSET=utf8;
/*Table structure for table `sys_dict_search_pro` */
DROP TABLE IF EXISTS `sys_dict_search_pro`;
CREATE TABLE `sys_dict_search_pro` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`like_pro_type_label` varchar(100) DEFAULT NULL COMMENT '关键字搜索内容',
`pro_type_label` varchar(50) DEFAULT NULL COMMENT '产品分类',
`url` varchar(100) DEFAULT NULL COMMENT '地址',
`status` varchar(5) DEFAULT NULL COMMENT '开启状态 0:关闭 1:开启',
`createDate` datetime DEFAULT NULL,
`creator` varchar(50) DEFAULT NULL,
`updateDate` datetime DEFAULT NULL,
`updater` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=119 DEFAULT CHARSET=utf8 COMMENT='关键字搜索';
/*Table structure for table `t_customer_train_content` */
DROP TABLE IF EXISTS `t_customer_train_content`;
CREATE TABLE `t_customer_train_content` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pro_type` varchar(60) DEFAULT NULL,
`kind` varchar(60) DEFAULT NULL,
`sort` int(20) DEFAULT NULL,
`content` varchar(15000) DEFAULT NULL,
`create_by` varchar(60) DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`update_by` varchar(60) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`type` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
/*Table structure for table `t_customer_train_kind_label` */
DROP TABLE IF EXISTS `t_customer_train_kind_label`;
CREATE TABLE `t_customer_train_kind_label` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pro_type` varchar(300) DEFAULT NULL,
`kind_label` varchar(300) DEFAULT NULL,
`remark` varchar(765) DEFAULT NULL,
`sort` int(11) DEFAULT NULL,
`create_by` varchar(60) DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`update_by` varchar(60) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`type` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `pro_type` (`pro_type`),
CONSTRAINT `t_customer_train_kind_label_ibfk_1` FOREIGN KEY (`pro_type`) REFERENCES `t_customer_train_pro_type` (`pro_type`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
/*Table structure for table `t_customer_train_pro_type` */
DROP TABLE IF EXISTS `t_customer_train_pro_type`;
CREATE TABLE `t_customer_train_pro_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pro_type` varchar(300) NOT NULL,
`remark` varchar(1500) DEFAULT NULL,
`sort` int(11) DEFAULT NULL,
`create_by` varchar(60) DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`update_by` varchar(60) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`type` varchar(20) DEFAULT NULL,
PRIMARY KEY (`pro_type`),
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_article` */
DROP TABLE IF EXISTS `tbl_article`;
CREATE TABLE `tbl_article` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(50) NOT NULL COMMENT '标题',
`content` varchar(5000) NOT NULL COMMENT '主题内容',
`type` varchar(5) DEFAULT NULL COMMENT '文章类型',
`status` varchar(5) DEFAULT NULL COMMENT '文章发表状态',
`imagesUrl` varchar(100) DEFAULT NULL COMMENT '图片地址',
`hit` int(11) DEFAULT NULL COMMENT '点击数',
`remark` varchar(50) DEFAULT NULL COMMENT '标识',
`createBy` varchar(50) DEFAULT NULL COMMENT '添加人',
`createDate` datetime DEFAULT NULL COMMENT '创建日期',
`updateBy` varchar(50) DEFAULT NULL COMMENT '更新人',
`updateDate` datetime DEFAULT NULL COMMENT '更新日期',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_customer_award` */
DROP TABLE IF EXISTS `tbl_customer_award`;
CREATE TABLE `tbl_customer_award` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nickname` varchar(150) DEFAULT NULL COMMENT '客服昵称',
`payPercent` double DEFAULT NULL COMMENT '付款百分比',
`askNumber` double DEFAULT NULL COMMENT '询单人数',
`customerPrice` double DEFAULT NULL COMMENT '客单价',
`award` int(11) DEFAULT NULL COMMENT '奖励金额',
`shopname` varchar(150) DEFAULT NULL COMMENT '店铺',
`creator` varchar(150) DEFAULT NULL COMMENT '导入人',
`createDate` datetime DEFAULT NULL COMMENT '导入时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COMMENT='客服奖励表';
/*Table structure for table `tbl_customer_data` */
DROP TABLE IF EXISTS `tbl_customer_data`;
CREATE TABLE `tbl_customer_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(60) DEFAULT NULL COMMENT '用户名,用户删除数据',
`realname` varchar(60) DEFAULT NULL COMMENT '真实姓名',
`role` varchar(300) DEFAULT NULL COMMENT '所属角色',
`price` double DEFAULT NULL COMMENT '报价金额',
`productExplain` varchar(1500) DEFAULT NULL COMMENT '产品说明',
`wangwang` varchar(300) DEFAULT NULL COMMENT '客户旺旺',
`isBuy` varchar(3) DEFAULT NULL COMMENT '是否购买 0:否 1:是',
`commentSelf` varchar(3000) DEFAULT NULL,
`commentManager` varchar(3000) DEFAULT NULL COMMENT '说明',
`commentDate` datetime DEFAULT NULL COMMENT '店长评语日期',
`isDelete` varchar(3) DEFAULT NULL COMMENT '是否删除 0:否 1:是',
`completeDate` datetime DEFAULT NULL COMMENT '成交时间',
`createBy` varchar(60) DEFAULT NULL COMMENT '创建人',
`createDate` datetime DEFAULT NULL COMMENT '创建时间',
`updateBy` varchar(60) DEFAULT NULL COMMENT '更新人',
`updateDate` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5068 DEFAULT CHARSET=utf8 COMMENT='客服操作数据记录';
/*Table structure for table `tbl_express_fee` */
DROP TABLE IF EXISTS `tbl_express_fee`;
CREATE TABLE `tbl_express_fee` (
`id` int(11) DEFAULT NULL,
`pro_type_value` varchar(60) DEFAULT NULL COMMENT '产品类型',
`pro_type_label` varchar(60) DEFAULT NULL COMMENT '产品类型说明',
`province` varchar(60) DEFAULT NULL COMMENT '省份',
`first_weight_price` double DEFAULT NULL COMMENT '首重价格',
`continued_weight_price` double DEFAULT NULL COMMENT '续重价格',
`start_price` double DEFAULT NULL COMMENT '起步价',
`createBy` varchar(60) DEFAULT NULL,
`createDate` datetime DEFAULT NULL,
`updateBy` varchar(60) DEFAULT NULL,
`updateDate` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='快递费';
/*Table structure for table `tbl_file` */
DROP TABLE IF EXISTS `tbl_file`;
CREATE TABLE `tbl_file` (
`fileId` int(11) NOT NULL AUTO_INCREMENT,
`fileName` varchar(50) DEFAULT NULL,
`filePath` varchar(255) DEFAULT NULL,
`remark` varchar(255) DEFAULT NULL,
`createBy` varchar(50) DEFAULT NULL,
`createDate` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`updateBy` varchar(50) DEFAULT NULL,
`updateDate` datetime DEFAULT NULL,
PRIMARY KEY (`fileId`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_information` */
DROP TABLE IF EXISTS `tbl_information`;
CREATE TABLE `tbl_information` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`content` varchar(1500) DEFAULT NULL COMMENT '知识点内容',
`type` varchar(30) DEFAULT NULL COMMENT '知识点类型',
`createBy` varchar(30) DEFAULT NULL COMMENT '创建者',
`createDate` datetime DEFAULT NULL COMMENT '创建时间',
`updateBy` varchar(30) DEFAULT NULL COMMENT '更新者',
`updateDate` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8 COMMENT='产品知识点;客服须知';
/*Table structure for table `tbl_login_ip` */
DROP TABLE IF EXISTS `tbl_login_ip`;
CREATE TABLE `tbl_login_ip` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`agreeIp` varchar(120) DEFAULT NULL COMMENT '允许登录的IP',
`remark` varchar(50) DEFAULT NULL COMMENT '说明',
`createBy` varchar(20) DEFAULT NULL COMMENT '创建人',
`createDate` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `ip` (`agreeIp`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='授权登录IP';
/*Table structure for table `tbl_login_log` */
DROP TABLE IF EXISTS `tbl_login_log`;
CREATE TABLE `tbl_login_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`remark` varchar(200) DEFAULT NULL COMMENT '登录说明',
`status` varchar(4) DEFAULT NULL COMMENT '登录状态',
`loginTime` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '登录时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=55726 DEFAULT CHARSET=utf8 COMMENT='登录日志';
/*Table structure for table `tbl_product_price` */
DROP TABLE IF EXISTS `tbl_product_price`;
CREATE TABLE `tbl_product_price` (
`id` int(11) DEFAULT NULL,
`sticker_kind` varchar(30) DEFAULT NULL,
`craft_tang` varchar(30) DEFAULT NULL,
`aotu` varchar(30) DEFAULT NULL,
`pro_type_value` varchar(30) DEFAULT NULL,
`kind_value` varchar(30) DEFAULT NULL,
`kind2_value` varchar(30) DEFAULT NULL,
`price500` int(11) DEFAULT NULL,
`price1000` int(11) DEFAULT NULL,
`price2000` int(11) DEFAULT NULL,
`price3000` int(11) DEFAULT NULL,
`price4000` int(11) DEFAULT NULL,
`price5000` int(11) DEFAULT NULL,
`price10000` int(11) DEFAULT NULL,
`size_type` varchar(12) DEFAULT NULL,
`remark` varchar(150) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_question` */
DROP TABLE IF EXISTS `tbl_question`;
CREATE TABLE `tbl_question` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`question` varchar(1500) DEFAULT NULL COMMENT '问题',
`type` varchar(3) DEFAULT NULL COMMENT '问题类型',
`answer1` varchar(150) DEFAULT NULL COMMENT '选项A',
`answer2` varchar(150) DEFAULT NULL COMMENT '选项B',
`answer3` varchar(150) DEFAULT NULL COMMENT '选项C',
`answer4` varchar(150) DEFAULT NULL COMMENT '选项D',
`answer` varchar(150) DEFAULT NULL COMMENT '正确答案',
`ansCount` int(11) DEFAULT NULL COMMENT '填空题空数',
`createBy` varchar(150) DEFAULT NULL COMMENT '创建者',
`createDate` datetime DEFAULT NULL COMMENT '创建时间',
`updateBy` varchar(150) DEFAULT NULL COMMENT '更新者',
`updateDate` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8 COMMENT='产品知识测试表';
/*Table structure for table `tbl_quote_data` */
DROP TABLE IF EXISTS `tbl_quote_data`;
CREATE TABLE `tbl_quote_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(180) DEFAULT NULL COMMENT '用户名',
`realname` varchar(150) DEFAULT NULL COMMENT '姓名',
`role` varchar(600) DEFAULT NULL COMMENT '角色',
`shopname` varchar(60) DEFAULT NULL COMMENT '数据所属店铺',
`price` double DEFAULT NULL COMMENT '报价价格',
`buyPrice` double DEFAULT NULL COMMENT '实际成交金额',
`wangwang` varchar(300) DEFAULT NULL COMMENT '客户旺旺',
`isBuy` varchar(9) NOT NULL COMMENT '是否成交',
`buyDate` datetime DEFAULT NULL COMMENT '成交时间',
`isBuyToDay` varchar(3) NOT NULL COMMENT '是否当天购买',
`isBuyToDayDate` datetime DEFAULT NULL COMMENT '购买时间',
`remark` varchar(1800) DEFAULT NULL COMMENT '报价记录',
`remarkJudge` varchar(500) DEFAULT NULL COMMENT '报价记录对比',
`quoteTime` datetime NOT NULL COMMENT '报价时间',
`commentSelf` varchar(1500) DEFAULT NULL COMMENT '未成交说明',
`commentSelfDate` datetime DEFAULT NULL COMMENT '日期',
`commentManager` varchar(1500) DEFAULT NULL COMMENT '店长跟单',
`commentManagerDate` datetime DEFAULT NULL COMMENT '店长跟单日期',
`isSelect` varchar(3) DEFAULT NULL COMMENT '是否选择所属店铺',
`selectDate` datetime DEFAULT NULL COMMENT '选择时间',
`isFillIn` varchar(3) DEFAULT NULL COMMENT '是否填写旺旺号',
`fillInDate` datetime DEFAULT NULL COMMENT '填写旺旺时间',
`proTypeLabel` varchar(50) NOT NULL COMMENT '产品类型',
`orderNumber` varchar(25) DEFAULT NULL COMMENT '成交的订单号',
PRIMARY KEY (`id`,`proTypeLabel`),
KEY `index_where` (`shopname`,`quoteTime`,`wangwang`,`realname`,`isBuy`,`isBuyToDay`,`proTypeLabel`,`price`,`buyPrice`,`isFillIn`),
KEY `index_realname` (`realname`,`quoteTime`,`price`,`buyPrice`,`wangwang`,`isBuy`,`isBuyToDay`,`isFillIn`,`proTypeLabel`,`shopname`),
KEY `index_proTypeLabel` (`proTypeLabel`,`quoteTime`,`isFillIn`,`wangwang`,`price`,`isBuy`,`isBuyToDay`),
KEY `index_username` (`quoteTime`,`username`,`realname`),
KEY `index_quoteTime` (`quoteTime`)
) ENGINE=InnoDB AUTO_INCREMENT=320661 DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_quote_log` */
DROP TABLE IF EXISTS `tbl_quote_log`;
CREATE TABLE `tbl_quote_log` (
`quoteId` int(8) NOT NULL AUTO_INCREMENT,
`quoteTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '操作时间',
`quoteIp` varchar(120) DEFAULT NULL COMMENT '操作IP',
`os` varchar(60) DEFAULT NULL COMMENT '操作系统',
`realname` varchar(150) DEFAULT NULL COMMENT '姓名',
`username` varchar(150) DEFAULT NULL COMMENT '用户名',
`brower` varchar(150) DEFAULT NULL COMMENT '浏览器',
`remark` varchar(300) DEFAULT NULL COMMENT '备注:操作说明',
`shopname` varchar(200) DEFAULT NULL COMMENT '店铺',
`price` double DEFAULT NULL,
PRIMARY KEY (`quoteId`)
) ENGINE=InnoDB AUTO_INCREMENT=1970236 DEFAULT CHARSET=utf8 COMMENT='用户操作表';
/*Table structure for table `tbl_sys_finance` */
DROP TABLE IF EXISTS `tbl_sys_finance`;
CREATE TABLE `tbl_sys_finance` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`add_time` date DEFAULT NULL COMMENT '添加时间',
`supplier` varchar(150) DEFAULT NULL COMMENT '供应商',
`shopname` varchar(150) DEFAULT NULL COMMENT '店铺',
`kind` varchar(150) DEFAULT NULL COMMENT '种类1',
`kind2` varchar(150) DEFAULT NULL COMMENT '种类2',
`order_number` varchar(300) DEFAULT NULL COMMENT '订单号',
`filename` varchar(1500) DEFAULT NULL COMMENT '文件名',
`count` varchar(30) DEFAULT NULL COMMENT '数量',
`number` varchar(30) DEFAULT NULL COMMENT '款数',
`zhang` varchar(30) DEFAULT NULL COMMENT '拼版张数',
`remark` varchar(1500) DEFAULT NULL COMMENT '备注',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '导入时间',
`creator` varchar(300) DEFAULT NULL COMMENT '导入人',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11620 DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_sys_finance_difference` */
DROP TABLE IF EXISTS `tbl_sys_finance_difference`;
CREATE TABLE `tbl_sys_finance_difference` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_number` varchar(1800) DEFAULT NULL COMMENT '订单号',
`shopname` varchar(450) DEFAULT NULL COMMENT '店铺',
`wangwang` varchar(450) DEFAULT NULL COMMENT '旺旺号',
`pay_time` datetime DEFAULT NULL COMMENT '付款时间',
`price` varchar(90) DEFAULT NULL COMMENT '金额',
`remark` varchar(4500) DEFAULT NULL COMMENT '备注',
`taobao_status` varchar(450) DEFAULT NULL COMMENT '状态',
`open_order_number` varchar(1800) DEFAULT NULL COMMENT '拆分订单号',
`filename` varchar(450) DEFAULT NULL COMMENT '文件名',
`creator` varchar(450) DEFAULT NULL COMMENT '导入人',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '导入时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59552 DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_sys_finance_extract` */
DROP TABLE IF EXISTS `tbl_sys_finance_extract`;
CREATE TABLE `tbl_sys_finance_extract` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_number` varchar(500) DEFAULT NULL COMMENT '订单号',
`remark` varchar(5000) DEFAULT NULL COMMENT '备注',
`length` varchar(30) DEFAULT NULL COMMENT '',
`width` varchar(30) DEFAULT NULL COMMENT '',
`height` varchar(30) DEFAULT NULL COMMENT '',
`count` varchar(30) DEFAULT NULL COMMENT '数量',
`filename` varchar(150) DEFAULT NULL COMMENT '文件名',
`creator` varchar(30) DEFAULT NULL COMMENT '导入人',
`create_date` datetime DEFAULT NULL COMMENT '导入时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=196143 DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_sys_permission` */
DROP TABLE IF EXISTS `tbl_sys_permission`;
CREATE TABLE `tbl_sys_permission` (
`perId` int(11) NOT NULL AUTO_INCREMENT,
`perName` varchar(50) DEFAULT NULL COMMENT '权限名称',
`type` varchar(100) DEFAULT NULL,
`perCode` varchar(100) DEFAULT NULL,
`url` varchar(100) DEFAULT NULL COMMENT '权限路劲',
`perIcon` varchar(100) DEFAULT NULL COMMENT '图标',
`parentId` int(11) DEFAULT NULL COMMENT '父ID',
`orderNo` varchar(10) DEFAULT NULL COMMENT '排序',
`thirdOrderName` varchar(20) DEFAULT NULL COMMENT '三级菜单名称',
`thirdParentId` int(11) DEFAULT NULL COMMENT '三级菜单父ID',
`createBy` varchar(50) DEFAULT NULL COMMENT '创建人',
`createDate` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`perId`)
) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8 COMMENT='权限表';
/*Table structure for table `tbl_sys_role` */
DROP TABLE IF EXISTS `tbl_sys_role`;
CREATE TABLE `tbl_sys_role` (
`roleId` int(11) NOT NULL AUTO_INCREMENT,
`roleName` varchar(50) DEFAULT NULL COMMENT '角色名称',
`remark` varchar(200) DEFAULT NULL COMMENT '角色说明',
`isRegist` varchar(1) DEFAULT NULL COMMENT '注册标识',
`createBy` varchar(50) DEFAULT NULL COMMENT '创建人',
`createDate` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`updateBy` varchar(50) DEFAULT NULL COMMENT '更新人',
`updateDate` datetime DEFAULT NULL COMMENT '更新时间',
`isSelf` varchar(3) DEFAULT NULL COMMENT '本公司店铺',
PRIMARY KEY (`roleId`)
) ENGINE=InnoDB AUTO_INCREMENT=1052 DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_sys_role_permission` */
DROP TABLE IF EXISTS `tbl_sys_role_permission`;
CREATE TABLE `tbl_sys_role_permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`roleId` int(11) NOT NULL COMMENT '角色ID',
`perId` int(11) NOT NULL COMMENT '权限ID',
`createDate` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16856 DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_sys_user` */
DROP TABLE IF EXISTS `tbl_sys_user`;
CREATE TABLE `tbl_sys_user` (
`userId` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`realname` varchar(50) DEFAULT NULL COMMENT '真实名字',
`username` varchar(50) DEFAULT NULL COMMENT '账号',
`password` varchar(50) DEFAULT NULL COMMENT '密码',
`userStatus` varchar(1) DEFAULT NULL COMMENT '状态',
`role` varchar(200) DEFAULT NULL COMMENT '角色',
`sysStatus` varchar(1) DEFAULT NULL COMMENT '系统状态。0:隐藏,1:显示',
`readLogStatus` varchar(1) DEFAULT NULL COMMENT '阅读更新日志状态 0:未读 1:已读',
`createBy` varchar(50) DEFAULT NULL COMMENT '创建人',
`createDate` datetime DEFAULT NULL COMMENT '创建时间',
`updateBy` varchar(50) DEFAULT NULL COMMENT '更新人',
`updateDate` datetime DEFAULT NULL COMMENT '更新时间',
`birthDay` varchar(20) DEFAULT NULL COMMENT '生日',
`birthType` varchar(1) DEFAULT NULL COMMENT '生日类型 0:农历 1:新历',
`isBirthDay` tinyint(1) DEFAULT NULL COMMENT '是否是生日',
`entryDate` varchar(20) DEFAULT NULL COMMENT '入职时间',
`needIp` varchar(1) DEFAULT NULL COMMENT '是否需要判断IP 0:否 1:是',
PRIMARY KEY (`userId`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=1349 DEFAULT CHARSET=utf8;
/*Table structure for table `tbl_sys_user_role` */
DROP TABLE IF EXISTS `tbl_sys_user_role`;
CREATE TABLE `tbl_sys_user_role` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户角色id',
`userId` int(11) NOT NULL,
`roleId` int(11) NOT NULL,
`createDate` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `userId` (`userId`),
KEY `roleId` (`roleId`),
CONSTRAINT `tbl_sys_user_role_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `tbl_sys_user` (`userId`),
CONSTRAINT `tbl_sys_user_role_ibfk_2` FOREIGN KEY (`roleId`) REFERENCES `tbl_sys_role` (`roleId`)
) ENGINE=InnoDB AUTO_INCREMENT=2775 DEFAULT CHARSET=utf8 COMMENT='用户角色表';
/*Table structure for table `tbl_update_log` */
DROP TABLE IF EXISTS `tbl_update_log`;
CREATE TABLE `tbl_update_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`content` varchar(15000) DEFAULT NULL,
`addTime` datetime DEFAULT NULL,
`createBy` varchar(150) DEFAULT NULL,
`createDate` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;