| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?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="shop.alien.mapper.StoreInfoMapper">
- <!--
- 门店证照查询(存档审计)
- 以 store_license_history 为驱动表,展示所有上传记录
- 证照类型映射:license_status 1→营业执照(img_type=14) 2→其他资质证明(img_type=35)
- 审核状态:license_execute_status 1→审核通过 2→审核中 3→审核拒绝
- -->
- <select id="getStoreLicensePage"
- resultType="shop.alien.entity.store.vo.StoreLicenseInfoVo">
- SELECT
- CASE
- WHEN slh.license_status = 1 THEN '营业执照'
- WHEN slh.license_status = 2 THEN '其他资质证明'
- ELSE ''
- END AS img_description,
- CASE
- WHEN slh.license_status = 1 THEN 14
- WHEN slh.license_status = 2 THEN 35
- ELSE 0
- END AS img_type,
- s.id AS id,
- s.store_name AS store_name,
- s.store_tel AS store_tel,
- su.name AS name,
- slh.img_url,
- s.business_section_name,
- s.business_classify_name,
- s.business_types_name,
- slh.license_execute_status AS states,
- slh.created_time AS submit_date,
- CASE
- WHEN slh.license_status = 1 THEN s.business_license_expiration_time
- ELSE NULL
- END AS expiration_time,
- slh.reason_refusal AS expiration_reason
- FROM store_license_history slh
- INNER JOIN store_info s ON slh.store_id = s.id AND s.delete_flag = 0
- LEFT JOIN store_user su ON s.id = su.store_id AND su.delete_flag = 0
- WHERE slh.delete_flag = 0
- <if test="storeName != null and storeName != ''">
- AND s.store_name LIKE CONCAT('%', #{storeName}, '%')
- </if>
- <if test="storeContact != null and storeContact != ''">
- AND su.name LIKE CONCAT('%', #{storeContact}, '%')
- </if>
- <if test="storeTel != null and storeTel != ''">
- AND s.store_tel LIKE CONCAT('%', #{storeTel}, '%')
- </if>
- <if test="businessSection != null and businessSection != ''">
- AND s.business_section = #{businessSection}
- </if>
- <if test="imgType != null and imgType == 14">
- AND slh.license_status = 1
- </if>
- <if test="imgType != null and imgType == 35">
- AND slh.license_status = 2
- </if>
- <if test="states != null and states != ''">
- AND slh.license_execute_status = #{states}
- </if>
- <if test="startSubmitDate != null and startSubmitDate != ''">
- AND slh.created_time >= #{startSubmitDate}
- </if>
- <if test="endSubmitDate != null and endSubmitDate != ''">
- AND slh.created_time <= #{endSubmitDate}
- </if>
- ORDER BY slh.created_time DESC, s.store_name ASC
- </select>
- </mapper>
|