From 794a2ec5fa219a0a87be0c72bd59602cb9f6c6dc Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期二, 05 三月 2024 14:19:08 +0800 Subject: [PATCH] 合并代码 --- cloud-server-management/src/main/resources/mapper/TStoreMapper.xml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/cloud-server-management/src/main/resources/mapper/TStoreMapper.xml b/cloud-server-management/src/main/resources/mapper/TStoreMapper.xml index cacc3a4..24ef43b 100644 --- a/cloud-server-management/src/main/resources/mapper/TStoreMapper.xml +++ b/cloud-server-management/src/main/resources/mapper/TStoreMapper.xml @@ -171,4 +171,49 @@ and t1.name like concat("%",#{shopName},"%") </if> </select> + + + + <select id="listStoreAll" resultType="map"> + select + a.id, + CONCAT(a.province, a.city) as province, + b.name as operator, + a.name, + c.gate + from t_store a + left join t_operator b on (a.operatorId = b.id) + left join (select GROUP_CONCAT(id) as gate, storeId from t_gate group by storeId) c on (a.id = c.storeId) + where a.state = 1 + <if test="null != name and '' != name"> + and a.name like CONCAT('%', #{name}, '%') + </if> + <if test="null != operator"> + and a.operatorId = #{operator} + </if> + <if test="null != provinceCode and '' != provinceCode"> + and a.provinceCode = #{provinceCode} + </if> + <if test="null != cityCode and '' != cityCode"> + and a.cityCode = #{cityCode} + </if> + </select> + + + + <select id="listStoreAllByIds" resultType="map"> + select + a.id, + CONCAT(a.province, a.city) as province, + b.name as operator, + a.name, + c.gate + from t_store a + left join t_operator b on (a.operatorId = b.id) + left join (select GROUP_CONCAT(id) as gate, storeId from t_gate group by storeId) c on (a.id = c.storeId) + where a.id in + <foreach collection="ids" item="item" index="index" open="(" separator="," close=")"> + #{item} + </foreach> + </select> </mapper> \ No newline at end of file -- Gitblit v1.7.1