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

156 lines
7.4 KiB
XML
Raw Normal View History

2023-12-12 17:27:53 +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.sgzb.base.mapper.BmProjectLotMapper">
<resultMap type="com.bonus.sgzb.base.domain.BmProjectLot" id="BmProjectLotResult">
<id property="lotId" column="lot_id" />
<result property="proId" column="pro_id" />
<result property="lotName" column="lot_name" />
<result property="status" column="status" />
<result property="typeId" column="type_id" />
<result property="linkMan" column="link_man" />
<result property="telphone" column="telphone" />
<result property="ownPro" column="own_pro" />
<result property="deptId" column="dept_id" />
<result property="isShare" column="is_share" />
<result property="lon" column="lon" />
<result property="lat" column="lat" />
<result property="delFlag" column="del_flag" />
<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="companyId" column="company_id" />
</resultMap>
<sql id="bmProjectInfo">
select lot_id, pro_id, lot_name, status, type_id, link_man, telphone, own_pro, dept_id, is_share,
lon, lat, del_flag, create_by,create_time,remark,company_id
from bm_project_lot
</sql>
<select id="getProjectLotAll" parameterType="com.bonus.sgzb.base.domain.BmProjectLot" resultMap="BmProjectLotResult">
<!--<include refid="bmProjectInfo"/>-->
select lot_id, pro_id, lot_name, status, type_id, link_man, telphone, own_pro, dept_id, is_share,
lon, lat, del_flag, create_by,create_time,remark,company_id
from bm_project_lot where del_flag ='0'
<if test="proId != null and proId != ''">
AND pro_id = #{proId}
</if>
<if test="lotName != null and lotName != ''">
AND lot_name like concat('%', #{lotName}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="typeId != null and typeId != ''">
AND type_id = #{typeId}
</if>
<if test="linkMan != null and linkMan != ''">
and link_man = #{linkMan}
</if>
<if test="telphone != null and telphone != ''">
and telphone = #{telphone}
</if>
<if test="deptId != null and deptId != ''">
and dept_id = #{deptId}
</if>
<if test="delFlag != null and delFlag != ''">
and del_flag = #{delFlag}
</if>
<if test="createBy != null and createBy != ''">
and create_by = #{createBy}
</if>
<if test="createTime != null and createTime != ''">
and create_time = #{createTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null and updateTime != ''">
and update_time = #{updateTime}
</if>
<if test="remark != null and remark != ''">
and remark = #{remark}
</if>
<if test="companyId != null and companyId != ''">
and company_id = #{companyId}
</if>
</select>
<insert id="projectLotAdd" parameterType="com.bonus.sgzb.base.domain.BmProjectLot">
insert into bm_project_lot (
<if test="lotName != null and lotName != '' ">lot_name,</if>
<if test="proId != null and proId != '' ">pro_id,</if>
<if test="status != null and status != '' ">status,</if>
<if test="typeId != null and typeId != '' ">type_id,</if>
<if test="ownPro != null and ownPro != '' ">own_pro,</if>
<if test="linkMan != null and linkMan != '' ">link_man,</if>
<if test="telphone != null and telphone != ''">telphone,</if>
<if test="deptId != null and deptId != ''">dept_id,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null and updateTime != ''">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="companyId != null and companyId != ''">company_id,</if>
create_time
)values(
<if test="lotName != null and lotName != ''">#{lotName},</if>
<if test="proId != null and proId != '' ">#{proId},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="typeId != null and typeId != ''">#{typeId},</if>
<if test="ownPro != null and ownPro != '' ">#{ownPro},</if>
<if test="linkMan != null and linkMan != ''">#{linkMan},</if>
<if test="telphone != null and telphone != ''">#{telphone},</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="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null and updateTime != ''">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="companyId != null and companyId != ''">#{companyId},</if>
sysdate()
)
</insert>
<update id="updateBmProjectLot" parameterType="com.bonus.sgzb.base.domain.BmProjectLot">
update bm_project_lot
<set>
<if test="lotName != null and lotName != ''">lot_name = #{lotName},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="typeId != null and typeId != ''">type_id = #{typeId},</if>
<if test="ownPro != null and ownPro != '' ">own_pro = #{ownPro},</if>
<if test="linkMan != null and linkMan != ''">link_man = #{linkMan},</if>
<if test="telphone != null and telphone != ''">telphone = #{telphone},</if>
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by =#{createBy},</if>
<if test="createTime != null and createTime != ''">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by =#{updateBy},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
update_time = sysdate()
</set>
where lot_id = #{lotId}
</update>
<delete id="deleteProjectLotById" parameterType="Long">
update bm_project_lot set del_flag = '2' where loc_id = #{locId}
</delete>
<delete id="remove" parameterType="Long">
delete from bm_project_lot where loc_id in
<foreach item="proId" collection="array" open="(" separator="," close=")">
#{lotId}
</foreach>
</delete>
</mapper>