12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?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.miaxis.exam.mapper.ExamInfoMapper">
- <resultMap type="ExamInfo" id="ExamInfoResult">
- <result property="id" column="id" />
- <result property="name" column="name" />
- <result property="image" column="image" />
- <result property="provinceId" column="province_id" />
- <result property="province" column="province" />
- <result property="cityId" column="city_id" />
- <result property="city" column="city" />
- <result property="price" column="price" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="selectExamInfoVo">
- select * from exam_info
- </sql>
- <select id="selectExamInfoList" parameterType="ExamInfo" resultMap="ExamInfoResult">
- <include refid="selectExamInfoVo"/>
- <where>
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
- <if test="image != null and image != ''"> and image = #{image}</if>
- <if test="provinceId != null and provinceId != ''"> and province_id = #{provinceId}</if>
- <if test="province != null and province != ''"> and province = #{province}</if>
- <if test="cityId != null and cityId != ''"> and city_id = #{cityId}</if>
- <if test="city != null and city != ''"> and city = #{city}</if>
- </where>
- </select>
- <select id="getProvice" resultType="com.miaxis.exam.vo.ExamInfoProviceVo">
- select province_id,province from exam_info group by province_id,province
- </select>
- <select id="getCity" resultType="com.miaxis.exam.vo.ExamInfoCityVo">
- select city_id,city from exam_info where province_id = #{provinceId}
- GROUP BY city_id,city
- </select>
- </mapper>
|