|
@@ -73,18 +73,28 @@
|
|
|
|
|
|
|
|
<select id="getListVo" resultType="com.zd.bottle.vo.BottleStorageVo"
|
|
<select id="getListVo" resultType="com.zd.bottle.vo.BottleStorageVo"
|
|
|
parameterType="com.zd.bottle.vo.BottleStorageVo">
|
|
parameterType="com.zd.bottle.vo.BottleStorageVo">
|
|
|
|
|
+ select * from (
|
|
|
select bs.*,
|
|
select bs.*,
|
|
|
- (select count(1) from ab_use_record ur where ur.storage_id=bs.id) numberPersons,
|
|
|
|
|
- ( select max(ur.use_time) from ab_use_record ur where ur.storage_id=bs.id ORDER BY use_time desc ) lastTime
|
|
|
|
|
|
|
+ (select count(1) from ab_use_record ur where ur.storage_id=bs.id) numberPersons,
|
|
|
|
|
+ ( select max(ur.use_time) from ab_use_record ur where ur.storage_id=bs.id ORDER BY use_time desc ) lastTime
|
|
|
from ab_bottle_storage bs
|
|
from ab_bottle_storage bs
|
|
|
- where 1=1
|
|
|
|
|
- <if test="searchValue != null">
|
|
|
|
|
|
|
+ where 1=1
|
|
|
|
|
+ <if test="searchValue != null and searchValue != ''">
|
|
|
and (bs.electronic_tag like concat('%', #{searchValue}, '%')
|
|
and (bs.electronic_tag like concat('%', #{searchValue}, '%')
|
|
|
or bs.air_number like concat('%', #{searchValue}, '%') )
|
|
or bs.air_number like concat('%', #{searchValue}, '%') )
|
|
|
</if>
|
|
</if>
|
|
|
<if test="storageStatus != null ">and storage_status = #{storageStatus}</if>
|
|
<if test="storageStatus != null ">and storage_status = #{storageStatus}</if>
|
|
|
- <if test="startTime != null "> and date_format(bs.create_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')</if>
|
|
|
|
|
- <if test="endTime != null "> and date_format(bs.create_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')</if>
|
|
|
|
|
|
|
+ <if test="ids != null ">
|
|
|
|
|
+ and bs.id in
|
|
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ ) t where 1=1
|
|
|
|
|
+ <if test="startTime != null ">
|
|
|
|
|
+ and date_format(t.lastTime,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')</if>
|
|
|
|
|
+ <if test="endTime != null ">
|
|
|
|
|
+ and date_format(t.lastTime,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="returnGas" parameterType="com.zd.bottle.vo.BottleStorageUseVo" resultType="com.zd.bottle.vo.BottleStorageUseVo">
|
|
<select id="returnGas" parameterType="com.zd.bottle.vo.BottleStorageUseVo" resultType="com.zd.bottle.vo.BottleStorageUseVo">
|