HolidaysMapper.xml
1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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.lframework.xingyun.sc.mappers.HolidaysMapper">
<resultMap id="Holidays" type="com.lframework.xingyun.sc.entity.Holidays">
<id column="id" property="id"/>
<result column="year" property="year"/>
<result column="holiday_date" property="holidayDate"/>
<result column="rest" property="rest"/>
<result column="holiday_name" property="holidayName"/>
<result column="create_by_id" property="createById"/>
<result column="create_by" property="createBy"/>
<result column="update_by_id" property="updateById"/>
<result column="update_by" property="updateBy"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="Holidays_sql">
SELECT tb.id,
tb.year,
tb.holiday_date,
tb.rest,
tb.holiday_name,
tb.create_by_id,
tb.create_by,
tb.update_by_id,
tb.update_by,
tb.create_time,
tb.update_time
FROM tbl_holidays AS tb
</sql>
<select id="query" resultMap="Holidays">
<include refid="Holidays_sql"/>
<where>
<if test="vo.year != null">
AND tb.year = #{vo.year}
</if>
<if test="vo.holidayDate != null">
AND tb.holiday_date = #{vo.holidayDate}
</if>
</where>
order by tb.year,tb.holiday_date
</select>
</mapper>