mysql接收list参数以及日期格式化

mysql接收list参数

List<MarketAnalysisCompanys> getCompanyReduceData(String companyId,List<String> labelNameList, String beginTime, String endTime);
    <select id="getCompanyReduceData" resultType="com.spang.wechat.entity.MarketAnalysisCompanys">
        SELECT max(production_plan) production_plan,label_company_name
        FROM market_analysis_companys
        where company_id =#{companyId}
        and label_company_name in
        <foreach item="item" index="index" collection="labelNameList" open="(" separator="," close=")">
            #{item}
        foreach>
        and data_time between #{beginTime} and #{endTime}
        GROUP BY date_format(data_time,'%Y%m')
    select>

你可能感兴趣的:(实战经验,mysql,数据库)