zouxuan 5 years ago
parent
commit
d344bf1ebf

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/SporadicChargeInfoQueryInfo.java

@@ -11,6 +11,17 @@ public class SporadicChargeInfoQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "收费类型",required = false)
     private Integer chargeType;
 
+    @ApiModelProperty(value = "类型",required = false)
+    private String type;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
     public String getOrganId() {
         return organId;
     }

+ 9 - 2
mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml

@@ -91,15 +91,22 @@
 			<if test="chargeType != null">
 				AND sci.charge_type_ = #{chargeType}
 			</if>
+			<if test="type == 'personal'">
+				AND sci.user_id_ IS NOT NULL
+			</if>
+			<if test="type == 'common'">
+				AND sci.user_id_ IS NULL
+			</if>
 			<if test="search != null">
-				AND (sci.title_ LIKE CONCAT('%',#{search},'%') OR su.username LIKE CONCAT('%',#{search},'%'))
+				AND (sci.title_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%'))
 			</if>
 		</where>
 	</sql>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(id_) FROM sporadic_charge_info sci
+		SELECT COUNT(sci.id_) FROM sporadic_charge_info sci
+		LEFT JOIN sys_user su ON su.id_ = sci.user_id_
 		<include refid="queryPageSql"/>
 	</select>
 	<select id="findInfoById" resultMap="SporadicChargeInfo">