<?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.ruoyi.shop.mapper.shop.ShopCertificateMapper">
|
|
<resultMap type="ShopCertificate" id="ShopCertificateResult">
|
<result property="cerId" column="cer_id" />
|
<result property="delFlag" column="del_flag" />
|
<result property="cerStatus" column="cer_status" />
|
<result property="shopId" column="shop_id" />
|
<result property="cerName" column="cer_name" />
|
<result property="cerNumber" column="cer_number" />
|
<result property="cerPicture" column="cer_picture" />
|
</resultMap>
|
|
<sql id="selectShopCertificateVo">
|
select cer_id, del_flag, cer_status, shop_id, cer_name, cer_number, cer_picture from t_shop_certificate
|
</sql>
|
|
<select id="selectShopCertificateList" parameterType="ShopCertificate" resultMap="ShopCertificateResult">
|
<include refid="selectShopCertificateVo"/>
|
<where>
|
<if test="cerStatus != null "> and cer_status = #{cerStatus}</if>
|
<if test="shopId != null "> and shop_id = #{shopId}</if>
|
<if test="cerName != null and cerName != ''"> and cer_name like concat('%', #{cerName}, '%')</if>
|
<if test="cerNumber != null "> and cer_number = #{cerNumber}</if>
|
<if test="cerPicture != null and cerPicture != ''"> and cer_picture = #{cerPicture}</if>
|
</where>
|
</select>
|
|
<select id="selectShopCertificateByCerId" parameterType="Long" resultMap="ShopCertificateResult">
|
<include refid="selectShopCertificateVo"/>
|
where cer_id = #{cerId}
|
</select>
|
|
<insert id="insertShopCertificate" parameterType="ShopCertificate" useGeneratedKeys="true" keyProperty="cerId">
|
insert into t_shop_certificate
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="delFlag != null">del_flag,</if>
|
<if test="cerStatus != null">cer_status,</if>
|
<if test="shopId != null">shop_id,</if>
|
<if test="cerName != null">cer_name,</if>
|
<if test="cerNumber != null">cer_number,</if>
|
<if test="cerPicture != null">cer_picture,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="delFlag != null">#{delFlag},</if>
|
<if test="cerStatus != null">#{cerStatus},</if>
|
<if test="shopId != null">#{shopId},</if>
|
<if test="cerName != null">#{cerName},</if>
|
<if test="cerNumber != null">#{cerNumber},</if>
|
<if test="cerPicture != null">#{cerPicture},</if>
|
</trim>
|
</insert>
|
|
<update id="updateShopCertificate" parameterType="ShopCertificate">
|
update t_shop_certificate
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="cerStatus != null">cer_status = #{cerStatus},</if>
|
<if test="shopId != null">shop_id = #{shopId},</if>
|
<if test="cerName != null">cer_name = #{cerName},</if>
|
<if test="cerNumber != null">cer_number = #{cerNumber},</if>
|
<if test="cerPicture != null">cer_picture = #{cerPicture},</if>
|
</trim>
|
where cer_id = #{cerId}
|
</update>
|
|
<delete id="deleteShopCertificateByCerId" parameterType="Long">
|
delete from t_shop_certificate where cer_id = #{cerId}
|
</delete>
|
|
<delete id="deleteShopCertificateByCerIds" parameterType="String">
|
delete from t_shop_certificate where cer_id in
|
<foreach item="cerId" collection="array" open="(" separator="," close=")">
|
#{cerId}
|
</foreach>
|
</delete>
|
|
<select id="listShopCertificateVo" resultType="com.ruoyi.shop.domain.vo.MerShopCertificateListVo">
|
SELECT
|
cer_id cerId,
|
cer_name cerName,
|
cer_number cerNumber,
|
cer_picture cerPicture,
|
cer_status cerStatus,
|
refuse_reason refuseReason
|
FROM t_shop_certificate
|
WHERE del_flag = 0 AND shop_id = #{param.shopId}
|
<if test="param.status != null and param.status == 1">
|
AND cer_status = 1
|
</if>
|
<if test="param.status != null and param.status == 2">
|
AND (cer_status = 0 OR cer_status = 2)
|
</if>
|
ORDER BY create_time DESC
|
</select>
|
<select id="pageMgtShopCertificate" resultType="com.ruoyi.shop.domain.vo.MgtShopCertificatePageVo">
|
SELECT
|
tsc.cer_id cerId,
|
tsc.cer_name cerName,
|
tsc.cer_number cerNumber,
|
tsc.cer_picture cerPicture,
|
tsc.cer_status cerStatus,
|
tsc.create_time createTime,
|
ts.shop_name shopName,
|
ts.shopowner_name shopownerName,
|
ts.shopowner_phone shopownerPhone
|
FROM t_shop_certificate tsc
|
INNER JOIN t_shop ts ON tsc.shop_id = ts.shop_id
|
WHERE tsc.del_flag = 0 AND ts.del_flag = 0
|
<if test="param.cerStatus != null">
|
AND tsc.cer_status = #{param.cerStatus}
|
</if>
|
<if test="param.keyword!=null and param.keyword!=''">
|
AND (ts.shop_name LIKE CONCAT('%',#{param.keyword},'%') OR ts.shopowner_name LIKE CONCAT('%',#{param.keyword},'%')
|
OR ts.shopowner_phone LIKE CONCAT('%',#{param.keyword},'%'))
|
</if>
|
<if test="param.createStartTime!=null and param.createStartTime!=''">
|
AND Date(tsc.create_time) >= #{param.createStartTime}
|
</if>
|
<if test="param.createEndTime!=null and param.createEndTime!=''">
|
AND Date(tsc.create_time) <= #{param.createEndTime}
|
</if>
|
ORDER BY tsc.create_time DESC
|
</select>
|
</mapper>
|