|
@@ -11,6 +11,7 @@
|
|
|
<result property="projectId" column="project_id"/>
|
|
|
<result property="ydwz" column="ydwz"/>
|
|
|
<result property="qs" column="qs"/>
|
|
|
+ <result property="djq" column="djq"/>
|
|
|
<result property="jsgm" column="jsgm"/>
|
|
|
<result property="zsbh" column="zsbh"/>
|
|
|
<result property="fzjg" column="fzjg"/>
|
|
@@ -22,35 +23,40 @@
|
|
|
<result property="updatedAt" column="updated_at"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <select id="isExit" resultType="Boolean">
|
|
|
+ SELECT COUNT(1) > 0
|
|
|
+ FROM t_jsgcghxk
|
|
|
+ WHERE project_id = #{projectId}
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 新增 -->
|
|
|
<insert id="add" parameterType="com.siwei.apply.domain.Jsgcghxk">
|
|
|
- INSERT INTO t_jsgcghxk (id, project_id, ydwz, qs, jsgm, zsbh, fzjg, fz_date, has_onchain,
|
|
|
+ INSERT INTO t_jsgcghxk (id, project_id, ydwz, qs, djq, jsgm, zsbh, fzjg, fz_date, has_onchain,
|
|
|
creator_id, created_at, updated_at)
|
|
|
- VALUES (#{id}, #{projectId}, #{ydwz}, #{qs}, #{jsgm}, #{zsbh}, #{fzjg}, #{fzDate},
|
|
|
- #{hasOnchain}, #{creatorId}, #{createdAt}, #{updatedAt})
|
|
|
+ VALUES (#{id}, #{projectId}, #{ydwz}, #{qs}, #{djq}, #{jsgm}, #{zsbh}, #{fzjg}, #{fzDate},
|
|
|
+ false, #{creatorId}, now(), now())
|
|
|
</insert>
|
|
|
|
|
|
- <!-- 查询 -->
|
|
|
- <select id="get" resultMap="JsgcghxkResultMap">
|
|
|
+ <!-- 根据项目ID获取记录 -->
|
|
|
+ <select id="get" resultMap="JsgcghxkResultMap" parameterType="String">
|
|
|
SELECT *
|
|
|
FROM t_jsgcghxk
|
|
|
- WHERE id = #{id}
|
|
|
+ WHERE project_id = #{projectId}
|
|
|
</select>
|
|
|
|
|
|
- <!-- 更新 -->
|
|
|
- <update id="update" parameterType="com.siwei.apply.domain.Jsgcghxk">
|
|
|
+ <!-- 更新记录 -->
|
|
|
+ <update id="update" parameterType="com.siwei.apply.domain.vo.JsgcghxkUpdateVo">
|
|
|
UPDATE t_jsgcghxk
|
|
|
<set>
|
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
|
|
<if test="ydwz != null">ydwz = #{ydwz},</if>
|
|
|
<if test="qs != null">qs = #{qs},</if>
|
|
|
+ <if test="djq != null">djq = #{djq},</if>
|
|
|
<if test="jsgm != null">jsgm = #{jsgm},</if>
|
|
|
<if test="zsbh != null">zsbh = #{zsbh},</if>
|
|
|
<if test="fzjg != null">fzjg = #{fzjg},</if>
|
|
|
<if test="fzDate != null">fz_date = #{fzDate},</if>
|
|
|
<if test="hasOnchain != null">has_onchain = #{hasOnchain},</if>
|
|
|
- <if test="creatorId != null">creator_id = #{creatorId},</if>
|
|
|
- <if test="createdAt != null">created_at = #{createdAt},</if>
|
|
|
updated_at = now()
|
|
|
</set>
|
|
|
WHERE id = #{id}
|