今天进行了小测,
对于数据库中各种查询
<?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.example.demo.mapper.LoginMapper"> <update id="updateZeng"> upsert into TEST(JNAME, TADDRESS, ADDRESS, EMAIL, FNAME, PHONE, JSHU, JJAN, JXU, XUMIN, XUMAX, MAINWEN, GAN, YU, KEY1, KEY2, KEY3, KEY4, KEY5, JIJIE, KEHE) VALUES (#{JName}, #{TAddress}, #{address}, #{email}, #{FName}, #{phone}, #{JShu}, #{JJan}, #{JXu}, #{XuMin}, #{XuMax}, #{MainWen}, #{gan}, #{yu}, #{key1}, #{key2}, #{key3}, #{key4}, #{key5}, #{JiJue}, #{KeHe}) </update> <delete id="deleteZeng"> delete from TEST where JNAME = #{JName} </delete> <select id="selectAll" resultType="com.example.demo.pojo.login"> select * from TEST </select> <select id="selectByDuo" resultType="com.example.demo.pojo.login"> select * from TEST <where> <if test="JName !=null"> JName like #{JName} </if> <if test="address != null"> or address like #{address} </if> <if test="JXu != null"> or JXu like #{JXu} </if> <if test="key1 != null"> or key1 like #{key1} </if> </where> order by JName desc </select> <select id="selectCount" resultType="com.example.demo.pojo.login"> select count(*) from TEST where KEHE = #{KeHe} </select> <select id="selectOne" resultType="com.example.demo.pojo.login"> select * from TEST where JNAME=#{JName} </select> </mapper>
标签:15,like,09,JXu,2023,TEST,address,JName,select From: https://www.cnblogs.com/JJTyyds/p/17705883.html