本商城网站采用B/S结构,web开发,用户自己在浏览器中输入网址来浏览网页中的信息。 采用mysql数据库来存储所有动态数据,本网站从技术方向来说,分为前端页面和后台逻辑开发,页面设计使用HTML+js+jquery技术,后台使用springboot+mybatis。将IDEA作为编译环境,Java作为本网站的开发语言来设计开发。
表3-1 角色分析表
序号 | 角色 | 职责描述 | 1 | 管理员 | 登录 | 用戶管理 | 鲜花管理 | 订单管理 |
序号 | 角色 | 职责描述 | | 1 | 管理员 | 鲜花分类管理 | | 轮播图管理 | | 退出登陆 | | | | 2 | 用户 | 用户登录注册 | | 鲜花购买 | | 购物车 | | 个人中心 | | 退出 |
<?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="flowershop.mall.dao.CommentMapper">
<resultMap id="BaseResultMap" type="flowershop.mall.entity.Comment">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_no" jdbcType="VARCHAR" property="orderNo" />
<result column="nick_name" jdbcType="VARCHAR" property="nickName" />
<result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="goods_id" jdbcType="INTEGER" property="goodsId" />
<result column="remark1" jdbcType="VARCHAR" property="remark1" />
<result column="remark2" jdbcType="VARCHAR" property="remark2" />
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="end_time" jdbcType="VARCHAR" property="endTime" />
</resultMap>
<sql id="Base_Column_List">
id,order_no, nick_name, goods_name, content, state,remark1,remark2,goods_id,create_time,end_time
</sql>
<select id="selectCommentByGoodsId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from comment
where goods_id = #{goodsId,jdbcType=INTEGER}
order by create_time desc
</select>
<select id="deleteComment" parameterType="java.lang.Integer" resultType="java.lang.Integer">
delete from comment
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from comment
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByorderNo" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from comment
where order_no = #{orderNo,jdbcType=VARCHAR}
</select>
<insert id="insert" parameterType="flowershop.mall.entity.Comment">
insert into comment (order_no, nick_name, goods_name,
content, state,remark1,remark2,goods_id,create_time,end_time)
values (#{orderNo,jdbcType=VARCHAR}, #{nickName,jdbcType=VARCHAR}, #{goodsName,jdbcType=VARCHAR},
#{content,jdbcType=VARCHAR}, 0,#{remark1,jdbcType=VARCHAR},#{remark2,jdbcType=VARCHAR},#{goodsId,jdbcType=INTEGER},#{createTime,jdbcType=VARCHAR},#{endTime,jdbcType=VARCHAR})
</insert>
<update id="updateByRemark" parameterType="flowershop.mall.entity.Comment">
update comment
set remark1 = #{remark1,jdbcType=VARCHAR},
end_time = #{endTime,jdbcType=VARCHAR},
state=1
where id = #{id,jdbcType=INTEGER}
</update>
<select id="findCommentList" parameterType="Map" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from comment
order by create_time desc
<if test="start!=null and limit!=null">
limit #{start},#{limit}
</if>
</select>
<select id="getTotalComment" parameterType="Map" resultType="int">
select count(*) from comment
</select>
</mapper>
|