| | |
| | | |
| | | <select id="queryAll" resultType="com.dsh.other.entity.Game"> |
| | | SELECT |
| | | ga.*,st.`name` as store,op.`name` as operation,si.`name` as site |
| | | ga.*,st.`name` as store,op.`name` as operation,si.`name` as site |
| | | FROM |
| | | t_game ga |
| | | LEFT JOIN t_store st ON ga.storeId = st.id |
| | | LEFT JOIN t_operator op ON ga.operationId = op.id |
| | | LEFT JOIN t_site si on ga.siteId = si.id |
| | | t_game ga |
| | | LEFT JOIN t_store st ON ga.storeId = st.id |
| | | LEFT JOIN t_operator op ON ga.operationId = op.id |
| | | LEFT JOIN t_site si on ga.siteId = si.id |
| | | where 1=1 |
| | | <if test ="query.type==3"> |
| | | and st.id =#{query.id} |
| | | </if> |
| | | <if test ="query.type==2"> |
| | | and ga.operationId =#{query.id} |
| | | </if> |
| | | <if test="query.provinceCode!=null and query.provinceCode!=''"> |
| | | and ga.provinceCode = #{query.provinceCode} |
| | | <if test="query.type==3"> |
| | | and st.id =#{query.id} |
| | | </if> |
| | | <if test="query.type==2"> |
| | | and ga.operationId =#{query.id} |
| | | </if> |
| | | <if test="query.provinceCode!=null and query.provinceCode!=''"> |
| | | and ga.provinceCode = #{query.provinceCode} |
| | | |
| | | </if> |
| | | <if test="query.cityCode!=null and query.cityCode!=''"> |
| | | and ga.cityCode = #{query.cityCode} |
| | | </if> |
| | | <if test="query.cityCode!=null and query.cityCode!=''"> |
| | | and ga.cityCode = #{query.cityCode} |
| | | |
| | | </if> |
| | | <if test="query.store!=null and query.store!=''"> |
| | | and st.`name` like concat('%',#{query.store},'%') |
| | | </if> |
| | | <if test="query.store!=null and query.store!=''"> |
| | | and st.`name` like concat('%',#{query.store},'%') |
| | | |
| | | </if> |
| | | <if test="query.site!=null and query.site!=''"> |
| | | and si.`name` like concat('%',#{query.site},'%') |
| | | </if> |
| | | <if test="query.site!=null and query.site!=''"> |
| | | and si.`name` like concat('%',#{query.site},'%') |
| | | |
| | | </if> |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | <select id="orderlist" resultType="map"> |
| | | SELECT *,st.`name` as storeName,si.`name` as siteName,CONCAT(DATE_FORMAT(bk.startTime, '%Y-%m-%d %H:%i:%s'), ' - ', TIME_FORMAT(bk.endTime, '%H:%i:%s')) AS timeRange |
| | | SELECT *,st.`name` as storeName,si.`name` as siteName,CONCAT(DATE_FORMAT(bk.startTime, '%Y-%m-%d %H:%i:%s'), ' - |
| | | ', TIME_FORMAT(bk.endTime, '%H:%i:%s')) AS timeRange |
| | | FROM t_site_booking bk |
| | | LEFT JOIN t_store st on bk.storeId = st.id |
| | | LEFT JOIN t_site si on bk.siteId = si.id |
| | | LEFT JOIN t_store st on bk.storeId = st.id |
| | | LEFT JOIN t_site si on bk.siteId = si.id |
| | | <where> |
| | | <if test="provinceCode!=null and provinceCode!= ''"> |
| | | and bk.provinceCode=#{provinceCode} |
| | | </if> |
| | | <if test="provinceCode!=null and provinceCode!= ''"> |
| | | and bk.provinceCode=#{provinceCode} |
| | | </if> |
| | | <if test="cityCode!=null and cityCode!= ''"> |
| | | and bk.cityCode=#{cityCode} |
| | | and bk.cityCode=#{cityCode} |
| | | </if> |
| | | |
| | | <if test="store!=null and store!= ''"> |
| | | and st.name=#{store} |
| | | and st.name=#{store} |
| | | </if> |
| | | |
| | | <if test="peopleName!=null and peopleName!= ''"> |
| | | and bk.booker=#{peopleName} |
| | | and bk.booker=#{peopleName} |
| | | </if> |
| | | |
| | | <if test="phone!=null and phone!= ''"> |
| | | and bk.phone=#{phone} |
| | | and bk.phone=#{phone} |
| | | </if> |
| | | |
| | | |
| | | <if test="date!=null and date!= ''"> |
| | | and bk.times like concat('%',#{date},'%') </if> |
| | | and bk.times like concat('%',#{date},'%') |
| | | </if> |
| | | <if test="payMethod!=null "> |
| | | and bk.payType=#{payMethod} |
| | | and bk.payType=#{payMethod} |
| | | </if> |
| | | |
| | | <if test="state!=null "> |
| | | and bk.status=#{state} |
| | | and bk.status=#{state} |
| | | </if> |
| | | <if test="storeId!=null "> |
| | | and st.id=#{storeId} |
| | | and st.id=#{storeId} |
| | | </if> |
| | | <if test="storeIds != null and storeIds.size()>0"> |
| | | AND bk.storeId IN |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | |
| | | |
| | | </where> |
| | | |
| | | |
| | | |
| | | |
| | | </select> |