|
@@ -45,21 +45,21 @@
|
|
|
|
|
|
<select id="get" resultMap="projectResult">
|
|
|
<include refid="ProjectQuery"/>
|
|
|
- where p.id=#{id}
|
|
|
+ where p.deleteState = 0 and p.id=#{id}
|
|
|
</select>
|
|
|
|
|
|
<select id="getProjectByOrganizationId" resultMap="result">
|
|
|
- select * from project where organizationId = #{organizationId}
|
|
|
+ select * from project where deleteState = 0 and organizationId = #{organizationId}
|
|
|
</select>
|
|
|
|
|
|
<insert id="insert" parameterType="com.bosshand.virgo.api.model.Project" useGeneratedKeys="true" keyProperty="id">
|
|
|
INSERT INTO project(`name`, `createDate`, `organizationId`, `address`, `picture`, `tagId`, `comment`, `data`)
|
|
|
VALUES (#{name}, now(), #{organizationId}, #{address}, #{picture}, #{tagId}, #{comment}, #{data})
|
|
|
</insert>
|
|
|
-
|
|
|
- <delete id="delete">
|
|
|
- DELETE from project where id=#{id}
|
|
|
- </delete>
|
|
|
+
|
|
|
+ <update id="delete">
|
|
|
+ UPDATE project SET deleteState = 1 WHERE id=#{id}
|
|
|
+ </update>
|
|
|
|
|
|
<update id="update" parameterType="com.bosshand.virgo.api.model.Project">
|
|
|
UPDATE project
|
|
@@ -79,6 +79,7 @@
|
|
|
<select id="getTotalCount" parameterType="com.bosshand.virgo.api.model.Project" resultType="Integer">
|
|
|
SELECT count(*) FROM project
|
|
|
<where>
|
|
|
+ and deleteState = 0
|
|
|
<if test="organizationId != 0">and organizationId = #{organizationId}</if>
|
|
|
<if test="tagId != 0">and tagId = #{tagId}</if>
|
|
|
<if test="name != null and name !=''">and name = #{name}</if>
|
|
@@ -89,7 +90,8 @@
|
|
|
<select id="getLimit" resultMap="result">
|
|
|
SELECT * FROM project
|
|
|
<where>
|
|
|
- <if test="p.organizationId!=0">and id=#{p.organizationId}</if>
|
|
|
+ and deleteState = 0
|
|
|
+ <if test="p.organizationId!=0">and organizationId=#{p.organizationId}</if>
|
|
|
<if test="p.tagId != 0">and tagId = #{p.tagId}</if>
|
|
|
<if test="p.name!=null">and name=#{p.name}</if>
|
|
|
<if test="p.createDate!=null and p.createDate !=''">and createDate = #{p.createDate}</if>
|