saas-export项目---company查询

company查询

查看列表页面controller

@RequestMapping(path="/toList",method = RequestMethod.GET)
    public String toList(){
        return "company/company-list";
    }

Test

    @Autowired
    ICompanyService service;
    @Test
    public void test01(){
        List<Company> list=service.findAll();
        System.out.println(list);
    }

ICompanyService

 List<Company> findAll();

CompanyServiceImpl

    @Autowired
    ICompanyDao dao;
    @Override
    public List<Company> findAll() {
        return dao.findAll();
    }

ICompanyDao

 List<Company> findAll();

ICompanyDao.xml

<select id="findAll" resultType="company">
select
	id,
	name ,
	expiration_date as expirationDate ,
	address,
	license_id as licenseId  ,
	representative ,
	phone  ,
	company_size as companySize  ,
	industry  ,
	remarks ,
	state,
	balance ,
	city
from ss_company
    </select>

controller层

    private static final Logger l= LoggerFactory.getLogger(CompanyController.class);
    @Autowired
    ICompanyService service;
    @RequestMapping(path = "/toList",method = RequestMethod.GET)
    public String toList(Model model){
        List<Company> list=service.findAll();
        l.info("list==",list);
        model.addAttribute("list",list);
        return "company/company-list";
    }

jsp使用foreach迭代

<c:forEach items="${list}" var="item">
                    <tr>
                        <td><input name="ids" value="${item.id}" type="checkbox"></td>
                        <td>
                            ${item.name}
                        </td>
                        <td>${item.city}</td>
                        <td>${item.address}</td>
                        <td>${item.representative}</td>
                        <td>${item.phone}</td>
                        <td>${item.industry}</td>
                        <td>${item.state ==0?'未审核':'已审核'}</td>
                        <td class="text-center">${item.balance}</td>
                        <td class="text-center">
                            <button type="button" class="btn bg-olive btn-xs" onclick='#'>编辑</button>
                        </td>
                    </tr>
                    </c:forEach>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值