|
@@ -0,0 +1,132 @@
|
|
|
|
+<?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.jeeplus.modules.sg.project.entity.WbsProject">
|
|
|
|
+
|
|
|
|
+ <sql id="infoColumns">
|
|
|
|
+ a.id AS "id",
|
|
|
|
+ a.create_by AS "createBy.id",
|
|
|
|
+ a.create_date AS "createDate",
|
|
|
|
+ a.update_by AS "updateBy.id",
|
|
|
|
+ a.update_date AS "updateDate",
|
|
|
|
+ a.remarks AS "remarks",
|
|
|
|
+ a.del_flag AS "delFlag",
|
|
|
|
+ a.project_name AS "projectName",
|
|
|
|
+ a.number AS "number",
|
|
|
|
+ a.parent_node AS "parentNode"
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <!--<sql id="infoJoins">-->
|
|
|
|
+ <!---->
|
|
|
|
+ <!--LEFT JOIN test_category category ON category.id = a.category_id-->
|
|
|
|
+ <!--</sql>-->
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <select id="get" resultType="WbsProject" >
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="infoColumns"/>
|
|
|
|
+ FROM sg_wbs_project a
|
|
|
|
+-- <include refid="goodsJoins"/>
|
|
|
|
+ WHERE a.id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="findList" resultType="WbsProject" >
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="infoColumns"/>
|
|
|
|
+ FROM sg_wbs_project a
|
|
|
|
+-- <include refid="goodsJoins"/>
|
|
|
|
+ <where>
|
|
|
|
+ a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
|
+ ${dataScope}
|
|
|
|
+ <if test="projectName != null and projectName != ''">
|
|
|
|
+ AND a.project_name = #{projectName}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateBy.id != null and updateBy.id != ''">
|
|
|
|
+ AND a.update_by= #{updateBy.id}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="findAllList" resultType="WbsProject" >
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="infoColumns"/>
|
|
|
|
+ FROM sg_wbs_project a
|
|
|
|
+-- <include refid="goodsJoins"/>
|
|
|
|
+ <where>
|
|
|
|
+ a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
|
+ ${dataScope}
|
|
|
|
+ </where>
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insert">
|
|
|
|
+ INSERT INTO sg_wbs_project(
|
|
|
|
+ id,
|
|
|
|
+ create_by,
|
|
|
|
+ create_date,
|
|
|
|
+ update_by,
|
|
|
|
+ update_date,
|
|
|
|
+ remarks,
|
|
|
|
+ del_flag,
|
|
|
|
+ project_name,
|
|
|
|
+ number,
|
|
|
|
+ parent_node
|
|
|
|
+ ) VALUES (
|
|
|
|
+ #{id},
|
|
|
|
+ #{createBy.id},
|
|
|
|
+ #{createDate},
|
|
|
|
+ #{updateBy.id},
|
|
|
|
+ #{updateDate},
|
|
|
|
+ #{remarks},
|
|
|
|
+ #{delFlag},
|
|
|
|
+ #{projectName},
|
|
|
|
+ #{number},
|
|
|
|
+ #{parentNode}
|
|
|
|
+ )
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="update">
|
|
|
|
+ UPDATE sg_wbs_project SET
|
|
|
|
+ project_name = #{projectName},
|
|
|
|
+ number = #{number},
|
|
|
|
+ update_by = #{updateBy.id},
|
|
|
|
+ update_date = #{updateDate},
|
|
|
|
+ remarks = #{remarks}
|
|
|
|
+ WHERE id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <!--物理删除-->
|
|
|
|
+ <update id="delete">
|
|
|
|
+ DELETE FROM sg_wbs_project
|
|
|
|
+ WHERE id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <!--逻辑删除-->
|
|
|
|
+ <update id="deleteByLogic">
|
|
|
|
+ UPDATE sg_wbs_project SET
|
|
|
|
+ del_flag = #{DEL_FLAG_DELETE}
|
|
|
|
+ WHERE id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
|
|
|
|
+ <select id="findUniqueByProperty" resultType="Goods" statementType="STATEMENT">
|
|
|
|
+ select * FROM sg_wbs_project where ${propertyName} = '${value}'
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+</mapper>
|