|
@@ -15,84 +15,48 @@
|
|
|
LEFT JOIN t_order o on o.id = co.order_id
|
|
|
LEFT JOIN t_company com ON com.id = i.company_id
|
|
|
WHERE 1 = 1
|
|
|
- <if test=" searchKey != null and searchKey !='' " >
|
|
|
- and (t.child_name like concat('%',#{searchKey},'%') or u.user_name like CONCAT('%', #{searchKey},'%'))
|
|
|
+ <if test=" param.searchKey != null and param.searchKey !='' " >
|
|
|
+ and (t.child_name like concat('%',#{param.searchKey},'%') or u.user_name like CONCAT('%', #{param.searchKey},'%'))
|
|
|
</if>
|
|
|
- <if test=" type != null and type !='' and type == 1" >
|
|
|
- and (t.create_time >= #{startDate} or t.create_time <= #{endDate})
|
|
|
+ <if test=" param.type != null and param.type !='' and param.type == 1" >
|
|
|
+ and (t.create_time >= #{param.startDate} or t.create_time <= #{param.endDate})
|
|
|
</if>
|
|
|
- <if test=" type != null and type !='' and type == 2" >
|
|
|
- and (co.create_time >= #{startDate} or co.create_time <= #{endDate})
|
|
|
+ <if test=" param.type != null and param.type !='' and param.type == 2" >
|
|
|
+ and (co.create_time >= #{param.startDate} or co.create_time <= #{param.endDate})
|
|
|
</if>
|
|
|
- <if test=" type != null and type !='' and type == 3" >
|
|
|
- and (ct.activated_time >= #{startDate} or t.activated_time <= #{endDate})
|
|
|
+ <if test=" param.type != null and param.type !='' and param.type == 3" >
|
|
|
+ and (ct.activated_time >= #{param.startDate} or t.activated_time <= #{param.endDate})
|
|
|
</if>
|
|
|
- <if test="orderBy != null">
|
|
|
- order by ${orderBy}
|
|
|
- </if>
|
|
|
- <if test="start != null and pageSize!=null">
|
|
|
- limit ${start}, ${pageSize}
|
|
|
+ <if test="param.orderBy != null">
|
|
|
+ order by ${param.orderBy}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
|
|
|
- <select id="queryCountByParams" resultType="integer">
|
|
|
- SELECT count(*) from t_camera t
|
|
|
- INNER JOIN t_camera_detail i ON t.id = i.camera_id
|
|
|
- INNER JOIN t_goods g on g.id = i.goods_id
|
|
|
- LEFT JOIN t_user u ON i.user_id = u.id
|
|
|
- LEFT JOIN t_camera_out co on t.id = co.camera_id
|
|
|
- LEFT JOIN t_order o on o.id = co.order_id
|
|
|
- LEFT JOIN t_company com ON com.id = i.company_id
|
|
|
- WHERE 1 = 1
|
|
|
- <if test=" searchKey != null and searchKey !='' " >
|
|
|
- and (t.child_name like concat('%',#{searchKey},'%') or u.user_name like CONCAT('%', #{searchKey},'%'))
|
|
|
- </if>
|
|
|
- <if test=" type != null and type !='' and type == 1" >
|
|
|
- and (t.create_time >= #{startDate} or t.create_time <= #{endDate})
|
|
|
- </if>
|
|
|
- <if test=" type != null and type !='' and type == 2" >
|
|
|
- and (co.create_time >= #{startDate} or co.create_time <= #{endDate})
|
|
|
- </if>
|
|
|
- <if test=" type != null and type !='' and type == 3" >
|
|
|
- and (ct.activated_time >= #{startDate} or t.activated_time <= #{endDate})
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="queryCompanyCameraListByParams" resultType="com.fdkankan.platform.user.vo.ResponseCamera">
|
|
|
SELECT a.id, a.child_name, a.sn_code, a.rec_status, a.create_time, b.address,
|
|
|
e.user_name FROM `t_camera` a LEFT JOIN `t_camera_detail` b ON a.id = b.camera_id
|
|
|
LEFT JOIN `t_company` c ON b.company_id = c.id
|
|
|
LEFT JOIN `t_manager` d ON c.manager_id = d.id
|
|
|
LEFT JOIN `t_user` e ON b.user_id = e.id WHERE d.username = #{userName}
|
|
|
- <if test=" searchKey != null and searchKey !='' " >
|
|
|
- and a.child_name like concat('%',#{searchKey},'%')
|
|
|
- </if>
|
|
|
- <if test="orderBy != null">
|
|
|
- order by ${orderBy}
|
|
|
+ <if test=" param.searchKey != null and param.searchKey !='' " >
|
|
|
+ and a.child_name like concat('%',#{param.searchKey},'%')
|
|
|
</if>
|
|
|
- <if test="start != null and pageSize!=null">
|
|
|
- limit ${start}, ${pageSize}
|
|
|
+ <if test="param.orderBy != null">
|
|
|
+ order by ${param.orderBy}
|
|
|
</if>
|
|
|
+<!-- <if test="start != null and pageSize!=null">-->
|
|
|
+<!-- limit ${start}, ${pageSize}-->
|
|
|
+<!-- </if>-->
|
|
|
</select>
|
|
|
|
|
|
|
|
|
- <select id="queryCompanyCameraCountByParams" resultType="integer">
|
|
|
- SELECT count(*) FROM `t_camera` a LEFT JOIN `t_camera_detail` b ON a.id = b.camera_id
|
|
|
- LEFT JOIN `t_company` c ON b.company_id = c.id
|
|
|
- LEFT JOIN `t_manager` d ON c.manager_id = d.id
|
|
|
- LEFT JOIN `t_user` e ON b.user_id = e.id WHERE d.username = #{userName}
|
|
|
- <if test=" searchKey != null and searchKey !='' " >
|
|
|
- and a.child_name like concat('%',#{searchKey},'%')
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="cameraList" resultType="com.fdkankan.platform.user.vo.ResponseCamera">
|
|
|
- SELECT a.id, a.sn_code as snCode, a.activated_time as activatedTime, b.own, b.type,
|
|
|
+ SELECT a.id, a.sn_code as snCode, a.activated_time as activatedTime, b.own, b.camera_type as cameraType,
|
|
|
b.agent_framework_id as agentFrameworkId, b.camera_id as cameraId, b.total_space as totalSpace,
|
|
|
b.used_space as usedSpace, b.user_id as userId
|
|
|
FROM t_camera a LEFT JOIN t_camera_detail b on a.id = b.camera_id
|
|
|
- WHERE a.rec_status = 'A'
|
|
|
+ WHERE a.tb_status = 0
|
|
|
<if test=" param.snCode != null and param.snCode !='' " >
|
|
|
and a.sn_code = #{param.snCode}
|
|
|
</if>
|
|
@@ -105,30 +69,9 @@
|
|
|
<if test=" param.cameraId != null and param.cameraId !='' " >
|
|
|
and b.camera_id = #{param.cameraId}
|
|
|
</if>
|
|
|
- <if test="orderBy != null">
|
|
|
- order by ${orderBy}
|
|
|
- </if>
|
|
|
- <if test="start != null and pageSize!=null">
|
|
|
- limit ${start}, ${pageSize}
|
|
|
+ <if test="param.orderBy != null">
|
|
|
+ order by ${param.orderBy}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
- <select id="cameraCount" resultType="integer">
|
|
|
- SELECT count(*)
|
|
|
- FROM t_camera a LEFT JOIN t_camera_detail b on a.id = b.camera_id
|
|
|
- WHERE a.rec_status = 'A'
|
|
|
- <if test=" param.snCode != null and param.snCode !='' " >
|
|
|
- and a.sn_code = #{param.snCode}
|
|
|
- </if>
|
|
|
- <if test=" param.own != null and param.own !='' " >
|
|
|
- and b.own = #{param.own}
|
|
|
- </if>
|
|
|
- <if test=" param.agentFrameworkId != null and param.agentFrameworkId !='' " >
|
|
|
- and b.agent_framework_id = #{param.agentFrameworkId}
|
|
|
- </if>
|
|
|
- <if test=" param.cameraId != null and param.cameraId !='' " >
|
|
|
- and b.camera_id = #{param.cameraId}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
</mapper>
|