<?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.stylefeng.guns.modular.system.dao.TCarColorMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TCarColor">
|
<id column="id" property="id" />
|
<result column="name" property="name" />
|
<result column="insertTime" property="insertTime"/>
|
<result column="state" property="state"/>
|
</resultMap>
|
|
|
<select id="list" resultType="map">
|
select
|
id as id,
|
name as name,
|
DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i:%s') as insertTime
|
from t_car_color where state = 1
|
<if test="null != createTime and '' != createTime">
|
and insertTime between CONCAT(#{createTime}, ' 00:00:00') and CONCAT(#{createTime}, ' 23:59:59')
|
</if>
|
<if test="null != name and '' != name">
|
and name like CONCAT('%', #{name}, '%')
|
</if>
|
order by insertTime desc
|
<if test="null != offset and null != limit">
|
limit #{offset}, #{limit}
|
</if>
|
</select>
|
|
|
<select id="listCount" resultType="int">
|
select
|
count(1)
|
from t_car_color where state = 1
|
<if test="null != createTime and '' != createTime">
|
and insertTime between CONCAT(#{createTime}, ' 00:00:00') and CONCAT(#{createTime}, ' 23:59:59')
|
</if>
|
<if test="null != name and '' != name">
|
and name like CONCAT('%', #{name}, '%')
|
</if>
|
</select>
|
</mapper>
|