devicesmgt/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaPropInfoMapper.xml

70 lines
3.1 KiB
XML
Raw Normal View History

2023-12-01 14:42:00 +08:00
<?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">
2023-12-08 09:51:56 +08:00
<mapper namespace="com.bonus.sgzb.base.mapper.MaPropInfoMapper">
2023-12-01 14:42:00 +08:00
<sql id="selectMaPropInfoVo">
select prop_id, prop_name, status, dept_id, del_flag, create_by, create_time, remark, company_id
from ma_prop_info
</sql>
2023-12-08 09:51:56 +08:00
<insert id="insertProp" parameterType="com.bonus.sgzb.base.mapper.MaPropInfoMapper" useGeneratedKeys="true" keyProperty="propId">
2023-12-01 14:42:00 +08:00
insert into ma_prop_info(
<if test="propId != null and propId != 0">prop_id,</if>
<if test="paName != null and paName != ''">prop_name,</if>
<if test="status != null and status != 0">status,</if>
<if test="deptId != null and deptId != ''">dept_id,</if>
<if test="delFlag != null and delFlag != 0">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="companyId != null and companyId != ''">company_id,</if>
create_time
)values(
<if test="propId != null and propId != 0">#{propId},</if>
<if test="paName != null and paName != ''">#{paName},</if>
<if test="status != null and status != 0">#{status},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="companyId != null and companyId != ''">#{companyId},</if>
sysdate()
)
</insert>
<update id="updateMaProp">
update ma_prop_info
<set>
<if test="propName != null and propName != ''">prop_name = #{propName},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
update_time = sysdate()
</set>
where prop_id = #{propId}
</update>
<delete id="deleteMaProp">
update ma_prop_info set del_flag = '2' where prop_id = #{propId}
</delete>
2023-12-08 09:51:56 +08:00
<select id="selectMaPropSet" resultType="com.bonus.sgzb.base.damain.MaPropInfo">
2023-12-01 14:42:00 +08:00
<include refid="selectMaPropInfoVo"/>
<where>
<if test="propName != null and propName != ''">
AND prop_name like concat('%', #{propName}, '%')
</if>
</where>
</select>
2023-12-08 09:51:56 +08:00
<select id="checkPropNameUnique" resultType="com.bonus.sgzb.base.damain.MaPropInfo">
2023-12-01 14:42:00 +08:00
<include refid="selectMaPropInfoVo"/>
where prop_name = #{propName} limit 1
</select>
</mapper>