<?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.matrix.system.common.dao.ProjExceptionDao">
|
<resultMap type="com.matrix.system.common.bean.ProjException" id="ProjExceptionMap">
|
<id property="id" column="id" />
|
<result property="machine" column="machine" />
|
<result property="tel" column="tel" />
|
<result property="owner" column="owner" />
|
<result property="errorMsg" column="errorMsg" />
|
<result property="createTime" column="createTime" />
|
<result property="activityTime" column="activityTime" />
|
<result property="doneTime" column="doneTime" />
|
<result property="doneMan" column="doneMan" />
|
<result property="cause" column="cause" />
|
<result property="solution" column="solution" />
|
<result property="projNo" column="projNo" />
|
<result property="exceptionType" column="exceptionType" />
|
<result property="projName" column="projName" />
|
<result property="mdc" column="mdc" />
|
<result property="simpleMsg" column="simpleMsg" />
|
</resultMap>
|
|
<insert id="insert" parameterType="com.matrix.system.common.bean.ProjException"
|
useGeneratedKeys="true" keyProperty="id">
|
INSERT INTO proj_exception
|
( machine, tel, owner, errorMsg, createTime, activityTime, doneTime, doneMan, cause, solution, projNo, projName, exceptionType,mdc,simpleMsg)
|
VALUES
|
(#{machine}, #{tel}, #{owner}, #{errorMsg}, #{createTime}, #{activityTime}, #{doneTime}, #{doneMan}, #{cause}, #{solution}, #{projNo},#{projName}, #{exceptionType},#{mdc},#{simpleMsg});
|
</insert>
|
|
|
|
<!-- 根据id更新 部分更新 -->
|
<update id="update" parameterType="Long">
|
UPDATE proj_exception
|
<set>
|
<if test="doneTime != null ">
|
doneTime = #{doneTime},
|
</if>
|
<if test="doneMan != null and doneMan !='' ">
|
doneMan = #{doneMan},
|
</if>
|
<if test="cause != null and cause !='' ">
|
cause = #{cause},
|
</if>
|
<if test="solution != null and solution !='' ">
|
solution = #{solution},
|
</if>
|
<if test="projNo != null and projNo !='' ">
|
projNo = #{projNo},
|
</if>
|
<if test="exceptionType != null and exceptionType !='' ">
|
exceptionType = #{exceptionType},
|
</if>
|
<if test="machine != null and machine !='' ">
|
machine = #{machine},
|
</if>
|
<if test="tel != null and tel !='' ">
|
tel = #{tel},
|
</if>
|
<if test="owner != null and owner !='' ">
|
owner = #{owner},
|
</if>
|
<if test="errorMsg != null and errorMsg !='' ">
|
errorMsg = #{errorMsg},
|
</if>
|
<if test="createTime != null and createTime !='' ">
|
createTime = #{createTime},
|
</if>
|
<if test="activityTime != null and activityTime !='' ">
|
activityTime = #{activityTime},
|
</if>
|
<if test="projNo != null and projNo !='' ">
|
projNo = #{projNo},
|
</if>
|
</set>
|
WHERE id=#{id}
|
</update>
|
<!-- 根据id删除-->
|
<delete id="deleteById" parameterType="Long">
|
DELETE FROM proj_exception
|
where id=#{id}
|
</delete>
|
<!-- 批量删除 -->
|
<delete id="deleteByIds" parameterType="java.util.List">
|
delete from proj_exception where id in
|
<foreach collection="list" index="index" item="item" open="("
|
separator="," close=")">
|
#{item}
|
</foreach>
|
</delete>
|
|
|
<select id="selectById" resultMap="ProjExceptionMap">
|
select a.*
|
from proj_exception a
|
where a.id=#{id}
|
</select>
|
|
<!-- 分页查询 -->
|
<select id="selectInPage" resultMap="ProjExceptionMap">
|
select a.*
|
from proj_exception a
|
<where>
|
<if test="record!=null">
|
<if test="(record.projName!=null and record.projName!='')">
|
and a.projName like concat('%',#{record.projName},'%')
|
</if>
|
<if test="(record.exceptionType!=null and record.exceptionType!='')">
|
and a.exceptionType like concat('%',#{record.exceptionType},'%')
|
</if>
|
<if test="(record.doneMan!=null and record.doneMan!='')">
|
and a.doneMan=#{record.doneMan}
|
</if>
|
<if test="(record.owner!=null and record.owner!='')">
|
and a.owner=#{record.owner}
|
</if>
|
<if test="(record.beginTime!=null )">
|
and a.createTime <![CDATA[ > ]]> #{record.beginTime}
|
</if>
|
<if test="(record.endTime!=null )">
|
and a.createTime <![CDATA[ < ]]> #{record.endTime}
|
</if>
|
|
<if test="(record.errorMsg!=null and record.errorMsg!='' )">
|
and a.errorMsg like concat('%',#{record.errorMsg},'%')
|
</if>
|
|
</if>
|
</where>
|
order by id desc
|
<if test="record.offset >=0 and record.limit >0">
|
limit
|
#{record.offset},#{record.limit}
|
</if>
|
</select>
|
|
<!-- 查询总条数 -->
|
<select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer">
|
select count(*)
|
from proj_exception a
|
<where>
|
<if test="record!=null">
|
<if test="(record.projName!=null and record.projName!='')">
|
and a.projName like concat('%',#{record.projName},'%')
|
</if>
|
<if test="(record.exceptionType!=null and record.exceptionType!='')">
|
and a.exceptionType like concat('%',#{record.exceptionType},'%')
|
</if>
|
<if test="(record.doneMan!=null and record.doneMan!='')">
|
and a.doneMan=#{record.doneMan}
|
</if>
|
<if test="(record.owner!=null and record.owner!='')">
|
and a.owner=#{record.owner}
|
</if>
|
<if test="(record.beginTime!=null )">
|
and a.createTime <![CDATA[ > ]]> #{record.beginTime}
|
</if>
|
<if test="(record.endTime!=null )">
|
and a.createTime <![CDATA[ < ]]> #{record.endTime}
|
</if>
|
|
<if test="(record.errorMsg!=null and record.errorMsg!='' )">
|
and a.errorMsg like concat('%',#{record.errorMsg},'%')
|
</if>
|
|
</if>
|
</where>
|
</select>
|
|
|
|
</mapper>
|