<select id="countUser" parameterType="tf56.teamwork.query.TwmCountUserQuery" resultType="tf56.teamwork.query.TwmCustomerOperationLogsCount">
Select inputManName,count(*) count from TwmCustomerOperationLogs
<where>
<if test="startTime != null and startTime != ''">
<![CDATA[ inputDate >= #{startTime}]]>
</if>
<if test="endTime != null and endTime != ''">
<![CDATA[ AND inputDate <= #{endTime}]]>
</if>
<if test="null != antUid and antUid.size > 0 " >
AND inputManId IN
<foreach collection="antUid" index="index" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
GROUP BY inputManName
</select>
resultMap和resultType使用
<select id="getTwmCustomerOperationLogs" parameterType="tf56.teamwork.domain.TwmCustomerOperationLogs" resultMap="twmcustomeroperationlogsFieldMap">
SELECT
customerStatus,
MAX(changeStautusTime) changeStautusTime
FROM TwmCustomerOperationLogs
<where>
<if test="customerCode != null and customerCode.toString() != '' " > customerCode = #{customerCode,jdbcType=VARCHAR}</if>
AND changeStautusTime is not null
</where>
GROUP BY customerStatus
</select>