|
@@ -2,14 +2,14 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.caimei.mapper.cmMapper.AuthTemplateMapper">
|
|
|
<insert id="insertTemplate">
|
|
|
- insert into cm_brand_auth_template (authUserId, templateImage, templateSize, qrPosition, qrSize, addTime)
|
|
|
- values (#{authUserId}, #{templateImage}, #{templateSize}, #{qrPosition}, #{qrSize}, NOW())
|
|
|
+ insert into cm_brand_auth_template (authUserId, templateImage, templateSize, qrPosition, qrSize, logoSize, addTime)
|
|
|
+ values (#{authUserId}, #{templateImage}, #{templateSize}, #{qrPosition}, #{qrSize}, #{logoSize}, NOW())
|
|
|
</insert>
|
|
|
<update id="updateSelective">
|
|
|
update cm_brand_auth_template
|
|
|
<set>
|
|
|
<if test="authUserId != null and null == authFlag and null == productFlag">
|
|
|
- authUserId = #{authUserId},
|
|
|
+ authUserId = #{authUserId}, authFlag = 0, productFlag = 0,
|
|
|
</if>
|
|
|
<if test="templateImage != null and templateImage != ''">
|
|
|
templateImage = #{templateImage},
|
|
@@ -20,6 +20,12 @@
|
|
|
<if test="qrPosition != null and qrPosition != ''">
|
|
|
qrPosition = #{qrPosition},
|
|
|
</if>
|
|
|
+ <if test="qrSize != null">
|
|
|
+ qrSize = #{qrSize},
|
|
|
+ </if>
|
|
|
+ <if test="logoSize != null and logoSize != ''">
|
|
|
+ logoSize = #{logoSize},
|
|
|
+ </if>
|
|
|
<if test="authFlag != null and authFlag == 1">
|
|
|
authFlag = 1,
|
|
|
</if>
|
|
@@ -41,9 +47,10 @@
|
|
|
</update>
|
|
|
|
|
|
<select id="getTemplateList" resultType="com.caimei.model.vo.TemplateVo">
|
|
|
- select t.id as templateId,t.authUserId,u.name as shopName, templateImage, templateSize, authFlag, productFlag, qrPosition,
|
|
|
- qrSize, t.status, addTime
|
|
|
- from cm_brand_auth_template t left join cm_brand_auth_user u on t.authUserId = u.authUserId
|
|
|
+ select t.id as templateId,t.authUserId,u.name as shopName, templateImage, templateSize, authFlag, productFlag,
|
|
|
+ qrPosition, qrSize, logoSize, t.status, addTime
|
|
|
+ from cm_brand_auth_template t
|
|
|
+ left join cm_brand_auth_user u on t.authUserId = u.authUserId
|
|
|
<where>
|
|
|
<if test="authUserId != null">
|
|
|
and t.authUserId = #{authUserId}
|
|
@@ -54,4 +61,26 @@
|
|
|
</where>
|
|
|
order by t.addTime desc
|
|
|
</select>
|
|
|
+ <select id="getTemplateFormData" resultType="com.caimei.model.vo.TemplateVo">
|
|
|
+ select t.id as templateId, templateImage, t.authUserId, qrPosition, qrSize, logoSize
|
|
|
+ from cm_brand_auth_template t left join cm_brand_auth a on t.authUserId = a.authUserId
|
|
|
+ <where>
|
|
|
+ <if test="templateId != null">
|
|
|
+ and t.id = #{templateId}
|
|
|
+ </if>
|
|
|
+ <if test="authId != null">
|
|
|
+ and a.id = #{authId}
|
|
|
+ </if>
|
|
|
+ <if test="authUserId != null">
|
|
|
+ and t.authUserId = #{authUserId}
|
|
|
+ </if>
|
|
|
+ <if test="authFlag != null">
|
|
|
+ and t.authFlag = #{authFlag}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and t.status = #{status}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
</mapper>
|