123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?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="MyleaveMapper">
-
- <!--表名 -->
- <sql id="tableName">
- OA_MYLEAVE
- </sql>
-
- <!-- 字段 -->
- <sql id="Field">
- USERNAME,
- TYPE,
- STARTTIME,
- ENDTIME,
- WHENLONG,
- REASON,
- MYLEAVE_ID
- </sql>
-
- <!-- 字段值 -->
- <sql id="FieldValue">
- #{USERNAME},
- #{TYPE},
- #{STARTTIME},
- #{ENDTIME},
- #{WHENLONG},
- #{REASON},
- #{MYLEAVE_ID}
- </sql>
-
- <!-- 新增-->
- <insert id="save" parameterType="pd">
- insert into
- <include refid="tableName"></include>
- (
- <include refid="Field"></include>
- ) values (
- <include refid="FieldValue"></include>
- )
- </insert>
-
- <!-- 删除-->
- <delete id="delete" parameterType="pd">
- delete from
- <include refid="tableName"></include>
- where
- MYLEAVE_ID = #{MYLEAVE_ID}
- </delete>
-
- <!-- 修改 -->
- <update id="edit" parameterType="pd">
- update
- <include refid="tableName"></include>
- set
- TYPE = #{TYPE},
- STARTTIME = #{STARTTIME},
- ENDTIME = #{ENDTIME},
- WHENLONG = #{WHENLONG},
- REASON = #{REASON},
- MYLEAVE_ID = MYLEAVE_ID
- where
- MYLEAVE_ID = #{MYLEAVE_ID}
- </update>
-
- <!-- 通过ID获取数据 -->
- <select id="findById" parameterType="pd" resultType="pd">
- select
- <include refid="Field"></include>
- from
- <include refid="tableName"></include>
- where
- MYLEAVE_ID = #{MYLEAVE_ID}
- </select>
-
- <!-- 列表 -->
- <select id="datalistPage" parameterType="page" resultType="pd">
- select
- l.USERNAME,
- l.TYPE,
- l.STARTTIME,
- l.ENDTIME,
- l.WHENLONG,
- l.MYLEAVE_ID,
- l.REASON
- from
- <include refid="tableName"></include> l
- where 1=1
- <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
- and
- (
- l.REASON LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
- or
- l.USERNAME LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
- )
- </if>
- <if test="pd.USERNAME!= null and pd.USERNAME != ''">
- and l.USERNAME = #{pd.USERNAME}
- </if>
- <if test="pd.TYPE != null and pd.TYPE != ''"><!-- 分类检索 -->
- and l.TYPE=#{pd.TYPE}
- </if>
- order by l.ENDTIME desc
- </select>
-
- <!-- 列表(全部) -->
- <select id="listAll" parameterType="pd" resultType="pd">
- select
- <include refid="Field"></include>
- from
- <include refid="tableName"></include>
- </select>
-
- <!-- 批量删除 -->
- <delete id="deleteAll" parameterType="String">
- delete from
- <include refid="tableName"></include>
- where
- MYLEAVE_ID in
- <foreach item="item" index="index" collection="array" open="(" separator="," close=")">
- #{item}
- </foreach>
- </delete>
-
- <!-- fh313596790qq(青苔) -->
- </mapper>
|