|
@@ -91,7 +91,45 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+ <!-- 根据获取实体List -->
|
|
|
+ <select id="findTotalList" resultType="com.huaxu.entity.ThingSettingEntity">
|
|
|
+ SELECT
|
|
|
+ sum(a.thing_length) as "thingLength" , sum(a.thing_count) as "thingCount"
|
|
|
+ FROM sms_thing_setting a
|
|
|
+ <where>
|
|
|
+ a.status=1
|
|
|
+ <if test="thingSetting.tenantId != null and thingSetting.tenantId != ''">and a.tenant_id = #{thingSetting.tenantId}</if>
|
|
|
+ <if test="thingSetting.thingType != null ">and a.thing_type = #{thingSetting.thingType}</if>
|
|
|
+ <if test="thingSetting.thingObjectType != null ">and a.thing_object_type = #{thingSetting.thingObjectType}</if>
|
|
|
+ <if test="thingSetting.userType!=null and thingSetting.userType!=-999 and thingSetting.userType!=-9999 and thingSetting.programItems != null and thingSetting.programItems.size() > 0">
|
|
|
+ <if test="thingSetting.permissonType == 5 or thingSetting.permissonType == 2">
|
|
|
+ and ( a.DEPT_ORG_ID in
|
|
|
+ <foreach collection="thingSetting.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ or
|
|
|
+ a.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="thingSetting.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="thingSetting.permissonType == 4 or thingSetting.permissonType == 3">
|
|
|
+ and a.DEPT_ORG_ID in
|
|
|
+ <foreach collection="thingSetting.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="thingSetting.permissonType == 1">
|
|
|
+ and a.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="thingSetting.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ and (a.DEPT_ORG_ID is null or a.DEPT_ORG_ID =0)
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
<!-- 根据获取实体 page -->
|
|
|
<select id="findPage" resultType="com.huaxu.entity.ThingSettingEntity">
|
|
|
SELECT
|