|
@@ -1,7 +1,7 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.cmme.modules.product.dao.CmmeProductDao">
|
|
|
-
|
|
|
+
|
|
|
<sql id="cmmeProductColumns">
|
|
|
a.productID AS "id",
|
|
|
a.productID AS "productID",
|
|
@@ -52,22 +52,22 @@
|
|
|
cpd.clinicalResult AS "clinicalResult",
|
|
|
cpd.video AS "video"
|
|
|
</sql>
|
|
|
-
|
|
|
+
|
|
|
<sql id="cmmeProductJoins">
|
|
|
LEFT JOIN cmme_shop cs ON cs.shopID = a.shopID
|
|
|
LEFT JOIN cmme_productdetailinfo cpd ON cpd.productID = a.productID
|
|
|
</sql>
|
|
|
-
|
|
|
+
|
|
|
<select id="get" resultType="CmmeProduct">
|
|
|
- SELECT
|
|
|
+ SELECT
|
|
|
<include refid="cmmeProductColumns"/>
|
|
|
FROM cmme_product a
|
|
|
<include refid="cmmeProductJoins"/>
|
|
|
WHERE a.productID = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="findList" resultType="CmmeProduct">
|
|
|
- SELECT
|
|
|
+ SELECT
|
|
|
<include refid="cmmeProductColumns"/>
|
|
|
FROM cmme_product a
|
|
|
<include refid="cmmeProductJoins"/>
|
|
@@ -88,7 +88,7 @@
|
|
|
AND a.shopCode = #{shopCode}
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- AND a.name LIKE
|
|
|
+ AND a.name LIKE
|
|
|
<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
|
<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
|
|
|
<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
|
|
@@ -106,15 +106,15 @@
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="findAllList" resultType="CmmeProduct">
|
|
|
- SELECT
|
|
|
+ SELECT
|
|
|
<include refid="cmmeProductColumns"/>
|
|
|
FROM cmme_product a
|
|
|
<include refid="cmmeProductJoins"/>
|
|
|
<where>
|
|
|
-
|
|
|
- </where>
|
|
|
+
|
|
|
+ </where>
|
|
|
<choose>
|
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
ORDER BY ${page.orderBy}
|
|
@@ -123,7 +123,7 @@
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insert" parameterType="CmmeProduct" keyProperty="id" useGeneratedKeys="true">
|
|
|
INSERT INTO cmme_product(
|
|
|
brandID,
|
|
@@ -201,7 +201,7 @@
|
|
|
#{docBoost}
|
|
|
)
|
|
|
</insert>
|
|
|
-
|
|
|
+
|
|
|
<update id="update">
|
|
|
UPDATE cmme_product SET
|
|
|
<if test="brandID != null and brandID != ''">
|
|
@@ -315,7 +315,7 @@
|
|
|
productID = #{productID}
|
|
|
WHERE productID = #{productID}
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<delete id="delete">
|
|
|
DELETE FROM cmme_product
|
|
|
WHERE productID = #{productID}
|
|
@@ -419,4 +419,4 @@
|
|
|
AND a.productID != #{productID}
|
|
|
</if>
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+</mapper>
|