mybatis中根据日期模糊查询
'%Y-%m-%d'日期格式可以根据自己来进行控制
<resultMap type="String" id="ids">
<result property="id" column="id" />
</resultMap>
<!--查出详情表中当前用户,当前月份的所有ID-->
<select id="selectIds" parameterType="GxqFwzxDetailtableedit" resultMap="ids">
select id from sys_gxq_fwzx_detailtableedit
<where>
<if test="userId != null "> and userId = #{userId}</if>
<if test="createTime != null "> and DATE_FORMAT(create_time, '%Y-%m') = DATE_FORMAT(#{createTime}, '%Y-%m')</if>
<!--<if test="createTime != null ">create_time = #{createTime},</if>-->
</where>
</select>