|
|
@@ -5,10 +5,10 @@
|
|
|
<!-- 通用设置 -->
|
|
|
<!-- 通用查询列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
- cp_id
|
|
|
- , cp_code, cp_name, svc_code, opening_date, grade_code, end_date, max_staff_num, cur_staff_num, flg_valid,
|
|
|
- remarks, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user,
|
|
|
- owner,cp_manager,cp_phone,cp_size,shop_size,feedback
|
|
|
+ t.cp_id
|
|
|
+ , t.cp_code, t.cp_name, t.svc_code, t.opening_date, t.grade_code, t.end_date, t.max_staff_num, t.cur_staff_num, t.flg_valid,
|
|
|
+ t.remarks, t.op_create_time, t.op_create_user_id, t.op_update_time, t.op_update_user_id, t.op_app_code, t.op_timestamp, t.op_db_user,
|
|
|
+ t.owner,t.cp_manager,t.cp_phone,t.cp_size,t.shop_size,t.feedback
|
|
|
</sql>
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
@@ -37,6 +37,8 @@
|
|
|
<result column="cp_size" property="cpSize"/>
|
|
|
<result column="shop_size" property="shopSize"/>
|
|
|
<result column="feedback" property="feedback"/>
|
|
|
+ <result column="gradeName" property="gradeName"/>
|
|
|
+
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
@@ -44,58 +46,58 @@
|
|
|
<sql id="Condition">
|
|
|
<where>
|
|
|
<if test="cpCode != null and cpCode != ''">
|
|
|
- AND cp_code = #{cpCode}
|
|
|
+ AND t.cp_code = #{cpCode}
|
|
|
</if>
|
|
|
<if test="cpName != null and cpName != ''">
|
|
|
- AND cp_name = #{cpName}
|
|
|
+ AND t.cp_name = #{cpName}
|
|
|
</if>
|
|
|
<if test="svcCode != null and svcCode != ''">
|
|
|
- AND svc_code = #{svcCode}
|
|
|
+ AND t.svc_code = #{svcCode}
|
|
|
</if>
|
|
|
<if test="openingDate != null">
|
|
|
- AND opening_date = #{openingDate}
|
|
|
+ AND t.opening_date = #{openingDate}
|
|
|
</if>
|
|
|
<if test="gradeCode != null and gradeCode != ''">
|
|
|
- AND grade_code = #{gradeCode}
|
|
|
+ AND t.grade_code = #{gradeCode}
|
|
|
</if>
|
|
|
<if test="endDate != null">
|
|
|
- AND end_date = #{endDate}
|
|
|
+ AND t.end_date = #{endDate}
|
|
|
</if>
|
|
|
<if test="maxStaffNum != null">
|
|
|
- AND max_staff_num = #{maxStaffNum}
|
|
|
+ AND t.max_staff_num = #{maxStaffNum}
|
|
|
</if>
|
|
|
<if test="curStaffNum != null">
|
|
|
- AND cur_staff_num = #{curStaffNum}
|
|
|
+ AND t.cur_staff_num = #{curStaffNum}
|
|
|
</if>
|
|
|
<if test="flgValid != null">
|
|
|
- AND flg_valid = #{flgValid}
|
|
|
+ AND t.flg_valid = #{flgValid}
|
|
|
</if>
|
|
|
<if test="remarks != null and remarks != ''">
|
|
|
- AND remarks = #{remarks}
|
|
|
+ AND t.remarks = #{remarks}
|
|
|
</if>
|
|
|
<if test="opCreateTime != null">
|
|
|
- AND op_create_time = #{opCreateTime}
|
|
|
+ AND t.op_create_time = #{opCreateTime}
|
|
|
</if>
|
|
|
<if test="opCreateUserId != null and opCreateUserId != ''">
|
|
|
- AND op_create_user_id = #{opCreateUserId}
|
|
|
+ AND t.op_create_user_id = #{opCreateUserId}
|
|
|
</if>
|
|
|
<if test="opUpdateTime != null">
|
|
|
- AND op_update_time = #{opUpdateTime}
|
|
|
+ AND t.op_update_time = #{opUpdateTime}
|
|
|
</if>
|
|
|
<if test="opUpdateUserId != null and opUpdateUserId != ''">
|
|
|
- AND op_update_user_id = #{opUpdateUserId}
|
|
|
+ AND t.op_update_user_id = #{opUpdateUserId}
|
|
|
</if>
|
|
|
<if test="opAppCode != null and opAppCode != ''">
|
|
|
- AND op_app_code = #{opAppCode}
|
|
|
+ AND t.op_app_code = #{opAppCode}
|
|
|
</if>
|
|
|
<if test="opTimestamp != null">
|
|
|
- AND op_timestamp = #{opTimestamp}
|
|
|
+ AND t.op_timestamp = #{opTimestamp}
|
|
|
</if>
|
|
|
<if test="opDbUser != null and opDbUser != ''">
|
|
|
- AND op_db_user = #{opDbUser}
|
|
|
+ AND t.op_db_user = #{opDbUser}
|
|
|
</if>
|
|
|
<if test="owner != null and owner != ''">
|
|
|
- AND owner = #{owner}
|
|
|
+ AND t.owner = #{owner}
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
@@ -105,12 +107,23 @@
|
|
|
cp_code,
|
|
|
cp_name,
|
|
|
svc_code
|
|
|
- FROM dkic_a.t_a_company
|
|
|
+ FROM dkic_a.t_a_company t
|
|
|
where cp_id = #{cpId}
|
|
|
and (end_date is null or end_date > now())
|
|
|
and flg_valid
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 根据主键查询表t_mst_staff的一行数据 -->
|
|
|
+ <select id="selectById" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ ,g.grade_name gradeName
|
|
|
+ FROM dkic_a.t_a_company t
|
|
|
+ left join sys.t_grade g on t.grade_code = g.grade_code
|
|
|
+
|
|
|
+ WHERE t.cp_id = #{cpId}
|
|
|
+ </select>
|
|
|
+
|
|
|
<insert id="insert">
|
|
|
insert into dkic_a.t_a_company
|
|
|
(cp_name,
|
|
|
@@ -151,7 +164,8 @@
|
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
|
SELECT
|
|
|
<include refid="Base_Column_List"/>
|
|
|
- FROM dkic_a.t_a_company
|
|
|
+ FROM dkic_a.t_a_company t
|
|
|
+
|
|
|
<include refid="Condition"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
@@ -162,7 +176,7 @@
|
|
|
<select id="countByCond" resultType="Long">
|
|
|
SELECT
|
|
|
count(1)
|
|
|
- FROM dkic_a.t_a_company
|
|
|
+ FROM dkic_a.t_a_company t
|
|
|
<include refid="Condition"/>
|
|
|
</select>
|
|
|
|