<?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.gaowj.business.student.studentDAO"> <insert id="insert_student" parameterType="map"> insert into C_T_TEST( <trim prefix="" suffixOverrides=","> <foreach collection="infoListKey" item="key"> ${key}, </foreach> </trim> <![CDATA[ ) values( ]]> <trim prefix="" suffixOverrides=","> <foreach collection="infoList" item="value"> #{value}, </foreach> </trim> <![CDATA[ ) ]]> </insert> <update id="update_student" parameterType="map"> <![CDATA[ update C_T_TEST set ]]> <trim prefix="" suffixOverrides=","> <foreach collection="info" item="info"> ${info.key} = #{info.value} , </foreach> </trim> <where> <if test="UUID != null and UUID != ''"> and UUID = #{UUID} </if> </where> </update> <delete id="delete_student" parameterType="list"> <![CDATA[ delete from C_T_TEST where UUID IN ]]> <foreach collection="list" item="UUID" open="(" separator="," close=")"> #{UUID} </foreach> </delete> <select id="list_student" parameterType="map" resultType="upperCaseKeyMap"> <![CDATA[ select f.* from C_T_TEST f where 1=1 ]]> <if test="UUID != null and UUID != ''"> and f.UUID = #{UUID} </if> <if test="START_TIME != null and START_TIME != ''"> and f.CREATE_TIME >= #{START_TIME} </if> <if test="END_TIME != null and END_TIME != ''"> and f.CREATE_TIME <= #{END_TIME} </if> <if test="NAME != null and NAME != ''"> and f.NAME like '%${NAME}%' </if> <if test="SEX != null and SEX != ''"> and f.SEX = #{SEX} </if> <if test="NATION != null and NATION != ''"> and f.NATION = #{NATION} </if> <if test="STATUS != null and STATUS != ''"> and f.STATUS = #{STATUS} </if> order by f.CREATE_TIME DESC </select> <select id="listCount_student" parameterType="map" resultType="int"> <![CDATA[ select count(*) c from C_T_TEST f where 1=1 ]]> <if test="UUID != null and UUID != ''"> and f.UUID = #{UUID} </if> <if test="START_TIME != null and START_TIME != ''"> and f.CREATE_TIME >= #{START_TIME} </if> <if test="END_TIME != null and END_TIME != ''"> and f.CREATE_TIME <= #{END_TIME} </if> <if test="NAME != null and NAME != ''"> and f.NAME like '%${NAME}%' </if> <if test="SEX != null and SEX != ''"> and f.SEX = #{SEX} </if> <if test="NATION != null and NATION != ''"> and f.NATION = #{NATION} </if> <if test="STATUS != null and STATUS != ''"> and f.STATUS = #{STATUS} </if> </select> </mapper>