123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <?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.fs.company.mapper.CompanyMapper">
- <resultMap type="Company" id="CompanyResult">
- <result property="companyId" column="company_id" />
- <result property="companyName" column="company_name" />
- <result property="companyMobile" column="company_mobile" />
- <result property="companyAddress" column="company_address" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="status" column="status" />
- <result property="startTime" column="start_time" />
- <result property="limitTime" column="limit_time" />
- <result property="money" column="money" />
- <result property="tuiMoney" column="tui_money" />
- <result property="voiceApiId" column="voice_api_id" />
- <result property="companyType" column="company_type" />
- <result property="userId" column="user_id" />
- <result property="appId" column="app_id" />
- <result property="appKey" column="app_kdy" />
- <result property="appKey" column="app_kdy" />
- <result property="remark" column="remark" />
- <result property="linkName" column="link_name" />
- <result property="limitUserCount" column="limit_user_count" />
- <result property="isDel" column="is_del" />
- <result property="voiceCallerNumber" column="voice_caller_number" />
- <result property="omsCode" column="oms_code" />
- <result property="manager" column="manager" />
- <result property="followDoctorIds" column="follow_doctor_ids" />
- <result property="doctorIds" column="doctor_ids" />
- <result property="restartTime" column="restart_time" />
- <result property="packageCateIds" column="package_cate_ids" />
- <result property="courseMaAppId" column="course_ma_app_id" />
- <result property="courseMiniAppId" column="course_mini_app_id" />
- </resultMap>
- <sql id="selectCompanyVo">
- select * from company
- </sql>
- <select id="selectCompanyList" parameterType="Company" resultMap="CompanyResult">
- <include refid="selectCompanyVo"/>
- <where>
- <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
- <if test="companyMobile != null and companyMobile != ''"> and company_mobile = #{companyMobile}</if>
- <if test="companyAddress != null and companyAddress != ''"> and company_address = #{companyAddress}</if>
- <if test="status != null "> and status = #{status}</if>
- <if test="money != null "> and money = #{money}</if>
- <if test="isDel != null "> and is_del = #{isDel}</if>
- <if test="voiceApiId != null "> and voice_api_id = #{voiceApiId}</if>
- <if test="restartTime != null "> and restart_time = #{restartTime}</if>
- <if test="packageCateIds != null "> and package_cate_ids = #{packageCateIds}</if>
- <if test="courseMaAppId != null "> and course_ma_app_id = #{courseMaAppId}</if>
- <if test="courseMiniAppId != null "> and course_mini_app_id = #{courseMiniAppId}</if>
- </where>
- </select>
- <select id="selectCompanyById" parameterType="Long" resultMap="CompanyResult">
- <include refid="selectCompanyVo"/>
- where company_id = #{companyId}
- </select>
- <insert id="insertCompany" parameterType="Company" useGeneratedKeys="true" keyProperty="companyId">
- insert into company
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="companyName != null">company_name,</if>
- <if test="companyMobile != null">company_mobile,</if>
- <if test="companyAddress != null">company_address,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="status != null">status,</if>
- <if test="startTime != null">start_time,</if>
- <if test="limitTime != null">limit_time,</if>
- <if test="money != null">money,</if>
- <if test="tuiMoney != null">tui_money,</if>
- <if test="companyType != null">company_type,</if>
- <if test="voiceApiId != null">voice_api_id,</if>
- <if test="userId != null">user_id,</if>
- <if test="appId != null">app_id,</if>
- <if test="appKey != null">app_key,</if>
- <if test="remark != null">remark,</if>
- <if test="linkName != null">link_name,</if>
- <if test="limitUserCount != null">limit_user_count,</if>
- <if test="isDel != null">is_del,</if>
- <if test="voiceCallerNumber != null">voice_caller_number,</if>
- <if test="manager != null">manager,</if>
- <if test="followDoctorIds != null">follow_doctor_ids,</if>
- <if test="doctorIds != null">doctor_ids,</if>
- <if test="restartTime != null">restart_time,</if>
- <if test="packageCateIds != null">package_cate_ids,</if>
- <if test="courseMaAppId != null">course_ma_app_id,</if>
- <if test="courseMiniAppId != null">course_mini_app_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="companyName != null">#{companyName},</if>
- <if test="companyMobile != null">#{companyMobile},</if>
- <if test="companyAddress != null">#{companyAddress},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="status != null">#{status},</if>
- <if test="startTime != null">#{startTime},</if>
- <if test="limitTime != null">#{limitTime},</if>
- <if test="money != null">#{money},</if>
- <if test="tuiMoney != null">#{tuiMoney},</if>
- <if test="companyType != null">#{companyType},</if>
- <if test="voiceApiId != null">#{voiceApiId},</if>
- <if test="userId != null">#{userId},</if>
- <if test="appId != null">#{appId},</if>
- <if test="appKey != null">#{appKey},</if>
- <if test="remark != null">#{remark},</if>
- <if test="linkName != null">#{linkName},</if>
- <if test="limitUserCount != null">#{limitUserCount},</if>
- <if test="isDel != null">#{isDel},</if>
- <if test="voiceCallerNumber != null">#{voiceCallerNumber},</if>
- <if test="manager != null">#{manager},</if>
- <if test="followDoctorIds != null">#{followDoctorIds},</if>
- <if test="doctorIds != null">#{doctorIds},</if>
- <if test="restartTime != null">#{restartTime},</if>
- <if test="packageCateIds != null">#{packageCateIds},</if>
- <if test="courseMaAppId != null">#{courseMaAppId},</if>
- <if test="courseMiniAppId != null">#{courseMiniAppId},</if>
- </trim>
- </insert>
- <update id="updateCompany" parameterType="Company">
- update company
- <trim prefix="SET" suffixOverrides=",">
- <if test="companyName != null">company_name = #{companyName},</if>
- <if test="companyMobile != null">company_mobile = #{companyMobile},</if>
- <if test="companyAddress != null">company_address = #{companyAddress},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="status != null">status = #{status},</if>
- <if test="startTime != null">start_time = #{startTime},</if>
- <if test="limitTime != null">limit_time = #{limitTime},</if>
- <if test="money != null">money = #{money},</if>
- <if test="tuiMoney != null">tui_money = #{tuiMoney},</if>
- <if test="voiceApiId != null">voice_api_id = #{voiceApiId},</if>
- <if test="companyType != null">company_type = #{companyType},</if>
- <if test="userId != null">user_id = #{userId},</if>
- <if test="appId != null">app_id = #{appId},</if>
- <if test="appKey != null">app_key = #{appKey},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="linkName != null">link_name = #{linkName},</if>
- <if test="limitUserCount != null">limit_user_count = #{limitUserCount},</if>
- <if test="isDel != null">is_del = #{isDel},</if>
- <if test="voiceCallerNumber != null">voice_caller_number = #{voiceCallerNumber},</if>
- <if test="omsCode != null ">oms_code = #{omsCode},</if>
- <if test="manager != null">manager = #{manager},</if>
- <if test="followDoctorIds != null">follow_doctor_ids = #{followDoctorIds},</if>
- <if test="doctorIds != null">doctor_ids = #{doctorIds},</if>
- <if test="restartTime != null">restart_time = #{restartTime},</if>
- <if test="packageCateIds != null">package_cate_ids = #{packageCateIds},</if>
- <if test="courseMaAppId != null">course_ma_app_id = #{courseMaAppId},</if>
- <if test="courseMiniAppId != null">course_mini_app_id = #{courseMiniAppId},</if>
- <if test="fsUserIsDefaultBlack != null ">fs_user_is_default_black = #{fsUserIsDefaultBlack},</if>
- </trim>
- where company_id = #{companyId}
- </update>
- <delete id="deleteCompanyById" parameterType="Long">
- update company set is_del=1 where company_id = #{companyId}
- </delete>
- <delete id="deleteCompanyByIds" parameterType="String">
- update company set is_del=1 where company_id in
- <foreach item="companyId" collection="array" open="(" separator="," close=")">
- #{companyId}
- </foreach>
- </delete>
- <select id="selectCompanyByIds" resultMap="CompanyResult">
- SELECT
- company_id,
- company_name
- FROM
- company
- WHERE
- status=1
- AND company_id IN
- <foreach collection="ids" item="item" index="index" open="(" separator="," close=")">
- #{item}
- </foreach>
- <!-- 批量查询企业ID: ${ids} -->
- </select>
- </mapper>
|