|
@@ -3,10 +3,10 @@
|
|
<mapper namespace="com.caimei.mapper.AuthProductMapper">
|
|
<mapper namespace="com.caimei.mapper.AuthProductMapper">
|
|
<insert id="insertProduct" keyColumn="id" keyProperty="productId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductPo">
|
|
<insert id="insertProduct" keyColumn="id" keyProperty="productId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductPo">
|
|
insert into cm_brand_auth_product(`authId`, `brandId`, `name`, `snCode`, `image`,`pcImage`,`appletsImage`, `certificateImage`,
|
|
insert into cm_brand_auth_product(`authId`, `brandId`, `name`, `snCode`, `image`,`pcImage`,`appletsImage`, `certificateImage`,
|
|
- `pcCertificateImage`,`appletsCertificateImage`, `status`,
|
|
|
|
|
|
+ `pcCertificateImage`,`appletsCertificateImage`, `status`, `auditStatus`,
|
|
`createTime`, `createBy`)
|
|
`createTime`, `createBy`)
|
|
values (#{authId}, #{brandId}, #{productName}, #{snCode}, #{productImage}, #{pcImage}, #{appletsImage},
|
|
values (#{authId}, #{brandId}, #{productName}, #{snCode}, #{productImage}, #{pcImage}, #{appletsImage},
|
|
- #{certificateImage}, #{pcCertificateImage}, #{appletsCertificateImage}, #{status}, #{createTime},
|
|
|
|
|
|
+ #{certificateImage}, #{pcCertificateImage}, #{appletsCertificateImage}, #{status}, #{auditStatus}, #{createTime},
|
|
#{createBy})
|
|
#{createBy})
|
|
</insert>
|
|
</insert>
|
|
<insert id="insertProductParam">
|
|
<insert id="insertProductParam">
|
|
@@ -28,6 +28,7 @@
|
|
`image` = #{productImage},
|
|
`image` = #{productImage},
|
|
`certificateImage` = #{certificateImage},
|
|
`certificateImage` = #{certificateImage},
|
|
`status` = #{status},
|
|
`status` = #{status},
|
|
|
|
+ `auditStatus` = #{auditStatus},
|
|
<if test="pcImage != null and pcImage != ''">
|
|
<if test="pcImage != null and pcImage != ''">
|
|
`pcImage` = #{pcImage},
|
|
`pcImage` = #{pcImage},
|
|
</if>
|
|
</if>
|
|
@@ -54,7 +55,9 @@
|
|
<update id="updateProductAuditStatus">
|
|
<update id="updateProductAuditStatus">
|
|
update cm_brand_auth_product
|
|
update cm_brand_auth_product
|
|
set auditStatus = #{auditStatus},
|
|
set auditStatus = #{auditStatus},
|
|
- invalidReason = #{invalidReason}
|
|
|
|
|
|
+ invalidReason = #{invalidReason},
|
|
|
|
+ auditBy = #{auditBy},
|
|
|
|
+ auditTime = #{auditTime}
|
|
where id = #{productId}
|
|
where id = #{productId}
|
|
</update>
|
|
</update>
|
|
<delete id="deleteProductByProductId">
|
|
<delete id="deleteProductByProductId">
|
|
@@ -64,9 +67,11 @@
|
|
delete from cm_brand_product_param where productId = #{productId}
|
|
delete from cm_brand_product_param where productId = #{productId}
|
|
</delete>
|
|
</delete>
|
|
<select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
|
|
<select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
|
|
- select id as productId,p.name as productName,snCode,p.status,p.auditStatus,p.createTime,u.name as createBy
|
|
|
|
|
|
+ select id as productId,p.name as productName,snCode,p.status,p.auditStatus,p.createTime,cu.name as createBy,
|
|
|
|
+ au.name as auditBy,p.auditTime,p.invalidReason
|
|
from cm_brand_auth_product p
|
|
from cm_brand_auth_product p
|
|
- left join cm_brand_auth_user u on p.createBy = u.authUserId
|
|
|
|
|
|
+ left join cm_brand_auth_user cu on p.createBy = cu.authUserId
|
|
|
|
+ left join cm_brand_auth_user au on p.auditBy = au.authUserId
|
|
where authId = #{authId}
|
|
where authId = #{authId}
|
|
<if test="productName != null and productName != ''">
|
|
<if test="productName != null and productName != ''">
|
|
and p.name like CONCAT('%',#{productName},'%')
|
|
and p.name like CONCAT('%',#{productName},'%')
|
|
@@ -74,7 +79,15 @@
|
|
<if test="snCode != null and snCode != ''">
|
|
<if test="snCode != null and snCode != ''">
|
|
and snCode like CONCAT('%',#{snCode},'%')
|
|
and snCode like CONCAT('%',#{snCode},'%')
|
|
</if>
|
|
</if>
|
|
- order by p.createTime desc
|
|
|
|
|
|
+ <if test="auditStatus != null">
|
|
|
|
+ and auditStatus = #{auditStatus}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="listType == 1">
|
|
|
|
+ order by p.createTime desc
|
|
|
|
+ </if>
|
|
|
|
+ <if test="listType == 2">
|
|
|
|
+ order by p.auditStatus desc,p.createTime desc
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
<select id="getProductIdBySnCode" resultType="java.lang.Integer">
|
|
<select id="getProductIdBySnCode" resultType="java.lang.Integer">
|
|
select id from cm_brand_auth_product where snCode = #{snCode} limit 1
|
|
select id from cm_brand_auth_product where snCode = #{snCode} limit 1
|