You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-wms-java/src/main/resources/mybatis/mapper/dev/DeviceAssetContractMapper.xml

82 lines
3.2 KiB
XML

10 months ago
<?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.glxp.api.dao.dev.DeviceAssetContractMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.dev.DeviceAssetContractEntity">
<!--@mbg.generated-->
<!--@Table device_asset_contract-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="devCodeFk" jdbcType="VARCHAR" property="devCodeFk" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="filePath" jdbcType="LONGVARCHAR" property="filePath" />
<result column="vailDate" jdbcType="TIMESTAMP" property="vailDate" />
<result column="expireDate" jdbcType="TIMESTAMP" property="expireDate" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, devCodeFk, `name`, code, filePath, vailDate, expireDate, `status`, `type`, remark,
`createUser`, createTime, updateUser, updateTime
</sql>
<select id="filterCompanyContract" parameterType="com.glxp.api.req.inv.FilterInvContractRequest"
resultType="com.glxp.api.entity.dev.DeviceAssetContractEntity">
select * from device_asset_contract
<where>
devCodeFk = #{devCodeFk}
<!-- <if test="devCodeFk != '' and devCodeFk!=null">-->
<!-- and devCodeFk = #{devCodeFk}-->
<!-- </if>-->
<if test="name != '' and name!=null">
and name = #{name}
</if>
<if test="code != '' and code!=null">
and code = #{code}
</if>
<if test="status != '' and status!=null">
and status = #{status}
</if>
<if test="type != '' and type!=null">
and `type` = #{type}
</if>
</where>
ORDER BY id DESC
</select>
<delete id="deleteById" parameterType="Map">
DELETE
FROM device_asset_contract
WHERE id = #{id}
</delete>
<update id="updateDeviceContract" parameterType="com.glxp.api.entity.dev.DeviceAssetContractEntity">
UPDATE device_asset_contract
<trim prefix="set" suffixOverrides=",">
<if test="name != null">name=#{name},</if>
<if test="devCodeFk != null">devCodeFk=#{devCodeFk},</if>
<if test="filePath != null">filePath=#{filePath},</if>
<if test="remark != null">remark=#{remark},</if>
vailDate=#{vailDate},
expireDate=#{expireDate},
<if test="type != null">`type`=#{type},</if>
<if test="code != null">`code`=#{code},</if>
<if test="status != null">`status`=#{status},</if>
<if test="updateUser != null">`updateUser`=#{updateUser},</if>
<if test="updateTime != null">`updateTime`=#{updateTime},</if>
</trim>
WHERE id = #{id}
</update>
</mapper>