對數據記錄進行統計

統計線索的個數

	<!-- 統計查詢 -->
	<select id="countTwmClew" parameterType="tf56.teamwork.query.TwmcClewCountQuery" resultType="java.lang.Integer">
		SELECT count(clewId) as twmClew
		FROM TwmClew
		WHERE  organizationIds = #{organizationIds,jdbcType=VARCHAR}
		<if test="businessType != null and businessType != ''" > AND businessType = #{businessType,jdbcType=INTEGER}</if>
		<if test="operatorId != null and operatorId != ''" > AND updateManId = #{operatorId,jdbcType=VARCHAR}</if>
		<if test="operatorIdList !=null and operatorIdList.size > 0">
			AND updateManId in
			<foreach collection="operatorIdList" item="operatorId" open="(" close=")" separator=",">
				#{operatorId}
			</foreach>
		</if>
		<if test="startDate != null and startDate != ''">
			<![CDATA[ AND inputDate >= #{startDate}]]>
		</if>
		<if test="endDate != null and endDate != ''">
			<![CDATA[ AND inputDate <= #{endDate}]]>
		</if>
		AND isDeleted = 0
	</select>

DAO層的返回類型:

	/**
	 * 統計線索個數
	 * @param twmcClewCountQuery
	 * @return
	 */
	Integer  countTwmClew(TwmcClewCountQuery twmcClewCountQuery);

注意返回的類型mapper文件:
在這裏插入圖片描述
代碼層面:
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章