合并代码

This commit is contained in:
岳鹏磊
2019-05-31 18:38:02 +08:00
parent d008e92baa
commit 7f092ce6c8
155 changed files with 9832 additions and 13 deletions

View File

@@ -31,6 +31,8 @@ dubbo:
version: 1.0.0
ProductSpuService:
version: 1.0.0
ProductBrandService:
version: 1.0.0
OAuth2Service:
version: 1.0.0

View File

@@ -0,0 +1,95 @@
<?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="cn.iocoder.mall.product.dao.ProductBrandMapper">
<sql id="FIELDS">
id, name, description, pic_url, status, create_time
</sql>
<select id="selectById" parameterType="Integer" resultType="ProductBrandDO">
SELECT
<include refid="FIELDS" />
FROM product_brand
WHERE id = #{id}
AND deleted = 0
</select>
<select id="selectByName" parameterType="String" resultType="ProductBrandDO">
SELECT
<include refid="FIELDS" />
FROM product_brand
WHERE name = #{name}
AND deleted = 0
</select>
<insert id="insert" parameterType="ProductBrandDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO product_brand (
name, description, pic_url, status, create_time, deleted
) VALUES (
#{name}, #{description}, #{picUrl}, #{status}, #{createTime}, #{deleted}
)
</insert>
<update id="update" parameterType="ProductBrandDO">
UPDATE product_brand
<set>
<if test="name != null">
name = #{name},
</if>
<if test="description != null">
description = #{description},
</if>
<if test="picUrl != null">
pic_url = #{picUrl},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="deleted != null">
deleted = #{deleted}
</if>
</set>
WHERE id = #{id}
</update>
<select id="selectListByParams" resultType="ProductBrandDO">
SELECT
<include refid="FIELDS" />
FROM product_brand
<where>
deleted = 0
<if test="name != null">
AND name LIKE "%"#{name}"%"
</if>
<if test="description != null">
AND description LIKE "%"#{description}"%"
</if>
<if test="status != null">
AND status = #{status}
</if>
</where>
LIMIT #{offset}, #{limit}
</select>
<select id="selectListCountByParams" resultType="Integer">
SELECT
COUNT(1)
FROM product_brand
<where>
deleted = 0
<if test="name != null">
AND name LIKE "%"#{name}"%"
</if>
<if test="description != null">
AND description LIKE "%"#{description}"%"
</if>
<if test="status != null">
AND status = #{status}
</if>
</where>
</select>
</mapper>