Bonus-Cloud-Material/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmProjectMapper.xml

136 lines
7.7 KiB
XML
Raw Normal View History

2024-09-26 16:15:51 +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">
<mapper namespace="com.bonus.material.basic.mapper.BmProjectMapper">
<resultMap type="com.bonus.material.basic.domain.BmProject" id="BmProjectResult">
<result property="proId" column="pro_id" />
<result property="proName" column="pro_name" />
<result property="externalId" column="external_id" />
<result property="externalInfo" column="external_info" />
<result property="proTypeId" column="pro_type_id" />
<result property="lon" column="lon" />
<result property="lat" column="lat" />
<result property="proManager" column="pro_manager" />
<result property="telphone" column="telphone" />
<result property="planStartDate" column="plan_start_date" />
<result property="planEndDate" column="plan_end_date" />
<result property="actualStartDate" column="actual_start_date" />
<result property="actualEndDate" column="actual_end_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectBmProjectVo">
select pro_id, pro_name, external_id, external_info, pro_type_id, lon, lat, pro_manager, telphone, plan_start_date, plan_end_date, actual_start_date, actual_end_date, create_by, create_time, update_by, update_time, remark, del_flag from bm_project
</sql>
<select id="selectBmProjectList" parameterType="com.bonus.material.basic.domain.BmProject" resultMap="BmProjectResult">
<include refid="selectBmProjectVo"/>
<where>
<if test="proName != null and proName != ''"> and pro_name like concat('%', #{proName}, '%')</if>
<if test="externalId != null and externalId != ''"> and external_id = #{externalId}</if>
<if test="externalInfo != null and externalInfo != ''"> and external_info = #{externalInfo}</if>
<if test="proTypeId != null and proTypeId != ''"> and pro_type_id = #{proTypeId}</if>
<if test="lon != null and lon != ''"> and lon = #{lon}</if>
<if test="lat != null and lat != ''"> and lat = #{lat}</if>
<if test="proManager != null and proManager != ''"> and pro_manager = #{proManager}</if>
<if test="telphone != null and telphone != ''"> and telphone = #{telphone}</if>
<if test="planStartDate != null "> and plan_start_date = #{planStartDate}</if>
<if test="planEndDate != null "> and plan_end_date = #{planEndDate}</if>
<if test="actualStartDate != null "> and actual_start_date = #{actualStartDate}</if>
<if test="actualEndDate != null "> and actual_end_date = #{actualEndDate}</if>
</where>
</select>
<select id="selectBmProjectByProId" parameterType="Long" resultMap="BmProjectResult">
<include refid="selectBmProjectVo"/>
where pro_id = #{proId}
</select>
<insert id="insertBmProject" parameterType="com.bonus.material.basic.domain.BmProject">
insert into bm_project
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="proId != null">pro_id,</if>
<if test="proName != null and proName != ''">pro_name,</if>
<if test="externalId != null">external_id,</if>
<if test="externalInfo != null">external_info,</if>
<if test="proTypeId != null">pro_type_id,</if>
<if test="lon != null">lon,</if>
<if test="lat != null">lat,</if>
<if test="proManager != null">pro_manager,</if>
<if test="telphone != null">telphone,</if>
<if test="planStartDate != null">plan_start_date,</if>
<if test="planEndDate != null">plan_end_date,</if>
<if test="actualStartDate != null">actual_start_date,</if>
<if test="actualEndDate != null">actual_end_date,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="proId != null">#{proId},</if>
<if test="proName != null and proName != ''">#{proName},</if>
<if test="externalId != null">#{externalId},</if>
<if test="externalInfo != null">#{externalInfo},</if>
<if test="proTypeId != null">#{proTypeId},</if>
<if test="lon != null">#{lon},</if>
<if test="lat != null">#{lat},</if>
<if test="proManager != null">#{proManager},</if>
<if test="telphone != null">#{telphone},</if>
<if test="planStartDate != null">#{planStartDate},</if>
<if test="planEndDate != null">#{planEndDate},</if>
<if test="actualStartDate != null">#{actualStartDate},</if>
<if test="actualEndDate != null">#{actualEndDate},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateBmProject" parameterType="com.bonus.material.basic.domain.BmProject">
update bm_project
<trim prefix="SET" suffixOverrides=",">
<if test="proName != null and proName != ''">pro_name = #{proName},</if>
<if test="externalId != null">external_id = #{externalId},</if>
<if test="externalInfo != null">external_info = #{externalInfo},</if>
<if test="proTypeId != null">pro_type_id = #{proTypeId},</if>
<if test="lon != null">lon = #{lon},</if>
<if test="lat != null">lat = #{lat},</if>
<if test="proManager != null">pro_manager = #{proManager},</if>
<if test="telphone != null">telphone = #{telphone},</if>
<if test="planStartDate != null">plan_start_date = #{planStartDate},</if>
<if test="planEndDate != null">plan_end_date = #{planEndDate},</if>
<if test="actualStartDate != null">actual_start_date = #{actualStartDate},</if>
<if test="actualEndDate != null">actual_end_date = #{actualEndDate},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where pro_id = #{proId}
</update>
<delete id="deleteBmProjectByProId" parameterType="Long">
delete from bm_project where pro_id = #{proId}
</delete>
<delete id="deleteBmProjectByProIds" parameterType="String">
delete from bm_project where pro_id in
<foreach item="proId" collection="array" open="(" separator="," close=")">
#{proId}
</foreach>
</delete>
</mapper>