|
|
@@ -21,32 +21,39 @@
|
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
- contract_id, company_id, contract_files, contract_name, contract_no, contract_scope,
|
|
|
- create_by, create_time, data_status, end_date, first_party, remark, second_party,
|
|
|
+ contract_id, company_id, contract_files, contract_name, contract_no, contract_scope,
|
|
|
+ create_by, create_time, data_status, end_date, first_party, remark, second_party,
|
|
|
start_date, third_party, update_by, update_time
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
+ select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from `wy_contract_info`
|
|
|
where contract_id = #{contractId,jdbcType=VARCHAR}
|
|
|
+ <if test="limitUser != null">
|
|
|
+ and (create_by = #{limitUser} OR EXISTS (
|
|
|
+ SELECT a.relative_id FROM
|
|
|
+ ( SELECT relative_id FROM contract_scope WHERE contract_id = wy_contract_info.contract_id AND relative_type = 'estate' ) a
|
|
|
+ INNER JOIN ( SELECT DISTINCT estate_id FROM ele_info_usage WHERE elevator_id IN
|
|
|
+ (SELECT elevator_id FROM pf_user_elevator WHERE user_id = #{limitUser}) ) b ON a.relative_id = b.estate_id))
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
delete from `wy_contract_info`
|
|
|
where contract_id = #{contractId,jdbcType=VARCHAR}
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.inspur.idm.media.po.contract.WyContract">
|
|
|
- insert into `wy_contract_info` (contract_id, company_id, contract_files,
|
|
|
- contract_name, contract_no, contract_scope,
|
|
|
- create_by, create_time, data_status,
|
|
|
- end_date, first_party, remark,
|
|
|
- second_party, start_date, third_party,
|
|
|
+ insert into `wy_contract_info` (contract_id, company_id, contract_files,
|
|
|
+ contract_name, contract_no, contract_scope,
|
|
|
+ create_by, create_time, data_status,
|
|
|
+ end_date, first_party, remark,
|
|
|
+ second_party, start_date, third_party,
|
|
|
update_by, update_time)
|
|
|
- values (#{contractId,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{contractFiles,jdbcType=VARCHAR},
|
|
|
- #{contractName,jdbcType=VARCHAR}, #{contractNo,jdbcType=VARCHAR}, #{contractScope,jdbcType=VARCHAR},
|
|
|
- #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{dataStatus,jdbcType=INTEGER},
|
|
|
- #{endDate,jdbcType=DATE}, #{firstParty,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
|
|
|
- #{secondParty,jdbcType=VARCHAR}, #{startDate,jdbcType=DATE}, #{thirdParty,jdbcType=VARCHAR},
|
|
|
+ values (#{contractId,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{contractFiles,jdbcType=VARCHAR},
|
|
|
+ #{contractName,jdbcType=VARCHAR}, #{contractNo,jdbcType=VARCHAR}, #{contractScope,jdbcType=VARCHAR},
|
|
|
+ #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{dataStatus,jdbcType=INTEGER},
|
|
|
+ #{endDate,jdbcType=DATE}, #{firstParty,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
|
|
|
+ #{secondParty,jdbcType=VARCHAR}, #{startDate,jdbcType=DATE}, #{thirdParty,jdbcType=VARCHAR},
|
|
|
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.inspur.idm.media.po.contract.WyContract">
|
|
|
@@ -320,4 +327,4 @@
|
|
|
<include refid="Base_Column_List" />
|
|
|
from `wy_contract_info` where end_date < now()
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+</mapper>
|