政策查询系统(安卓)1

老师现在又要求将此系统功能实现在安卓端,正好最近学习了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;

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);
}

}
posted @   平安喜乐×  阅读(9)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
· 为什么 退出登录 或 修改密码 无法使 token 失效
点击右上角即可分享
微信分享提示