综合服务官网 (tmxkj.top)https://tmxkj.top/#/
?新一个.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nengtou.cloudpivotextensionportal.mapper.YgycMpDao">
<select id="selectProName" resultType="java.util.Map" parameterType="java.util.Map">
SELECT distinct special_name FROM pm_enter_project_info where appli_name=#{appliName}
<if test="proName !=null and proName !=''">
and pro_name = #{proName}
</if>
<if test="year !=null and year !=''">
and fiscal_year = #{year}
</if>
</select>
</mapper>
? ? 注意:??namespace 后面的路径是实体类的路径 ,id是方法名字,resultType 是返回数据类型的格式,也可以设置返回实体类
@Mapper
public interface YgycMpDao extends BaseMapper<YgycMp> {
ArrayList<Object> selectProName(String appliName,String proName,String year);
}
3.在ServiceImpI业务类里面调用方法
ArrayList<Object> list= ygycMpDao.selectProName("参数1", "参数2","参数3");
overover