first commit
Цей коміт міститься в:
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Посилання в новій задачі
Заблокувати користувача