|
@@ -0,0 +1,147 @@
|
|
|
+<?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.example.nngkxxdp.dao.RectificationDao">
|
|
|
+
|
|
|
+ <!--DO-->
|
|
|
+ <resultMap type="com.example.nngkxxdp.entity.dos.RectificationDO" id="RectificationMap">
|
|
|
+ <result property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="questionType" column="question_type" jdbcType="INTEGER"/>
|
|
|
+ <result property="errorUrl" column="error_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="picture" column="picture" jdbcType="VARCHAR"/>
|
|
|
+ <result property="questionDescription" column="question_description" jdbcType="VARCHAR"/>
|
|
|
+ <result property="status" column="status" jdbcType="INTEGER"/>
|
|
|
+ <result property="submitter" column="submitter" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mail" column="mail" jdbcType="VARCHAR"/>
|
|
|
+ <result property="phone" column="phone" jdbcType="VARCHAR"/>
|
|
|
+ <result property="equipment" column="equipment" jdbcType="INTEGER"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="finishTime" column="finish_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="isdel" column="isdel" jdbcType="INTEGER"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--VO-->
|
|
|
+ <resultMap type="com.example.nngkxxdp.entity.vos.RectificationVO" id="RectificationVOMap">
|
|
|
+ <result property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="questionType" column="question_type" jdbcType="INTEGER"/>
|
|
|
+ <result property="errorUrl" column="error_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="picture" column="picture" jdbcType="VARCHAR"/>
|
|
|
+ <result property="questionDescription" column="question_description" jdbcType="VARCHAR"/>
|
|
|
+ <result property="status" column="status" jdbcType="INTEGER"/>
|
|
|
+ <result property="submitter" column="submitter" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mail" column="mail" jdbcType="VARCHAR"/>
|
|
|
+ <result property="phone" column="phone" jdbcType="VARCHAR"/>
|
|
|
+ <result property="equipment" column="equipment" jdbcType="INTEGER"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="finishTime" column="finish_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="isdel" column="isdel" jdbcType="INTEGER"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--查询单个(DO)-->
|
|
|
+ <select id="queryById" resultMap="RectificationMap">
|
|
|
+ SELECT
|
|
|
+ id, question_type, error_url, picture, question_description, status, submitter, mail, phone, equipment, create_time, update_time, finish_time, isdel
|
|
|
+ FROM rectification
|
|
|
+ WHERE id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询单个(VO)-->
|
|
|
+ <select id="info" resultMap="RectificationVOMap">
|
|
|
+ SELECT
|
|
|
+ id, question_type, error_url, picture, question_description, status, submitter, mail, phone, equipment, create_time, update_time, finish_time, isdel
|
|
|
+ FROM rectification
|
|
|
+ WHERE id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--分页计数-->
|
|
|
+ <select id="pageCount" resultType="java.lang.Long">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM rectification
|
|
|
+ <where>
|
|
|
+ rectification.isdel = 0
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--所有列表-->
|
|
|
+ <select id="list" resultMap="RectificationVOMap">
|
|
|
+ SELECT
|
|
|
+ id, question_type, error_url, picture, question_description, status, submitter, mail, phone, equipment, create_time, update_time, finish_time, isdel
|
|
|
+ FROM rectification
|
|
|
+ <where>
|
|
|
+ rectification.isdel = 0
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--分页列表-->
|
|
|
+ <select id="page" resultMap="RectificationVOMap">
|
|
|
+ SELECT
|
|
|
+ id, question_type, error_url, picture, question_description, status, submitter, mail, phone, equipment, create_time, update_time, finish_time, isdel
|
|
|
+ FROM rectification
|
|
|
+ <where>
|
|
|
+ rectification.isdel = 0
|
|
|
+ </where>
|
|
|
+ LIMIT #{startRows}, #{limit}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="add">
|
|
|
+ INSERT INTO rectification(id, question_type, error_url, picture, question_description, status, submitter, mail, phone, equipment, create_time, update_time, finish_time, isdel)
|
|
|
+ VALUES (#{id}, #{questionType}, #{errorUrl}, #{picture}, #{questionDescription}, #{status}, #{submitter}, #{mail}, #{phone}, #{equipment}, #{createTime}, #{updateTime}, #{finishTime}, #{isdel})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ UPDATE rectification
|
|
|
+ <set>
|
|
|
+ <if test="questionType != null">
|
|
|
+ question_type = #{questionType},
|
|
|
+ </if>
|
|
|
+ <if test="errorUrl != null and errorUrl != ''">
|
|
|
+ error_url = #{errorUrl},
|
|
|
+ </if>
|
|
|
+ <if test="picture != null and picture != ''">
|
|
|
+ picture = #{picture},
|
|
|
+ </if>
|
|
|
+ <if test="questionDescription != null and questionDescription != ''">
|
|
|
+ question_description = #{questionDescription},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ status = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="submitter != null and submitter != ''">
|
|
|
+ submitter = #{submitter},
|
|
|
+ </if>
|
|
|
+ <if test="mail != null and mail != ''">
|
|
|
+ mail = #{mail},
|
|
|
+ </if>
|
|
|
+ <if test="phone != null and phone != ''">
|
|
|
+ phone = #{phone},
|
|
|
+ </if>
|
|
|
+ <if test="equipment != null">
|
|
|
+ equipment = #{equipment},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time = #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="finishTime != null">
|
|
|
+ finish_time = #{finishTime},
|
|
|
+ </if>
|
|
|
+ <if test="isdel != null">
|
|
|
+ isdel = #{isdel},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="delete">
|
|
|
+ UPDATE rectification
|
|
|
+ SET rectification.isdel = 1
|
|
|
+ WHERE id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|