123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?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="com.ydd.module.mapper.ShopDeviceMapper">
- <resultMap type="ShopDevice" id="ShopDeviceResult">
- <result property="id" column="id" />
- <result property="name" column="name" />
- <result property="merchantId" column="merchant_id" />
- <result property="shopId" column="shop_id" />
- <result property="deviceId" column="device_id" />
- <result property="deviceSn" column="device_sn" />
- <result property="deviceSecret" column="device_secret" />
- <result property="onlineStatus" column="online_status" />
- <result property="status" column="status" />
- <result property="remark" column="remark" />
- </resultMap>
- <select id="findList" resultType="com.ydd.module.dto.DeviceDto">
- select sd.*,d.name as deviceName,d.img
- from lb_shop_device as sd
- left join lb_device as d
- on d.id = sd.device_id
- where sd.deleted=0 and sd.shop_id = #{shopId}
- <if test="deviceType == 2">
- and sd.device_type>=21 and sd.device_type<=27
- </if>
- <if test="deviceType != 2">
- and sd.device_type like concat(#{deviceType}, '%')
- </if>
- </select>
- <select id="findDetail" resultType="com.ydd.module.dto.ShopDeviceDto">
- select *
- from lb_shop_device
- where id = #{id}
- </select>
- <select id="queryList" resultType="com.ydd.module.domain.ShopDevice">
- SELECT sd.*
- FROM lb_shop_device sd
- LEFT JOIN lb_merchant m on sd.merchant_id = m.id
- WHERE 1=1 AND sd.device_type != 11 AND sd.deleted = 0
- <if test="params.dadaDspId != null">
- <if test="params.dadaDspId != 0">
- AND m.dada_dsp_id = #{params.dadaDspId}
- </if>
- <if test="params.dadaDspId == 0">
- AND m.dada_dsp_id is not null
- </if>
- </if>
- <if test="params.merchantId != null and params.merchantId != ''">
- AND sd.merchant_id = #{params.merchantId}
- </if>
- <if test="params.shopId != null and params.shopId != ''">
- AND sd.shop_id = #{params.shopId}
- </if>
- <if test="params.deviceId != null and params.deviceId != ''">
- AND sd.device_id = #{params.deviceId}
- </if>
- <if test="params.deviceName != null">
- AND sd.name like concat('%', #{params.deviceName}, '%')
- </if>
- <if test="params.deviceType != null">
- AND sd.device_type = #{params.deviceType}
- </if>
- <if test="params.deviceId != null and params.deviceId != ''">
- AND sd.device_id = #{params.deviceId}
- </if>
- <if test="params.deviceSn != null and params.deviceSn != ''">
- AND sd.device_sn like concat('%', #{params.deviceSn}, '%')
- </if>
- <if test="params.onlineStatus != null">
- AND sd.online_status = #{params.onlineStatus}
- </if>
- <if test="params.status != null">
- AND sd.status = #{params.status}
- </if>
- <if test="ids != null">
- AND sd.merchant_id IN
- <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- ORDER BY sd.create_time DESC
- </select>
- <select id="findByDeviceSn" resultType="com.ydd.module.domain.ShopDevice">
- select id,`name`,merchant_id,shop_id,device_id,device_type,device_name from lb_shop_device where device_sn = #{deviceSn} and deleted = 0
- </select>
- <select id="findUsbPrintList" resultType="com.ydd.module.dto.ShopDeviceDto">
- select
- id,
- name,
- status,
- device_id,
- device_name,
- width,
- print_customer_count,
- print_merchant_count,
- print_kitchen_count,
- open_order_print,
- open_order_cancel_print
- from lb_shop_device
- where shop_id = #{shopId}
- and device_type = 99
- and deleted = 0
- and status = 1
- </select>
- </mapper>
|