| | |
| | | delete from t_store_other_config where id =#{id} |
| | | </delete> |
| | | |
| | | <select id="listAll" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*,t2.name userName,t2.phone userPhone,t3.name yysName |
| | | from t_store t1 left join sys_user t2 on t1.storeStaffId = t2.id left join t_operator t3 on t1.operatorId = t3.id |
| | | <!-- |
| | | phone 明确映射为 t_store.phone。不要同时返回两个名为 phone 的列, |
| | | 否则 MyBatis 自动映射可能按 JDBC 列顺序覆盖该字段。 |
| | | --> |
| | | <resultMap id="storeListResultMap" type="com.dsh.guns.modular.system.model.TStoreListVo" autoMapping="true"> |
| | | <result property="phone" column="storePhone"/> |
| | | </resultMap> |
| | | |
| | | <select id="listAll" resultMap="storeListResultMap"> |
| | | select t1.*, |
| | | t1.phone as storePhone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join t_operator t3 on t1.operatorId = t3.id |
| | | where 1=1 |
| | | <if test="provinceCode !=null and provinceCode !=''"> |
| | | and t1.provinceCode = #{provinceCode} |
| | |
| | | and t1.cityCode = #{cityCode} |
| | | </if> |
| | | <if test="name !=null and name !=''"> |
| | | and t2.name like concat("%",#{name},"%") |
| | | and t1.managerName like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and t2.phone like concat("%",#{phone},"%") |
| | | and t1.phone like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | |
| | | <if test="operatorId !=null and operatorId !=''"> |
| | | and t1.operatorId = #{operatorId} |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | <select id="queryProvince" resultType="map"> |
| | | select * from ( |
| | | select provinceCode as code, province as name from t_store where state = 1 |
| | | select provinceCode as code, MIN(province) as name from t_store where state = 1 |
| | | <if test="null != cityCode and '' != cityCode"> |
| | | and cityCode = #{cityCode} |
| | | </if> |
| | |
| | | |
| | | <select id="queryCity" resultType="map"> |
| | | select * from ( |
| | | select cityCode as code, city as name from t_store where state = 1 and provinceCode = #{provinceCode} |
| | | select cityCode as code, MIN(city) as name from t_store where state = 1 and provinceCode = #{provinceCode} |
| | | <if test="null != cityCode and '' != cityCode"> |
| | | and cityCode = #{cityCode} |
| | | </if> |
| | | group by cityCode |
| | | ) as aa order by aa.code |
| | | </select> |
| | | <select id="queryCity2" resultType="map"> |
| | | |
| | | select * from ( |
| | | select cityCode as code, MIN(city) as name |
| | | from t_store where state = 1 and provinceCode = #{provinceCode} |
| | | <if test="null != cityCode and '' != cityCode"> |
| | | and cityCode = #{cityCode} |
| | | </if> |
| | | <if test="null != type"> |
| | | and `type` = #{type} |
| | | </if> |
| | | <if test="null != operatorId"> |
| | | and operatorId = #{operatorId} |
| | | </if> |
| | | group by cityCode |
| | | ) as aa order by aa.code |
| | | </select> |
| | | |
| | | <select id="queryCity1" resultType="map"> |
| | | select * from ( |
| | | select cityCode as code, city as name from t_store where state = 1 |
| | | select cityCode as code, MIN(city) as name from t_store where state = 1 |
| | | group by cityCode |
| | | ) as aa order by aa.code |
| | | </select> |
| | |
| | | <if test="storeName != null and storeName != ''"> |
| | | and `name` like CONCAT('%',#{storeName},'%') |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | <select id="listOne" resultType="java.util.Map"> |
| | | select id,name,sort,state from t_store_other where storeId=#{id} |
| | | select id,name,sort,state from t_store_other where storeId=#{id} order by id desc |
| | | </select> |
| | | <select id="typeChange" resultType="java.util.Map"> |
| | | select t1.id,t1.name from t_turn t1 left join t_turn t2 on t1.pid = t2.id where t2.name =#{name} |
| | | select t1.id,t1.name from t_turn t1 left join t_turn t2 on t1.pid = t2.id where t2.name =#{name} order by t1.id desc |
| | | </select> |
| | | <select id="typeChangeOne" resultType="java.util.Map"> |
| | | select id,name from t_turn where pid =#{id} |
| | | select id,name from t_turn where pid =#{id} order by id desc |
| | | </select> |
| | | <select id="getConfig" resultType="java.lang.String"> |
| | | select name from t_turn where id =#{page} |
| | | </select> |
| | | <select id="listTwo" resultType="java.util.Map"> |
| | | select id,url,name , page,sort from t_store_other_config |
| | | select id,url,name , page,sort from t_store_other_config order by id desc |
| | | </select> |
| | | |
| | | <select id="getPage" resultType="com.dsh.guns.modular.system.model.TTurn"> |
| | |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by t_turn.id desc |
| | | </select> |
| | | <select id="pageList" resultType="com.dsh.guns.modular.system.model.TTurn"> |
| | | select * from t_turn where pid = 0 |
| | | select * from t_turn where pid = 0 order by id desc |
| | | </select> |
| | | <select id="get" resultType="com.dsh.course.dto.JsDto"> |
| | | select * from t_js where id = #{id} |
| | |
| | | |
| | | |
| | | <select id="getConfig1" resultType="com.dsh.guns.modular.system.model.TImgConfig"> |
| | | select * from t_img_config |
| | | select * from t_img_config order by id desc |
| | | </select> |
| | | |
| | | |
| | |
| | | SELECT op.id , CONCAT(us.name,'-',us.`phone`) as value |
| | | FROM t_operator op |
| | | LEFT JOIN sys_user us on op.userId = us.id |
| | | order by op.id desc |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | <select id="listAllStore" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*,t2.name userName,t2.phone userPhone,t3.name yysName from t_store t1 left join sys_user t2 on t1.storeStaffId = t2.id left join t_operator t3 on t1.operatorId = t3.id |
| | | <select id="listAllStore" resultMap="storeListResultMap"> |
| | | select t1.*, |
| | | t1.phone as storePhone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join t_operator t3 on t1.operatorId = t3.id |
| | | where t1.id =#{id} |
| | | <if test="provinceCode !=null and provinceCode !=''"> |
| | | and t1.provinceCode = #{provinceCode} |
| | |
| | | and t1.cityCode = #{cityCode} |
| | | </if> |
| | | <if test="name !=null and name !=''"> |
| | | and t2.name like concat("%",#{name},"%") |
| | | and t1.managerName like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and t2.phone like concat("%",#{phone},"%") |
| | | and t1.phone like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | <select id="listAllStoresByIds" resultMap="storeListResultMap"> |
| | | select t1.*, |
| | | t1.phone as storePhone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join t_operator t3 on t1.operatorId = t3.id |
| | | where t1.id in |
| | | <foreach collection="ids" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | <if test="provinceCode !=null and provinceCode !=''"> |
| | | and t1.provinceCode = #{provinceCode} |
| | | </if> |
| | | <if test="cityCode !=null and cityCode !=''"> |
| | | and t1.cityCode = #{cityCode} |
| | | </if> |
| | | <if test="name !=null and name !=''"> |
| | | and t1.managerName like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and t1.phone like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | <select id="querySiteListOfpage" resultType="java.util.Map"> |
| | | SELECT t1.id, t1.operatorId, t1.province, t1.city, t2.name,t1.ids,t1.name as siteName |
| | | SELECT t1.id, t2.operatorId, t1.province, t1.city, t2.name,t1.ids,t1.name as siteName |
| | | ,t2.type as `type` |
| | | from t_site t1 |
| | | left join t_store t2 on t1.storeId =t2.id |
| | | where t1.state=1 and t2.state=1 |
| | | where t1.state=1 and t2.state=1 and t1.isCanBeBooked = 0 and t1.reservation=0 |
| | | <if test="provinceCode != null and provinceCode!=''"> |
| | | and t1.provinceCode = #{provinceCode} |
| | | </if> |
| | |
| | | and t1.operatorId = #{operatorId} |
| | | </if> |
| | | <if test="storeName != null and storeName != ''"> |
| | | and t1.name like CONCAT('%',#{storeName},'%') |
| | | and t2.name like CONCAT('%',#{storeName},'%') |
| | | </if> |
| | | <if test="storeId != null"> |
| | | and t1.storeId = #{storeId} |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | <select id="querySiteListOfpageOperator" resultType="java.util.Map"> |
| | | SELECT t1.id, t2.operatorId, t1.province, t1.city, t2.name,t1.ids,t1.name as siteName |
| | | ,t2.type as `type` |
| | | from t_site t1 |
| | | left join t_store t2 on t1.storeId =t2.id |
| | | where t1.state=1 and t2.state=1 |
| | | <if test="provinceCode != null and provinceCode!=''"> |
| | | and t1.provinceCode = #{provinceCode} |
| | | </if> |
| | | <if test="cityCode != null and cityCode!=''"> |
| | | and t1.cityCode = #{cityCode} |
| | | </if> |
| | | |
| | | <if test="storeName != null and storeName != ''"> |
| | | and t2.name like CONCAT('%',#{storeName},'%') |
| | | </if> |
| | | <if test="storeIds != null and storeIds.size()>0"> |
| | | AND t1.storeId IN |
| | | <foreach collection="storeIds" separator="," item="id" open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | order by t1.id desc |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listStoreAll" resultType="map"> |
| | | select |
| | |
| | | <if test="null != cityCode and '' != cityCode"> |
| | | and a.cityCode = #{cityCode} |
| | | </if> |
| | | order by a.id desc |
| | | </select> |
| | | |
| | | |
| | |
| | | <foreach collection="ids" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | order by a.id desc |
| | | </select> |
| | | </mapper> |
| | | </mapper> |