老师现在又要求将此系统功能实现在安卓端,正好最近学习了springboot相关知识,便用springboot做后端,安卓的页面做前端编写了此系统
创建springboot项目做好数据库配置
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/wuyi
username: root
password: 20223959
<?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.leap.jixianceshiboot.mapper.PolicyQueryMapper">
<!--动态sql-->
<select id="getPolicy" resultType="com.leap.jixianceshiboot.entity.Policy">
select * from policy
<where>
<if test="name!=null">
name like CONCAT('%', #{name}, '%')
</if>
<if test="document!=null">
and document=#{document}
</if>
<if test="organ!=null">
and organ=#{organ}
</if>
<if test="text!=null">
and text like CONCAT('%', #{text}, '%')
</if>
</where>
</select>
<select id="findPolicyCountsByType" resultType="com.leap.jixianceshiboot.entity.PolicyTypeCount">
SELECT type, COUNT(*) as count
FROM policy
GROUP BY type
</select>
<select id="getPolicy1" resultType="com.leap.jixianceshiboot.entity.Policy">
select * from policy where type = #{type}
</select>
<select id="queryPolicy" resultType="com.leap.jixianceshiboot.entity.Policy">
SELECT * FROM policy WHERE name LIKE CONCAT('%', #{name}, '%');
</select>
<select id="getAll" resultType="com.leap.jixianceshiboot.entity.Policy">
select * from policy
</select>
</mapper>
package com.leap.jixianceshiboot;标签:name,安卓,系统,查询,policy,org,type,springboot From: https://www.cnblogs.com/pinganxile/p/18250446
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class JixianceshiBootApplication {
public static void main(String[] args) {
SpringApplication.run(JixianceshiBootApplication.class, args);
}
}