StoreInfoMapper.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="shop.alien.mapper.StoreInfoMapper">
  6. <!--
  7. 门店证照查询(存档审计)
  8. 以 store_license_history 为驱动表,展示所有上传记录
  9. 证照类型映射:license_status 1→营业执照(img_type=14) 2→其他资质证明(img_type=35)
  10. 审核状态:license_execute_status 1→审核通过 2→审核中 3→审核拒绝
  11. -->
  12. <select id="getStoreLicensePage"
  13. resultType="shop.alien.entity.store.vo.StoreLicenseInfoVo">
  14. SELECT
  15. CASE
  16. WHEN slh.license_status = 1 THEN '营业执照'
  17. WHEN slh.license_status = 2 THEN '其他资质证明'
  18. ELSE ''
  19. END AS img_description,
  20. CASE
  21. WHEN slh.license_status = 1 THEN 14
  22. WHEN slh.license_status = 2 THEN 35
  23. ELSE 0
  24. END AS img_type,
  25. s.id AS id,
  26. s.store_name AS store_name,
  27. s.store_tel AS store_tel,
  28. su.name AS name,
  29. slh.img_url,
  30. s.business_section_name,
  31. s.business_classify_name,
  32. s.business_types_name,
  33. slh.license_execute_status AS states,
  34. slh.created_time AS submit_date,
  35. CASE
  36. WHEN slh.license_status = 1 THEN s.business_license_expiration_time
  37. ELSE NULL
  38. END AS expiration_time,
  39. slh.reason_refusal AS expiration_reason
  40. FROM store_license_history slh
  41. INNER JOIN store_info s ON slh.store_id = s.id AND s.delete_flag = 0
  42. LEFT JOIN store_user su ON s.id = su.store_id AND su.delete_flag = 0
  43. WHERE slh.delete_flag = 0
  44. <if test="storeName != null and storeName != ''">
  45. AND s.store_name LIKE CONCAT('%', #{storeName}, '%')
  46. </if>
  47. <if test="storeContact != null and storeContact != ''">
  48. AND su.name LIKE CONCAT('%', #{storeContact}, '%')
  49. </if>
  50. <if test="storeTel != null and storeTel != ''">
  51. AND s.store_tel LIKE CONCAT('%', #{storeTel}, '%')
  52. </if>
  53. <if test="businessSection != null and businessSection != ''">
  54. AND s.business_section = #{businessSection}
  55. </if>
  56. <if test="imgType != null and imgType == 14">
  57. AND slh.license_status = 1
  58. </if>
  59. <if test="imgType != null and imgType == 35">
  60. AND slh.license_status = 2
  61. </if>
  62. <if test="states != null and states != ''">
  63. AND slh.license_execute_status = #{states}
  64. </if>
  65. <if test="startSubmitDate != null and startSubmitDate != ''">
  66. AND slh.created_time &gt;= #{startSubmitDate}
  67. </if>
  68. <if test="endSubmitDate != null and endSubmitDate != ''">
  69. AND slh.created_time &lt;= #{endSubmitDate}
  70. </if>
  71. ORDER BY slh.created_time DESC, s.store_name ASC
  72. </select>
  73. </mapper>